Latu.ML.Classification.LogisticRegressionTrainingSummary (latu_ml v0.2.0)

Copy Markdown View Source

Attributes of a LogisticRegressionTrainingSummary — what an estimator recorded while it fitted. Latu.ML.summary/1 is what hands you one.

Every accessor here is one name on the server's allowlist for org.apache.spark.ml.classification.LogisticRegressionTrainingSummary — 20 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.

Every allowlisted attribute of this class has a function here.

The allowlist is inherited rather than per class: this one is the union of org.apache.spark.ml.classification.ClassificationSummary, org.apache.spark.ml.classification.LogisticRegressionSummary, org.apache.spark.ml.classification.TrainingSummary.

Summary

Functions

Returns accuracy. (equals to the total number of correctly classified instances out of the total number of instances.)

The JVM class these accessors belong to.

Returns f-measure for each label (category).

Returns false positive rate for each label (category).

Field in "predictions" which gives the features of each instance as a vector.

Field in "predictions" which gives the true label of each instance.

Returns the sequence of labels in ascending order. This order matches the order used in metrics which are specified as arrays over labels, e.g., truePositiveRateByLabel.

Objective function (scaled loss + regularization) at each iteration. It contains one more element, the initial state, than number of iterations.

Returns precision for each label (category).

Field in "predictions" which gives the prediction of each class.

Dataframe outputted by the model's transform method.

Field in "predictions" which gives the probability of each class as a vector.

Returns recall for each label (category).

Number of training iterations until termination.

Returns true positive rate for each label (category).

Field in "predictions" which gives the weight of each instance as a vector.

Returns weighted averaged f-measure.

Returns weighted false positive rate.

Returns weighted averaged precision.

Returns weighted averaged recall. (equals to precision, recall and f-measure)

Returns weighted true positive rate. (equals to precision, recall and f-measure)

Functions

accuracy(holder)

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

Returns accuracy. (equals to the total number of correctly classified instances out of the total number of instances.)

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.

class()

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

The JVM class these accessors belong to.

f_measure_by_label(holder, beta)

@spec f_measure_by_label(Latu.ML.Summary.t(), number()) ::
  {:ok, term()} | {:error, Latu.Error.t()}

Returns f-measure for each label (category).

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

  • beta — a number, sent as a double

false_positive_rate_by_label(holder)

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

Returns false positive rate for each label (category).

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.

features_col(holder)

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

Field in "predictions" which gives the features of each instance as a 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.

label_col(holder)

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

Field in "predictions" which gives the true label of each instance.

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.

labels(holder)

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

Returns the sequence of labels in ascending order. This order matches the order used in metrics which are specified as arrays over labels, e.g., truePositiveRateByLabel.

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.

objective_history(holder)

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

Objective function (scaled loss + regularization) at each iteration. It contains one more element, the initial state, than number of iterations.

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.

precision_by_label(holder)

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

Returns precision for each label (category).

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.

prediction_col(holder)

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

Field in "predictions" which gives the prediction of each class.

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.

predictions(holder)

@spec predictions(Latu.ML.Summary.t()) :: Latu.DataFrame.t()

Dataframe outputted by the model's transform method.

A lazy builder: the Fetch rides a relation, so this hands back a Latu.DataFrame and nothing has run until you collect it.

probability_col(holder)

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

Field in "predictions" which gives the probability of each class as a 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.

recall_by_label(holder)

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

Returns recall for each label (category).

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.

total_iterations(holder)

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

Number of training iterations until termination.

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.

true_positive_rate_by_label(holder)

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

Returns true positive rate for each label (category).

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.

weight_col(holder)

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

Field in "predictions" which gives the weight of each instance as a 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.

weighted_f_measure(holder, beta)

@spec weighted_f_measure(Latu.ML.Summary.t(), number()) ::
  {:ok, term()} | {:error, Latu.Error.t()}

Returns weighted averaged f-measure.

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

  • beta — a number, sent as a double

weighted_false_positive_rate(holder)

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

Returns weighted false positive rate.

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.

weighted_precision(holder)

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

Returns weighted averaged precision.

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.

weighted_recall(holder)

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

Returns weighted averaged recall. (equals to precision, recall and f-measure)

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.

weighted_true_positive_rate(holder)

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

Returns weighted true positive rate. (equals to precision, recall and f-measure)

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.