Multiple Label dataset classification
Hi Everyone,
I am working on this text mining use case where my dataset has simply 4 columns, An ID, a Comments field (text), a Failure (Yes/No) and a Failure Type (Polynomial). The failure type is there only when a failure exists otherwise it is empty.
I know how to use the text mining process to classify a failure yes or no but how can I then classify the type of failure based on the text once the record is classified as a failure? Do I have to do this in two seperate processes or can I do both labels classification in the same process?
Please let me know if you have any questions.
Thanks
Best Answer
-
nickshel81 MemberPosts:7Contributor II
Thanks for the recommendation. I was actually able to solve this in a different way. One challenge I faced was actually testing the model once i figured out training the two labels. I hope this is helpful for others. I'm actually surprised there isn't a more straight forward way to deal with multi label datasets in rapidminer. maybe a future feature
<运营商激活= " true " class = "文本:标记“compatibility="7.3.000" expanded="true" height="68" name="Tokenize" width="90" x="246" y="34"/>
< portSpacing端口=“source_training "间隔= " 0"/>
<运营商激活= " true " class = "文本:标记“compatibility="7.3.000" expanded="true" height="68" name="Tokenize (2)" width="90" x="246" y="34"/>
<连接from_op = "读取Excel“from_port =“输出”to_op="Duplicate Comments" to_port="example set input"/>0
Answers
Yes, the operator you are looking for is Loop Labels, this will change the target label of your dataset by iterating across them. So label1, label2, etc.
The output in this case would be two models stored as a collection. One to classify Failure/Non-failure, the other to classify the type of failure.
I will warn you in advance that you might want to consider how you automate the model building process within the Loop Labels operator as, because it will apply the same operators to the data you might need to optimize to select the best algorithm for the problem.
With that in mind here is a toy example attached of the LoopLabels operator in action on the Titanic dataset. For algorithm selection it uses the model selection building block from@mschmitzwhich you can download from the building blocks section of the forum.
Hi@JEdward,
Thanks for the reply It was very helpful especially with the example. However I have one question that i am hoping you can help with.
How do i limit the second run of the loop label operator to only do the failure type classification on the "Yes's" predicted failure and not the "No's"? In other words the loop label will apply the text mining process in the first round to predict the Yes/No (whether there is a failure or not and it will then use the same text comments to predict the type of failure on both Yes's and No's which is not accurate. I want it to do the second label classification (failure type) only on the ones predicted with a Yes failure occurred.
Hope this makes sense.
thanks again for your help.
To accomplish that you can simply add a "filter examples" operator and set the condition to where your first label value is equal to "yes."
Lindon Ventures
Data Science Consulting from Certified RapidMiner Experts
Hi@Telcontar120,
Thanks for your reply. Wouldn't that also apply on the first label run? meaning it will also apply on when the model is classifying the Yes/No failures! Is there a way to apply the filter on the 2nd label loop?
Thanks
Yes, there is, although it will make your process a bit more complicated :-)
您将需要创建一个外循环,然后使用the "select subprocess" or "branch" operator, and have two subprocesses. In the first subprocess you will do the first modeling with you "yes" and "no" observations both, and then write that model prediction into the dataset. In the second subprocess you'll do the filtering as described. The selection will be based on which iteration of the outer loop you are on--the first one will use all the data and any subsequent ones will use only the "yes" observations. The loop iteration number is stored as a macro and can be used to trigger the "select subprocess" opreator. I think that should work!
Lindon Ventures
Data Science Consulting from Certified RapidMiner Experts