Package smile.regression
Class RegressionTrainer<T>
- java.lang.Object
-
- smile.regression.RegressionTrainer<T>
-
- Type Parameters:
T
- the type of input object.
- Direct Known Subclasses:
GaussianProcessRegression.Trainer
,NeuralNetwork.Trainer
,RandomForest.Trainer
,RegressionTree.Trainer
public abstract class RegressionTrainer<T> extends java.lang.Object
Abstract regression model trainer.- Author:
- Haifeng Li
-
-
Constructor Summary
Constructors Constructor Description RegressionTrainer()
Constructor.RegressionTrainer(Attribute[] attributes)
Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
setAttributes(Attribute[] attributes)
Sets feature attributes.abstract Regression<T>
train(T[] x, double[] y)
Learns a regression model with given training data.
-
-
-
Constructor Detail
-
RegressionTrainer
public RegressionTrainer()
Constructor.
-
RegressionTrainer
public RegressionTrainer(Attribute[] attributes)
Constructor.- Parameters:
attributes
- the attributes of independent variable.
-
-
Method Detail
-
setAttributes
public void setAttributes(Attribute[] attributes)
Sets feature attributes. This is optional since most regression models can only work on real-valued attributes.- Parameters:
attributes
- the feature attributes.
-
train
public abstract Regression<T> train(T[] x, double[] y)
Learns a regression model with given training data.- Parameters:
x
- the training instances.y
- the training response values.- Returns:
- a trained regression model.
-
-