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
User defined Similarity?
I´ve seen the revamped distance-similarity schema in RM 4.3.
Is there any way to use a user defined similarity?
The only I imagine is to extend DistanceMeasures
But I label this way unelegant (require change core code) and I can´t see a way a plugin can expand the list of selectable distances-similarities. Any idea? A suggestion for RM5.0?
Thanks for your attention and great work.
F.J. Cuberos
Is there any way to use a user defined similarity?
The only I imagine is to extend DistanceMeasures
And some logic to instantiate the class.
public static final String PARAMETER_USER_CLASS= "user_class";
...
public static final String[] MEASURE_TYPES = new String[] {
"MixedMeasures",
"NominalMeasures",
"NumericalMeasures",
"BregmanDivergences",
"UserDefinedDistance"
};
....
type = new ParameterTypeString(PARAMETER_USER_CLASS,"Class reference","put.your.class.here");
type.registerDependencyCondition(new EqualTypeCondition(operator, PARAMETER_MEASURE_TYPES, true, 4));
list.add(type);
...
But I label this way unelegant (require change core code) and I can´t see a way a plugin can expand the list of selectable distances-similarities. Any idea? A suggestion for RM5.0?
Thanks for your attention and great work.
F.J. Cuberos
Tagged:
0
Answers
there will be a method for registering new measures on the DistanceMeasures static class. Plugins will be able to do this during startup using a new init method, which is called if its present.
Greetings,
Sebastian
I´ll wait for the inclusion of this method in the CVS version.
Thanks again.
F.J. Cuberos
this feature is finally included in the new RapidMiner Version 4.4
You Plugin now might provide a class as follows: The method initPlugin is called during startup so that your plugin might do something for initilizing itself or register a distance measure as done here.
Greetings,
Sebastian
Yesterday I was debugging the new 4.4 version and found the class-method solution.
Thank you very much for your reply.
F.J. Cuberos
I´ve implemented a "distance": is a kernel function defined for discretized sets and the definition is based in the ranges for every nominal value obtained in the discretization processs.
Previosly, defined as an operator I could access to the IOContainer and read the discretization model in the apply() method.
Now, defined as a SimilarityMeasure, ¿How can I get any object from the input of the current operator? The current operator uses the distanceMeasure and makes its instantiation.
¿Any idea? ???
Thanks again for all you support to the RM users community.
Francisco J. Cuberos
oh, that's more difficult now, sorry for that. Actually, it's only possible by introducing a small "hack" into your distance measure:
During the creation process of the distance measure, the methods will be invoked. The first one constructs the measure by reflection and the second one invokes the init method with the example set only. But you can still make use of the second argument, the parameterHandler, since it is actually the invoking operator. So if you implement you init method like in the following, you should have access to the other IOObjects: Currently, it should be ensured that only operator invoke this method. I will ask Sebastian and we could change the method to "Operator" instead of "ParameterHandler".
Cheers,
Ingo
I found then calling code but get confused with the ParameterHandler.
I´ll try your code but it´s clear this is the solution to my problem.
Thanks again Ingo.
F.J. Cuberos
P.D. Some time agoI ask if I could post some documents about RM in spanish in the wiki. The wiki has been redesigned already, but there is no "internalization zone". Are you interested in this work?
thanks for your kind words
About the Wiki: actually, coming up with an improved Wiki is pretty on the top of our agenda but will probably needs time until May / June - whether the Wiki will be internationalized or not (same applies for this forum) is actually not yet decided.
Cheers,
Ingo
I'll try it using reflexion.
Thanks again.
F.J. Cuberos
I will talk to Sebastian and see if we could change the way of distance measure creation in a way those things would become simpler.
Thanks for pointing this out. Cheers,
Ingo