jsat.regression
Class MultipleLinearRegression
- java.lang.Object
-
- jsat.regression.MultipleLinearRegression
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, Regressor, SimpleWeightVectorModel, SingleWeightVectorModel
public class MultipleLinearRegression extends java.lang.Object implements Regressor, SingleWeightVectorModel
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description MultipleLinearRegression()MultipleLinearRegression(boolean useWeights)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description MultipleLinearRegressionclone()doublegetBias()Returns the bias term used for the model, or 0 of the model does not support or was not trained with a bias term.doublegetBias(int index)Returns the bias term used with the weight vector for the given class index.VecgetRawWeight()Returns the only weight vector used for the modelVecgetRawWeight(int index)Returns the raw weight vector associated with the given class index.intnumWeightsVecs()Returns the number of weight vectors that can be returned.doubleregress(DataPoint data)booleansupportsWeightedData()voidtrain(RegressionDataSet dataSet, boolean parallel)
-
-
-
Constructor Detail
-
MultipleLinearRegression
public MultipleLinearRegression()
-
MultipleLinearRegression
public MultipleLinearRegression(boolean useWeights)
-
-
Method Detail
-
train
public void train(RegressionDataSet dataSet, boolean parallel)
-
supportsWeightedData
public boolean supportsWeightedData()
- Specified by:
supportsWeightedDatain interfaceRegressor
-
getRawWeight
public Vec getRawWeight()
Description copied from interface:SingleWeightVectorModelReturns the only weight vector used for the model- Specified by:
getRawWeightin interfaceSingleWeightVectorModel- Returns:
- the only weight vector used for the model
-
getBias
public double getBias()
Description copied from interface:SingleWeightVectorModelReturns the bias term used for the model, or 0 of the model does not support or was not trained with a bias term.- Specified by:
getBiasin interfaceSingleWeightVectorModel- Returns:
- the bias term for the model
-
getRawWeight
public Vec getRawWeight(int index)
Description copied from interface:SimpleWeightVectorModelReturns the raw weight vector associated with the given class index. If the given class is an implicit zero vector, aConstantVectorobject may be returned.
Do not alter the returned weight vector, as it will change the model's values.
If a regression problem, onlyindex = 0should be used- Specified by:
getRawWeightin interfaceSimpleWeightVectorModel- Parameters:
index- the class index to get the weight vector for- Returns:
- the weight vector used for the specified class
-
getBias
public double getBias(int index)
Description copied from interface:SimpleWeightVectorModelReturns the bias term used with the weight vector for the given class index. If the model does not support or was not trained with bias weights,0will be returned.
If a regression problem, onlyindex = 0should be used- Specified by:
getBiasin interfaceSimpleWeightVectorModel- Parameters:
index- the class index to get the weight vector for- Returns:
- the bias term for the specified class
-
numWeightsVecs
public int numWeightsVecs()
Description copied from interface:SimpleWeightVectorModelReturns the number of weight vectors that can be returned. For binary classification problems the value may be 1 if only a single weight vector's sign is used to determine the class. For multi-class problems, the weight vector count includes the implicit zero vector (if one is being used).- Specified by:
numWeightsVecsin interfaceSimpleWeightVectorModel- Returns:
- the number of weight vectors for which
SimpleWeightVectorModel.getRawWeight(int)can be called.
-
clone
public MultipleLinearRegression clone()
-
-
DataMelt 3.0 © DataMelt by jWork.ORG