A program to recognize and reward our most engaged community members
ExampleSet apply(ExampleSet testSet) throws OperatorException
But it is part of my diploma thesis (where I evaluate the use of prediction methods for tuning an database system) using regression methods to predict values.
If I am not wrong, I implicitly use the same idea like your explained window operator. In the meantime, I found another way to set my input parameters by using the database where all my values are saved.
But now, I have another problem: How can I access the predicted value to use it in my java program???
but you have to perform more work manually in creating the data sets.
// Model generationOperator input = OperatorService.createOperator( DatabaseExampleSource.class );/* ... */ process.getRootOperator().addOperator( input );Operator putput = OperatorService.createOperator( LinearRegression.class );process.getRootOperator().addOperator( putput );Operator output = OperatorService.createOperator( ModelWriter.class );/* ... */process.getRootOperator().addOperator( output );process.run();// Applying data on modelOperator input = OperatorService.createOperator( ModelLoader.class );/* ... */process.getRootOperator().addOperator( input );Operator input2 = OperatorService.createOperator( DatabaseExampleSource.class );/* ... */process.getRootOperator().addOperator( input2 );Operator applier = OperatorService.createOperator( ModelApplier.class );process.getRootOperator().addOperator( applier );ExampleSet resultSet = process.run();
Example reader = resultSet.getExample(0);Attributes att = reader.getAttributes();String value = reader.getValueAsString( att.getPredictedLabel() );result = Math.round( Float.parseFloat( value ) * 1000.0 )/1000.0;
I omitted the settings of the parameters because I think there aren't so relevant. In the meantime I found a way to get the predicted value, but I am sure there are better possibilities to get it:
It would be great if you could show me a better way to the predicted value...
double result = reader.getValue(att.getPredictedLabel());