The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
"Logistic Regression cannot handle polynominal label."
arunpushkar
Member Posts: 8 Contributor II
i am using "read Database" operator to read training data from Mysql having 3 integer attributes and one varchar(4) attribute which will act as "lable" for classification and takes value 'yes' or 'no'. now when i use "logistic regression" for training model i get following error"Logistic Regression cannot handle polynomial label" but if i read csv data from csv file and set lable attribute to "nominal" it work's properly. but when i read data from database it gives error, first of all how to make any attribute read from database "nominal" so that it can be used by "Logical Regression". in fact i used "text to nominal" operator but it didn't work.
XML code for it as follows:
XML code for it as follows:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.2.008">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="5.2.008" expanded="true" name="Process">
<process expanded="true" height="531" width="832">
<operator activated="true" class="read_database" compatibility="5.2.008" expanded="true" height="60" name="Training" width="90" x="65" y="121">
<parameter key="define_connection" value="url"/>
<parameter key="connection" value="netcon"/>
<parameter key="database_url" value="jdbc:mysql://localhost:3306/netdata"/>
<parameter key="username" value="root"/>
<parameter key="password" value="UxP0KMCZjok="/>
<parameter key="query" value="SELECT * FROM `trainingData`"/>
<enumeration key="parameters"/>
</operator>
<operator activated="true" class="set_role" compatibility="5.2.008" expanded="true" height="76" name="Set Role" width="90" x="179" y="120">
<parameter key="name" value="attack"/>
<parameter key="target_role" value="label"/>
<list key="set_additional_roles"/>
</operator>
<operator activated="true" class="logistic_regression" compatibility="5.2.008" expanded="true" height="94" name="Logistic Regression" width="90" x="313" y="120"/>
<operator activated="true" class="read_database" compatibility="5.2.008" expanded="true" height="60" name="Scoring" width="90" x="313" y="345">
<parameter key="define_connection" value="url"/>
<parameter key="database_url" value="jdbc:mysql://localhost:3306/netdata"/>
<parameter key="username" value="root"/>
<parameter key="password" value="UxP0KMCZjok="/>
<parameter key="query" value="SELECT * FROM `scoringData`"/>
<enumeration key="parameters"/>
</operator>
<operator activated="true" class="apply_model" compatibility="5.2.008" expanded="true" height="76" name="Apply Model" width="90" x="514" y="165">
<list key="application_parameters"/>
</operator>
<connect from_op="Training" from_port="output" to_op="Set Role" to_port="example set input"/>
<connect from_op="Set Role" from_port="example set output" to_op="Logistic Regression" to_port="training set"/>
<connect from_op="Logistic Regression" from_port="model" to_op="Apply Model" to_port="model"/>
<connect from_op="Scoring" from_port="output" to_op="Apply Model" to_port="unlabelled data"/>
<connect from_op="Apply Model" from_port="model" to_port="result 1"/>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="sink_result 1" spacing="0"/>
<portSpacing port="sink_result 2" spacing="0"/>
</process>
</operator>
</process>
Tagged:
0
Answers
To solve your problem: Convert the type of your label to binominal explicitly. For this you can use the "Nominal to Binominal" operator.