Converting a nominal to binominal and setting a binominal target

amitdamitd Member, University ProfessorPosts:49Maven

I am encountering a seemingly trivial issue and would appreciate some pointers. I am analyzing the churn dataset (WA_Fn UseC_ Telco Customer Churn.csv) from theIBM sample datasets website. The sequence of the operators is set as follows:

Read CSV > Nominal to Binominal > Numerical to Binominal > Set Role > Split Validation (internally containing the model, apply, and performance operators). In each of the operators (Nominal to Binominal & Numerical to Binominal, "include special attributes" option is checked, although the label role is set later anyways.)

读CSV操作符读取生产属性a polynominal. So, in the Nominal to Binominal operator, I selected it to be transformed into a binominal type along with a few other variables. The conversion works fine (tested with a breakpoint). However, the Set Role operator does NOT list it in the attributes dropdown and thus cannot be assigned to a label.

I also tried placing the Set Role operator prior to the type transformation operator but that does not work either. In that case, the Validation operator throws a warning (Input example set must have a special attribute label). Note that for the Nominal to Binominal & Numerical to Binominal operators, "include special attributes" option is checked.

The pipeline works fine if I just proceed by keeping Churn as polynominal. However, my goal is to use the Performance (AUPRC) operator in the Operator Toolbox, which only works with a binominal label.

I would appreciate any help.

0
0 votes

Fixed and Released·Last Updated

RM-3998

Comments

  • tftemmetftemme Administrator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, RMResearcher, MemberPosts:164RM Research

    Hi@amitdeokar,

    First, to give you the best advices please post the xml of your process. Without this it is hard to guess what the problem exactly is.

    You can get the xml of your process by adding the xml view to your RapidMiner Studio (Menu View->Show Panel->XML).

    Your problem seems to be that your meta data information are at one point missing/incorrect. Without looking into the process I can suggest two solution.

    1. Split your process into two process. The first for reading the data, including the transformation operators. Use the Store operator to store the resulting ExampleSet in the repository. The second process can retrieve the data set from the repository and the meta data should be set correctly, so the Set Role operator knows the attributes.
    2. The list of the Set Role operator is only suggesting possible attributes (for which the meta data is known). If you are sure that the attribute is there you can type it in, although it is not in the list. You probably need to ignore the warning and run the process.

    Hopes this helps and happy mining

    Fabian

    jczogalla
  • amitdamitd Member, University ProfessorPosts:49Maven



    < output/>


    <凤凰社erator activated="true" class="process" compatibility="9.0.002" expanded="true" name="Process">

    <凤凰社erator activated="true" class="read_csv" compatibility="9.0.002" expanded="true" height="68" name="Read CSV" width="90" x="45" y="34">































    <凤凰社erator activated="true" class="set_role" compatibility="9.0.002" expanded="true" height="82" name="Set Role" width="90" x="179" y="34">






    <凤凰社erator activated="true" class="nominal_to_binominal" compatibility="9.0.002" expanded="true" height="103" name="Nominal to Binominal" width="90" x="313" y="34">





    <凤凰社erator activated="true" class="numerical_to_binominal" compatibility="9.0.002" expanded="true" height="82" name="Numerical to Binominal" width="90" x="447" y="34">




    <凤凰社erator activated="true" class="split_validation" compatibility="9.0.002" expanded="true" height="124" name="Validation" width="90" x="581" y="34">



    <凤凰社erator activated="true" class="concurrency:parallel_decision_tree" compatibility="9.0.002" expanded="true" height="103" name="Decision Tree" width="90" x="112" y="34">













    <凤凰社erator activated="true" class="apply_model" compatibility="9.0.002" expanded="true" height="82" name="Apply Model" width="90" x="112" y="34">


    <凤凰社erator activated="true" class="performance_classification" compatibility="9.0.002" expanded="true" height="82" name="Performance" width="90" x="246" y="34">























    < portSpacing端口= " sink_result 2”间隔= " 0 " / >




  • amitdamitd Member, University ProfessorPosts:49Maven

    1. I have posted the XML for the process in the case where "Set Role" is used prior to data type transformation.

    2. If I choose to put "Set Role" after the data type transformation, I can use a brute force approach by typing in the label attribute and make the assignment. It seems to work as you suggested. However, the warnings still persist. I don't know what is the reason for the warnings. Shouldn't the tool be able to handle this?

  • tftemmetftemme Administrator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, RMResearcher, MemberPosts:164RM Research
    Solution Accepted

    Hi@amitdeokar,

    This is indeed a bug in the meta data propagation* (see below for a general explanation of meta data) of the operator. The problem is that the Read CSV does not know in advance the values which the Churn attribute can have. When you hover over the outputport of the Read CSV operator, you see that the range of the 'Churn' attribute is 'unknown' (indeed for all attributes, cause the operator does not know the range before reading).

    You can see that the Set Role operator does a correct meta data propagation (the role of the 'Churn' attribute is set to 'label'), but the Nominal to Binominal operator has a bug in the meta data propagation in case the values are unknown. You can see that the attribute is not anymore in the meta data at the output port of the operator.

    I file a bug report for this. For now, I would suggest to go for my second proposed solution. It is always a good idea to split reading and general preprocessing from the actual analysis. You don't need to read everytime your input data from disk. The meta data available are way more precise (cause RM stores also more meta data about ExampleSets including for example the values of a nominal attribute). You have a better structure in your project and so on.

    希望这个解释这个问题

    Fabian

    *Meta data are all information which are available to RapidMiner without actually running the process. You can see this by hovering over the ports. Also this meta data is used in the parameters to provide for example list of attributes and similar options. As it is not always possible to know in advance all necessary meta data, only warnings are displayed if for example an attribute is missing in the meta data. The process can be run never the less (what you mean with brute force).

    sgenzer
  • amitdamitd Member, University ProfessorPosts:49Maven

    Thank you much for clarifying this for me. I have a related issue from this process, but it's on a new topic, so I'll post it separately.

Sign InorRegisterto comment.