Class DataFrameRegression.VectorDataFrameRegression
java.lang.Object
smile.regression.DataFrameRegression.VectorDataFrameRegression
- All Implemented Interfaces:
Serializable, ToDoubleFunction<Tuple>, SHAP<Tuple>, DataFrameRegression, Regression<Tuple>
- Enclosing interface:
DataFrameRegression
public static final class DataFrameRegression.VectorDataFrameRegression
extends Object
implements DataFrameRegression, SHAP<Tuple>, Serializable
Adapter wrapping a vector
Regression<double[]> as a DataFrameRegression with SHAP<Tuple> support.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface DataFrameRegression
DataFrameRegression.EnsembleDataFrameRegression, DataFrameRegression.Trainer<M>, DataFrameRegression.VectorDataFrameRegression -
Method Summary
Modifier and TypeMethodDescriptionformula()Returns the model formula.booleanonline()Returns true if this is an online learner.doublePredicts the dependent variable of an instance.schema()Returns the schema of predictors.double[]Returns the SHAP values.double[]shap(Tuple x, KernelSHAP.Options options) Returns the SHAP values with customKernelSHAP.Options(ignored by exact explainers such asTreeSHAPand linear SHAP).voidOnline update the classifier with a new training instance.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface DataFrameRegression
predictMethods inherited from interface Regression
applyAsDouble, predict, predict, predict, update, update
-
Method Details
-
formula
Description copied from interface:DataFrameRegressionReturns the model formula.- Specified by:
formulain interfaceDataFrameRegression- Returns:
- the model formula.
-
schema
Description copied from interface:DataFrameRegressionReturns the schema of predictors.- Specified by:
schemain interfaceDataFrameRegression- Returns:
- the schema of predictors.
-
predict
Description copied from interface:RegressionPredicts the dependent variable of an instance.- Specified by:
predictin interfaceRegression<Tuple>- Parameters:
x- an instance.- Returns:
- the predicted value of dependent variable.
-
online
public boolean online()Description copied from interface:RegressionReturns true if this is an online learner.- Specified by:
onlinein interfaceRegression<Tuple>- Returns:
- true if online learner.
-
update
Description copied from interface:RegressionOnline update the classifier with a new training instance. In general, this method may be NOT multi-thread safe.- Specified by:
updatein interfaceRegression<Tuple>- Parameters:
x- the training instance.y- the response variable.
-
shap
Description copied from interface:SHAPReturns the SHAP values. For regression, the length of SHAP values is same as the number of features. For classification, SHAP values are ofp x k, wherepis the number of features andkis the classes. The first k elements are the SHAP values of first feature over k classes, respectively. The rest features follow accordingly. -
shap
Description copied from interface:SHAPReturns the SHAP values with customKernelSHAP.Options(ignored by exact explainers such asTreeSHAPand linear SHAP).
-