Due to recent updates, all users are required to create an Altair One account to login to the RapidMiner community. Click the Register button to create your account using the same email that you have previously used to login to the RapidMiner community. This will ensure that any previously created content will be synced to your Altair One account. Once you login, you will be asked to provide a username that identifies you to other Community users. Email us at Community with questions.
setParameter Problems
Hi, I´m creating a sample operator with balanced data, but when I want to set the parameter PARAMETER_SAMPLE_RATIO_LIST i don´t know how to do it.I want to take all the example that has the label=good and half of label=bad so the values would be: good-> 1.0 and bad -> 0.5.How should I set this parameter.
My code is:
My code is:
public ExampleSet randomSampling(ExampleSet ES,String ProcessPath){
try{
Operator op= OperatorService.createOperator(SamplingOperator.class);
op.setParameter(SamplingOperator.PARAMETER_SAMPLE, "relative");
op.setParameter(SamplingOperator.PARAMETER_BALANCE_DATA, "true");
op.setParameter(SamplingOperator.PARAMETER_SAMPLE_RATIO_LIST, "good, 1.0");
op.getInputPorts().getPortByIndex(0).receive(ES);
op.doWork();
ExampleSet result=null;
if(op.getOutputPorts().getPortByIndex(0).getAnyDataOrNull() instanceof ExampleSet)
result=(ExampleSet) op.getOutputPorts().getPortByIndex(0).getAnyDataOrNull();
return result;
}catch(OperatorCreationException | OperatorException e){
System.out.println(e);
return null;
}
}
Tagged:
0
Answers
you can use a List<String> as the parameter vaue.
Regards,
Marco
I didn´t realice about that, i was able to make it work with your help.