org.opentox.algorithm.trainer
Class MlrTrainer
java.lang.Object
org.opentox.error.ErrorSource
org.opentox.algorithm.trainer.AbstractTrainer
org.opentox.algorithm.trainer.MlrTrainer
- All Implemented Interfaces:
- IProne2Error, ITrainer
public class MlrTrainer
- extends AbstractTrainer
Trainer for MLR models.
- Version:
- 1.3.3 (Last update: Dec 20, 2009)
- Author:
- OpenTox - http://www.opentox.org/, Sopasakis Pantelis, Sarimveis Harry
Field Summary |
protected weka.core.Instances |
data
|
Constructor Summary |
MlrTrainer(org.restlet.data.Form form,
org.restlet.resource.ServerResource resource)
|
Method Summary |
ErrorRepresentation |
checkParameters()
Check wether the dataset and target values are valid URIs. |
private void |
generatePMML(double[] coefficients,
int model_id)
Generates the PMML representation of the model and stores in the hard
disk. |
org.restlet.representation.Representation |
train()
Returns an ErrorRepresentation if something goes wrong or a StringRepresentation
with the URI of the created model, if the model is successfully created. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
data
protected weka.core.Instances data
MlrTrainer
public MlrTrainer(org.restlet.data.Form form,
org.restlet.resource.ServerResource resource)
train
public org.restlet.representation.Representation train()
- Returns an ErrorRepresentation if something goes wrong or a StringRepresentation
with the URI of the created model, if the model is successfully created.
- Returns:
- representation of the training result.
checkParameters
public ErrorRepresentation checkParameters()
- Check wether the dataset and target values are valid URIs.
- Returns:
- Returns an empty ErrorRepresentation if no error is found (the posted parameters are
acceptable), otherwise a representation of the error. The internal status
is defined accordingly.
generatePMML
private void generatePMML(double[] coefficients,
int model_id)
- Generates the PMML representation of the model and stores in the hard
disk.
- Parameters:
coefficients
- The vector of the coefficients of the MLR model.model_id
- The id of the generated model.