How can I classify one example into multiple classes if necessary?
Prentice
New Altair Community Member
Hello,
I have yet another problem/something I don't know. I've looked on similar cases but couldn't find an answer for my case.
How can I make test data with multiple labels?
How can I classify one example into multiple classes if necessary?
How can I make test data with multiple labels?
Say I have an example:
I like bananas and oranges as well.
The labels for this sentence are "banana" and "orange".
Would the input be another attribute with label 2, so that I have an attribute label 1, label 2 and maybe even label 3? Or the example twice but then with a different label, all under the same label attribute?
I like bananas and oranges as well. -> banana
I like bananas and oranges as well. -> orange
How can I classify one example into multiple classes if necessary?
I know that Polynomial to Binomial Classification is a thing, but I don't understand what it does after reading the help or the tutorial process.
The problem is also that not every example necessarily has two labels, a lot have one, some have two and a few could have three.
I thought of something like this, but I don't know if it would work or if it's effective.
For a case with an example that has two classes:
I like bananas and oranges as well. The probability would probably be something like Banana:0.435, Orange: 0.422, Pear:0.093, Apple:0.05.
And then for Probability<0.5 (or between 0.4 and 0.7, something like that) the two highest are the two designated classes. If higher probability higher than 0.5 (or 0.6 or something) it's one class.
The same would be for a case with three classes, but then the probability needs to be around 0.33.
Or am I thinking too difficult now? I don't know, and that's why I need your help.
Thanks in advance
-Prentice
I have yet another problem/something I don't know. I've looked on similar cases but couldn't find an answer for my case.
How can I make test data with multiple labels?
How can I classify one example into multiple classes if necessary?
How can I make test data with multiple labels?
Say I have an example:
I like bananas and oranges as well.
The labels for this sentence are "banana" and "orange".
Would the input be another attribute with label 2, so that I have an attribute label 1, label 2 and maybe even label 3? Or the example twice but then with a different label, all under the same label attribute?
I like bananas and oranges as well. -> banana
I like bananas and oranges as well. -> orange
How can I classify one example into multiple classes if necessary?
I know that Polynomial to Binomial Classification is a thing, but I don't understand what it does after reading the help or the tutorial process.
The problem is also that not every example necessarily has two labels, a lot have one, some have two and a few could have three.
I thought of something like this, but I don't know if it would work or if it's effective.
For a case with an example that has two classes:
I like bananas and oranges as well. The probability would probably be something like Banana:0.435, Orange: 0.422, Pear:0.093, Apple:0.05.
And then for Probability<0.5 (or between 0.4 and 0.7, something like that) the two highest are the two designated classes. If higher probability higher than 0.5 (or 0.6 or something) it's one class.
The same would be for a case with three classes, but then the probability needs to be around 0.33.
Or am I thinking too difficult now? I don't know, and that's why I need your help.
Thanks in advance
-Prentice
Tagged:
0
Best Answer
-
Hi,There is an operator which can create a desired number of predictions based on the confidence values of a model. It is called "Generate Prediction Ranking". Below is the XML of a little example process.Hope this helps,
Ingo<?xml version="1.0" encoding="UTF-8"?><process version="9.2.001"><br> <context><br> <input/><br> <output/><br> <macros/><br> </context><br> <operator activated="true" class="process" compatibility="9.2.001" expanded="true" name="Process"><br> <parameter key="logverbosity" value="init"/><br> <parameter key="random_seed" value="2001"/><br> <parameter key="send_mail" value="never"/><br> <parameter key="notification_email" value=""/><br> <parameter key="process_duration_for_mail" value="30"/><br> <parameter key="encoding" value="UTF-8"/><br> <process expanded="true"><br> <operator activated="true" class="retrieve" compatibility="9.2.001" expanded="true" height="68" name="Retrieve Iris" width="90" x="45" y="85"><br> <parameter key="repository_entry" value="//Samples/data/Iris"/><br> </operator><br> <operator activated="true" class="split_data" compatibility="9.2.001" expanded="true" height="103" name="Split Data" width="90" x="179" y="85"><br> <enumeration key="partitions"><br> <parameter key="ratio" value="0.66"/><br> <parameter key="ratio" value="0.34"/><br> </enumeration><br> <parameter key="sampling_type" value="automatic"/><br> <parameter key="use_local_random_seed" value="false"/><br> <parameter key="local_random_seed" value="1992"/><br> </operator><br> <operator activated="true" class="naive_bayes" compatibility="9.2.001" expanded="true" height="82" name="Naive Bayes" width="90" x="313" y="34"><br> <parameter key="laplace_correction" value="true"/><br> </operator><br> <operator activated="true" class="apply_model" compatibility="9.2.001" expanded="true" height="82" name="Apply Model" width="90" x="447" y="136"><br> <list key="application_parameters"/><br> <parameter key="create_view" value="false"/><br> </operator><br> <operator activated="true" class="generate_prediction_ranking" compatibility="9.2.001" expanded="true" height="82" name="Generate Prediction Ranking" width="90" x="581" y="136"><br> <parameter key="number_of_ranks" value="2"/><br> <parameter key="remove_old_predictions" value="true"/><br> </operator><br> <connect from_op="Retrieve Iris" from_port="output" to_op="Split Data" to_port="example set"/><br> <connect from_op="Split Data" from_port="partition 1" to_op="Naive Bayes" to_port="training set"/><br> <connect from_op="Split Data" from_port="partition 2" to_op="Apply Model" to_port="unlabelled data"/><br> <connect from_op="Naive Bayes" from_port="model" to_op="Apply Model" to_port="model"/><br> <connect from_op="Apply Model" from_port="labelled data" to_op="Generate Prediction Ranking" to_port="example set input"/><br> <connect from_op="Generate Prediction Ranking" from_port="example set output" to_port="result 1"/><br> <portSpacing port="source_input 1" spacing="0"/><br> <portSpacing port="sink_result 1" spacing="0"/><br> <portSpacing port="sink_result 2" spacing="0"/><br> </process><br> </operator><br></process>
1
Answers
-
Maybe you want to use Generate Prediction Ranking?Best,Martin1
-
Hi,There is an operator which can create a desired number of predictions based on the confidence values of a model. It is called "Generate Prediction Ranking". Below is the XML of a little example process.Hope this helps,
Ingo<?xml version="1.0" encoding="UTF-8"?><process version="9.2.001"><br> <context><br> <input/><br> <output/><br> <macros/><br> </context><br> <operator activated="true" class="process" compatibility="9.2.001" expanded="true" name="Process"><br> <parameter key="logverbosity" value="init"/><br> <parameter key="random_seed" value="2001"/><br> <parameter key="send_mail" value="never"/><br> <parameter key="notification_email" value=""/><br> <parameter key="process_duration_for_mail" value="30"/><br> <parameter key="encoding" value="UTF-8"/><br> <process expanded="true"><br> <operator activated="true" class="retrieve" compatibility="9.2.001" expanded="true" height="68" name="Retrieve Iris" width="90" x="45" y="85"><br> <parameter key="repository_entry" value="//Samples/data/Iris"/><br> </operator><br> <operator activated="true" class="split_data" compatibility="9.2.001" expanded="true" height="103" name="Split Data" width="90" x="179" y="85"><br> <enumeration key="partitions"><br> <parameter key="ratio" value="0.66"/><br> <parameter key="ratio" value="0.34"/><br> </enumeration><br> <parameter key="sampling_type" value="automatic"/><br> <parameter key="use_local_random_seed" value="false"/><br> <parameter key="local_random_seed" value="1992"/><br> </operator><br> <operator activated="true" class="naive_bayes" compatibility="9.2.001" expanded="true" height="82" name="Naive Bayes" width="90" x="313" y="34"><br> <parameter key="laplace_correction" value="true"/><br> </operator><br> <operator activated="true" class="apply_model" compatibility="9.2.001" expanded="true" height="82" name="Apply Model" width="90" x="447" y="136"><br> <list key="application_parameters"/><br> <parameter key="create_view" value="false"/><br> </operator><br> <operator activated="true" class="generate_prediction_ranking" compatibility="9.2.001" expanded="true" height="82" name="Generate Prediction Ranking" width="90" x="581" y="136"><br> <parameter key="number_of_ranks" value="2"/><br> <parameter key="remove_old_predictions" value="true"/><br> </operator><br> <connect from_op="Retrieve Iris" from_port="output" to_op="Split Data" to_port="example set"/><br> <connect from_op="Split Data" from_port="partition 1" to_op="Naive Bayes" to_port="training set"/><br> <connect from_op="Split Data" from_port="partition 2" to_op="Apply Model" to_port="unlabelled data"/><br> <connect from_op="Naive Bayes" from_port="model" to_op="Apply Model" to_port="model"/><br> <connect from_op="Apply Model" from_port="labelled data" to_op="Generate Prediction Ranking" to_port="example set input"/><br> <connect from_op="Generate Prediction Ranking" from_port="example set output" to_port="result 1"/><br> <portSpacing port="source_input 1" spacing="0"/><br> <portSpacing port="sink_result 1" spacing="0"/><br> <portSpacing port="sink_result 2" spacing="0"/><br> </process><br> </operator><br></process>
1 -
Thanks, I'll try to make something out of this.
0