Derive a new attribute

ContemnoContemno Member Posts: 6 Contributor II
edited November 2018 in Help
Hello there.

How can I derive a new atrribute from a given one?
For example:
atrribute A with the values high, medium, low
new attribute B with T or F
derive like this: high -> T / medium & low -> F

Thanks for any help in advance.
Greetings,
Sebastian

Answers

  • landland RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 2,531 Unicorn
    Hi Sebastian,
    this could be done easily by a combination of the two operators "AttributeCopy"  and "AttributeValueMapper". For your problem copy attribute A to the new attribute B. Then use the Mapping Operator on Attribute B by typing B into parameter attributes. Map value high to T, medium to F and low to F.

    Greetings,
      Sebastian, too :)
  • ContemnoContemno Member Posts: 6 Contributor II
    Thank you for your answer.
    But it is not what I'm looking for. I've allready tried it that way.

    The problem is the following. I need three knots to map the old attribute on the new one.
    The result is, that the first attribute "high" is mapped correctly to T and the second "medium" correctly to F. The values of the third attribute were mapped correctly to F but the parameter value "low" isn't deleted. So I've got the values T, F and Low. Low accurs zero times.
    But I need an atrribute with only the values T and F.

    I hope thats understandable. ;)

    Greets
  • landland RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 2,531 Unicorn
    To be honest: It wasn't understandable :)
    Lets figure it out: You said you have an attribute A with three different values. Attributes are the columns in the data view, values are the entries in the cells of the dataview. If thats the case, my suggestion should work quite well.
    If you have really three different attributes, you have a problem, since theres no possibility to solve your problem easily, as far as I know.

    Greetings,
      Sebastian
  • TobiasMalbrechtTobiasMalbrecht Moderator, Employee, Member Posts: 294 RM Product Management
    Hi Sebastian (Comtemno ;-)),

    as far as I understand you, all works well with the exception, that the resulting attribute after the mapping still has a value "low" as can be seen from the meta data view, but it occurs zero times. Is that right? Then what is the problem, since an occurance frequency of zero does not hurt in any subsequent analysis, although I agree that it would be nice to delete this attribute value from the attribute domain since it does not occur in the examples any more. This is however not possible with the AttributeValueMapper. But eventually we extend this operator for the next release.

    Regards,
    Tobias
  • ContemnoContemno Member Posts: 6 Contributor II
    Hello Tobias.

    Yes, you are right.
    The occurrence of the value "low" becomes a problem, when creating a decisiontree.
    The value is splitting a knot. So the value "low" is an extra knot. With zero attributes in it, of course.

    Would be nice if theres a knot in RapidMiner soon that solves this problem.

    Greets
  • IngoRMIngoRM Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, Community Manager, RMResearcher, Member, University Professor Posts: 1,751 RM Founder
    Hello,

    I could be mistaken but it might be that there already is such an operator: the operator "GuessValueTypes" guesses all value types of the attributes but it also performs some "clean-up" by removing empty, i.e. non-used, nominal values.

    Cheers,
    Ingo
Sign In or Register to comment.