jsat.datatransform
Class DataModelPipeline
- java.lang.Object
-
- jsat.datatransform.DataModelPipeline
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, Classifier, Parameterized, Regressor
public class DataModelPipeline extends java.lang.Object implements Classifier, Regressor, Parameterized
A Data Model Pipeline combines several data transforms and a base Classifier or Regressor into a unified object for performing classification and Regression with. This is useful for certain transforms for which their behavior is more tightly coupled with the model being used. In addition this allows a way for easily turning the parameters for a transform along with those of the predictor.
When using the Data Model Pipeline, the transforms that are apart of the pipeline should not be added to the model evaluators - as this will cause the transforms to be applied multiple times.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description DataModelPipeline(Classifier baseClassifier, DataTransform... transforms)Creates a new Data Model Pipeline from the given transform factories and base classifierDataModelPipeline(Classifier baseClassifier, DataTransformProcess dtp)Creates a new Data Model Pipeline from the given transform process and base classifierDataModelPipeline(DataModelPipeline toCopy)Copy constructorDataModelPipeline(Regressor baseRegressor, DataTransform... transforms)Creates a new Data Model Pipeline from the given transform factories and base classifierDataModelPipeline(Regressor baseRegressor, DataTransformProcess dtp)Creates a new Data Model Pipeline from the given transform process and base regressor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description CategoricalResultsclassify(DataPoint data)Performs classification on the given data point.DataModelPipelineclone()ParametergetParameter(java.lang.String paramName)Returns the parameter with the given name.java.util.List<Parameter>getParameters()Returns the list of parameters that can be altered for this learner.doubleregress(DataPoint data)booleansupportsWeightedData()Indicates whether the model knows how to train using weighted data points.voidtrain(ClassificationDataSet dataSet, boolean parallel)Trains the classifier and constructs a model for classification using the given data set.voidtrain(RegressionDataSet dataSet, boolean parallel)-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jsat.classifiers.Classifier
train
-
-
-
-
Constructor Detail
-
DataModelPipeline
public DataModelPipeline(Classifier baseClassifier, DataTransformProcess dtp)
Creates a new Data Model Pipeline from the given transform process and base classifier- Parameters:
dtp- the data transforms to applybaseClassifier- the classifier to learn with
-
DataModelPipeline
public DataModelPipeline(Classifier baseClassifier, DataTransform... transforms)
Creates a new Data Model Pipeline from the given transform factories and base classifier- Parameters:
transforms- the data transforms to applybaseClassifier- the classifier to learn with
-
DataModelPipeline
public DataModelPipeline(Regressor baseRegressor, DataTransformProcess dtp)
Creates a new Data Model Pipeline from the given transform process and base regressor- Parameters:
dtp- the data transforms to applybaseRegressor- the regressor to learn with
-
DataModelPipeline
public DataModelPipeline(Regressor baseRegressor, DataTransform... transforms)
Creates a new Data Model Pipeline from the given transform factories and base classifier- Parameters:
transforms- the data transforms to applybaseRegressor- the regressor to learn with
-
DataModelPipeline
public DataModelPipeline(DataModelPipeline toCopy)
Copy constructor- Parameters:
toCopy- the object to copy
-
-
Method Detail
-
classify
public CategoricalResults classify(DataPoint data)
Description copied from interface:ClassifierPerforms classification on the given data point.- Specified by:
classifyin interfaceClassifier- Parameters:
data- the data point to classify- Returns:
- the results of the classification.
-
train
public void train(ClassificationDataSet dataSet, boolean parallel)
Description copied from interface:ClassifierTrains the classifier and constructs a model for classification using the given data set. If the training method knows how, it will used the threadPool to conduct training in parallel. This method will block until the training has completed.- Specified by:
trainin interfaceClassifier- Parameters:
dataSet- the data set to train onparallel-trueif multiple threads should be used to train the model.falseif it should be done in a single threaded manner.
-
supportsWeightedData
public boolean supportsWeightedData()
Description copied from interface:ClassifierIndicates whether the model knows how to train using weighted data points. If it does, the model will train assuming the weights. The values returned by this method may change depending on the parameters set for the model.- Specified by:
supportsWeightedDatain interfaceClassifier- Specified by:
supportsWeightedDatain interfaceRegressor- Returns:
- true if the model supports weighted data, false otherwise
-
train
public void train(RegressionDataSet dataSet, boolean parallel)
-
clone
public DataModelPipeline clone()
- Specified by:
clonein interfaceClassifier- Specified by:
clonein interfaceRegressor- Overrides:
clonein classjava.lang.Object
-
getParameters
public java.util.List<Parameter> getParameters()
Description copied from interface:ParameterizedReturns the list of parameters that can be altered for this learner.- Specified by:
getParametersin interfaceParameterized- Returns:
- the list of parameters that can be altered for this learner.
-
getParameter
public Parameter getParameter(java.lang.String paramName)
Description copied from interface:ParameterizedReturns the parameter with the given name. Two different strings may map to a single Parameter object. An ASCII only string, and a Unicode style string.- Specified by:
getParameterin interfaceParameterized- Parameters:
paramName- the name of the parameter to obtain- Returns:
- the Parameter in question, or null if no such named Parameter exists.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG