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
Output sorted weight table from LibSVM linear operator
hughesfleming68
Member Posts: 323 Unicorn
I am trying to export a file that has a sorted list of the kernel model. I can write an unsorted one with write as text but with no flexibilty. Ideally I would also like to extract the highest and lowest values.
I am assuming that this could be done by using execute script or is there another way to make the weight table more manageable?
regards,
Alex
Tagged:
0
Best Answer
-
land RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 2,531 Unicorn
Hi Alex,
I couldn't agree more with you that RapidMiner should add a generic "Object to Data" adapter. If the object has some tabular data inside that shouldn't be that problematic, I guess...I would vote for this feature
Greetings,
Sebastian
0
Answers
Hi,
you mean the weights right? In this case you can simply use Weights to Data and use standard ETL operators like Sort and Filter on it.
~Martin
Dortmund, Germany
Hi Martin,
Unfortunately I can't use the weights to data operator because the weight table and the Support Vector table are rendered from the apply model operator (mod). I have a select by weights operator in my process but the output there is just 1 or 0 depending if the attribute is selected. So far I have not found any operators that can sort data if the output port is "mod". I just seem to be able to write to a text file or copy and paste to Excel by hand.
Do you think this is something that could be done via Groovy Scripting? Looking throught the forums, this has come up before but without any solutions.
regards,
Alex
Hey,
i think there is no generic way to get a model to example set. The usual way to do it is similar to your idea but with RapidMiner. Use Write Model to write it to disc and Read Document/Read XML to read it in an parse it.
Best,
Martin
Dortmund, Germany
Thanks Martin,
I spent some time trying to do this but I am running into trouble separating the attribute name from the weight value. I am open to all ideas on how this might done!
Thanks and have a good weekend,
Alex
Well,
there's a less hacky solution:
The SVM Linear internally uses the JMySVM implementation, so it's the same as in the standard SVM operator. Instead of getting the things from the Model, you simply use the SVM operator with a linear kernel. Then take the Weight Table you get from the purple weight output port. It contains the coefficients and you can transform them to data with Weights to Data and sort them as you like...
Greetings,
Sebastian
Thank you Sebastian,
I see how this works now and I have switched from LibSVM to jMySVM and have been able to output the the sorted weights. It is unfortunate that the other SVM operators are missing the (wei) port which I think would be useful. Alternatively an operator that converts model output to exampleset (Model to Data) would also do the job.
Kind regards,
Alex
Please suggest this and other enhancements here
http://community.rapidminer.com/t5/Ideas-for-the-Community/idb-p/CommIdeas
We defintiely will love such feedback and community gets to determine whats important and vote for it