public class DecisionTreeRegressionModel extends PredictionModel<Vector,DecisionTreeRegressionModel> implements DecisionTreeModel, DecisionTreeRegressorParams, MLWritable, scala.Serializable
| Modifier and Type | Method and Description |
|---|---|
DecisionTreeRegressionModel |
copy(ParamMap extra)
Creates a copy of this instance with the same UID and some extra params.
|
Vector |
featureImportances()
Estimate of the importance of each feature.
|
static DecisionTreeRegressionModel |
load(String path) |
int |
numFeatures()
Returns the number of features the model was trained on.
|
double |
predict(Vector features)
Predict label for the given features.
|
static MLReader<DecisionTreeRegressionModel> |
read() |
Node |
rootNode()
Root of the decision tree
|
DecisionTreeRegressionModel |
setVarianceCol(String value) |
String |
toString()
Summary of the model
|
Dataset<Row> |
transform(Dataset<?> dataset)
Transforms dataset by reading from
featuresCol, calling predict, and storing
the predictions as a new column predictionCol. |
String |
uid()
An immutable unique ID for the object and its derivatives.
|
MLWriter |
write()
Returns an
MLWriter instance for this ML instance. |
setFeaturesCol, setPredictionCol, transformSchematransform, transform, transformdepth, maxSplitFeatureIndex, numNodes, toDebugStringvalidateAndTransformSchemacacheNodeIds, getCacheNodeIds, getMaxBins, getMaxDepth, getMaxMemoryInMB, getMinInfoGain, getMinInstancesPerNode, getOldStrategy, maxBins, maxDepth, maxMemoryInMB, minInfoGain, minInstancesPerNode, setCacheNodeIds, setCheckpointInterval, setMaxBins, setMaxDepth, setMaxMemoryInMB, setMinInfoGain, setMinInstancesPerNode, setSeedgetLabelCol, labelColfeaturesCol, getFeaturesColgetPredictionCol, predictionColclear, copyValues, defaultCopy, defaultParamMap, explainParam, explainParams, extractParamMap, extractParamMap, get, getDefault, getOrDefault, getParam, hasDefault, hasParam, isDefined, isSet, paramMap, params, set, set, set, setDefault, setDefault, shouldOwncheckpointInterval, getCheckpointIntervalgetImpurity, getOldImpurity, impurity, setImpuritygetVarianceCol, varianceColsaveinitializeLogging, initializeLogIfNecessary, initializeLogIfNecessary, isTraceEnabled, log_, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarningpublic static MLReader<DecisionTreeRegressionModel> read()
public static DecisionTreeRegressionModel load(String path)
public String uid()
Identifiableuid in interface Identifiablepublic Node rootNode()
DecisionTreeModelrootNode in interface DecisionTreeModelpublic int numFeatures()
PredictionModelnumFeatures in class PredictionModel<Vector,DecisionTreeRegressionModel>public DecisionTreeRegressionModel setVarianceCol(String value)
public double predict(Vector features)
PredictionModeltransform() and output predictionCol.predict in class PredictionModel<Vector,DecisionTreeRegressionModel>features - (undocumented)public Dataset<Row> transform(Dataset<?> dataset)
PredictionModelfeaturesCol, calling predict, and storing
the predictions as a new column predictionCol.
transform in class PredictionModel<Vector,DecisionTreeRegressionModel>dataset - input datasetpredictionCol of type Doublepublic DecisionTreeRegressionModel copy(ParamMap extra)
ParamsdefaultCopy().copy in interface Paramscopy in class Model<DecisionTreeRegressionModel>extra - (undocumented)public String toString()
DecisionTreeModeltoString in interface DecisionTreeModeltoString in interface IdentifiabletoString in class Objectpublic Vector featureImportances()
This generalizes the idea of "Gini" importance to other losses, following the explanation of Gini importance from "Random Forests" documentation by Leo Breiman and Adele Cutler, and following the implementation from scikit-learn.
This feature importance is calculated as follows: - importance(feature j) = sum (over nodes which split on feature j) of the gain, where gain is scaled by the number of instances passing through node - Normalize importances for tree to sum to 1.
RandomForestRegressor
to determine feature importance instead.public MLWriter write()
MLWritableMLWriter instance for this ML instance.write in interface MLWritable