Latu.ML.Regression.DecisionTreeRegressionModel (latu_ml v0.2.0)

Copy Markdown View Source

Attributes of a fitted DecisionTreeRegressionModel.

Every accessor here is one name on the server's allowlist for org.apache.spark.ml.regression.DecisionTreeRegressionModel — 7 of them — so tab completion is that allowlist. The server refuses anything else with CONNECT_ML.ATTRIBUTE_NOT_ALLOWED; these refuse a model of the wrong class before it gets that far, and name the module that would have taken it.

Allowed by the server but not here: toString is Identifiable's, and tells you less than the model's own uid. Latu.ML.attribute/2 and Latu.ML.attribute/3 will send any of these names; it is what comes back that has nowhere to go.

The allowlist is inherited rather than per class: this one is the union of org.apache.spark.ml.PredictionModel, org.apache.spark.ml.regression.DecisionTreeRegressionModel, org.apache.spark.ml.tree.DecisionTreeModel, org.apache.spark.ml.util.Identifiable.

Summary

Functions

The JVM class these accessors belong to.

Return depth of the decision tree.

Estimate of the importance of each feature.

Returns the number of features the model was trained on. If unknown, returns -1.

Return number of nodes of the decision tree.

Predict label for the given features.

Predict the indices of the leaves corresponding to the feature vector.

Full description of model.

Functions

class()

@spec class() :: String.t()

The JVM class these accessors belong to.

depth(holder)

@spec depth(Latu.ML.Model.t()) :: {:ok, term()} | {:error, Latu.Error.t()}

Return depth of the decision tree.

An action: it reaches the server. A Vector or Matrix comes back as an Nx.Tensor, or a Latu.ML.SparseVector where densifying would be this package's decision rather than yours.

feature_importances(holder)

@spec feature_importances(Latu.ML.Model.t()) ::
  {:ok, term()} | {:error, Latu.Error.t()}

Estimate of the importance of each feature.

An action: it reaches the server. A Vector or Matrix comes back as an Nx.Tensor, or a Latu.ML.SparseVector where densifying would be this package's decision rather than yours.

num_features(holder)

@spec num_features(Latu.ML.Model.t()) :: {:ok, term()} | {:error, Latu.Error.t()}

Returns the number of features the model was trained on. If unknown, returns -1.

An action: it reaches the server. A Vector or Matrix comes back as an Nx.Tensor, or a Latu.ML.SparseVector where densifying would be this package's decision rather than yours.

num_nodes(holder)

@spec num_nodes(Latu.ML.Model.t()) :: {:ok, term()} | {:error, Latu.Error.t()}

Return number of nodes of the decision tree.

An action: it reaches the server. A Vector or Matrix comes back as an Nx.Tensor, or a Latu.ML.SparseVector where densifying would be this package's decision rather than yours.

predict(holder, value)

@spec predict(Latu.ML.Model.t(), Nx.Tensor.t() | Latu.ML.SparseVector.t()) ::
  {:ok, term()} | {:error, Latu.Error.t()}

Predict label for the given features.

An action: it reaches the server. A Vector or Matrix comes back as an Nx.Tensor, or a Latu.ML.SparseVector where densifying would be this package's decision rather than yours.

Arguments

predict_leaf(holder, value)

@spec predict_leaf(Latu.ML.Model.t(), Nx.Tensor.t() | Latu.ML.SparseVector.t()) ::
  {:ok, term()} | {:error, Latu.Error.t()}

Predict the indices of the leaves corresponding to the feature vector.

An action: it reaches the server. A Vector or Matrix comes back as an Nx.Tensor, or a Latu.ML.SparseVector where densifying would be this package's decision rather than yours.

Arguments

to_debug_string(holder)

@spec to_debug_string(Latu.ML.Model.t()) :: {:ok, term()} | {:error, Latu.Error.t()}

Full description of model.

An action: it reaches the server. A Vector or Matrix comes back as an Nx.Tensor, or a Latu.ML.SparseVector where densifying would be this package's decision rather than yours.