Loosing my ID field when using Principal Component Generator

KeithrKeithr MemberPosts:10Contributor II
edited November 2018 inHelp
Hi,

I'm using the pricipal component generator to combine some highly correlated variables in a classification problem, which works fine, but it's dropping the ID I have so there is no way to tie the classification result back to the actual customer ID.

The process I'm using is as follows:
ExampleSource (label, ID, 82 variables) -> AttributeFilter (label, ID, 3 variables) -> principalComponentGenerator (label, 1 variable).

What am I doing wrong?

Thanks in advance for your help.

Keith

Answers

  • landland RapidMiner Certified Analyst, RapidMiner Certified Expert, MemberPosts:2,531Unicorn
    Hi Keith,
    you probably forgot to set the ID attribute as special attribute. Every not special attributes are used within PCA and removed afterwards. You might define the ID attribute at the operator loading the data, if it provids an parameter "id_attribute" otherwise you can change the type lateron by using the ChangeAttributeRole operator:




    Greetings,
    Sebastian
  • KeithrKeithr MemberPosts:10Contributor II
    Hi Sebastian,

    我想我tting the ID up correctly in the aml file, and it does show in the meta data view before I run the PCA as an ID.

    label dropped binominal mode = Y (624) Y (624), N (624) 0.0
    id hhId integer avg = 106,258,671.246 +/- 3,587,967.584 [100,731,555.000 ; 111,749,338.000] 0.0
    regular DELTA_1_SALES real avg = -33.475 +/- 43.687 [-100.000 ; 103.170] 0.0
    regular DELTA_1_TRIPS real avg = -22.330 +/- 48.379 [-100.000 ; 161.110] 0.0
    regular DELTA_1_CAT_PEN real avg = -30.810 +/- 38.007 [-100.000 ; 69.230] 0.0

    But after the PCA runs the ID disappears and all I have left is the label and the PCA variable. It also renames the label from dropped to "label".

    label label nominal mode = Y (624) N (624), Y (624) 0.0
    regular pc_1 real avg = -50.189 +/- 70.917 [-173.156 ; 160.344] 0.0

    aml file:


    name ="hhId"
    sourcecol = "1"
    valuetype = "integer"
    />

    name ="dropped"
    sourcecol = "2"
    valuetype = "binominal">
    Y
    N


    name ="baselineSales"
    sourcecol = "3"
    valuetype = "integer"
    />
  • TobiasMalbrechtTobiasMalbrecht Moderator, Employee, MemberPosts:294RM Product Management
    Hi Keith,

    the operator [tt]PrincipalComponentGenerator[/tt] is outdated, please use the operator [tt]PCA[/tt] instead. This operator outputs a model which can then be applied to the data using the [tt]ModelApplier[/tt]. This way, all special attributes (label and id) should be kept.

    Regards,
    Tobias
  • KeithrKeithr MemberPosts:10Contributor II
    Hi Tobias,

    起了作用。

    Thanks a lot for your help!

    Keith
Sign InorRegisterto comment.