standard_metrics

Module Contents

Classes Summary

AccuracyBinary

Accuracy score for binary classification.

AccuracyMulticlass

Accuracy score for multiclass classification.

AUC

AUC score for binary classification.

AUCMacro

AUC score for multiclass classification using macro averaging.

AUCMicro

AUC score for multiclass classification using micro averaging.

AUCWeighted

AUC Score for multiclass classification using weighted averaging.

BalancedAccuracyBinary

Balanced accuracy score for binary classification.

BalancedAccuracyMulticlass

Balanced accuracy score for multiclass classification.

ExpVariance

Explained variance score for regression.

F1

F1 score for binary classification.

F1Macro

F1 score for multiclass classification using macro averaging.

F1Micro

F1 score for multiclass classification using micro averaging.

F1Weighted

F1 score for multiclass classification using weighted averaging.

Gini

Gini coefficient for binary classification.

LogLossBinary

Log Loss for binary classification.

LogLossMulticlass

Log Loss for multiclass classification.

MAE

Mean absolute error for regression.

MAPE

Mean absolute percentage error for time series regression. Scaled by 100 to return a percentage.

MaxError

Maximum residual error for regression.

MCCBinary

Matthews correlation coefficient for binary classification.

MCCMulticlass

Matthews correlation coefficient for multiclass classification.

MeanSquaredLogError

Mean squared log error for regression.

MedianAE

Median absolute error for regression.

MSE

Mean squared error for regression.

Precision

Precision score for binary classification.

PrecisionMacro

Precision score for multiclass classification using macro averaging.

PrecisionMicro

Precision score for multiclass classification using micro averaging.

PrecisionWeighted

Precision score for multiclass classification using weighted averaging.

R2

Coefficient of determination for regression.

Recall

Recall score for binary classification.

RecallMacro

Recall score for multiclass classification using macro averaging.

RecallMicro

Recall score for multiclass classification using micro averaging.

RecallWeighted

Recall score for multiclass classification using weighted averaging.

RootMeanSquaredError

Root mean squared error for regression.

RootMeanSquaredLogError

Root mean squared log error for regression.

Contents

class evalml.objectives.standard_metrics.AccuracyBinary[source]

Accuracy score for binary classification.

Attributes

expected_range

[0, 1]

greater_is_better

True

is_bounded_like_percentage

True

name

Accuracy Binary

perfect_score

1.0

problem_types

[ProblemTypes.BINARY, ProblemTypes.TIME_SERIES_BINARY]

score_needs_proba

False

Methods

calculate_percent_difference

Calculate the percent difference between scores.

can_optimize_threshold

Returns a boolean determining if we can optimize the binary classification objective threshold.

decision_function

Apply a learned threshold to predicted probabilities to get predicted classes.

is_defined_for_problem_type

objective_function

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

optimize_threshold

Learn a binary classification threshold which optimizes the current objective.

positive_only

If True, this objective is only valid for positive data. Default False.

score

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

validate_inputs

Validates the input based on a few simple checks.

classmethod calculate_percent_difference(cls, score, baseline_score)

Calculate the percent difference between scores.

Parameters
  • score (float) – A score. Output of the score method of this objective.

  • baseline_score (float) – A score. Output of the score method of this objective. In practice, this is the score achieved on this objective with a baseline estimator.

Returns

The percent difference between the scores. Note that for objectives that can be interpreted

as percentages, this will be the difference between the reference score and score. For all other objectives, the difference will be normalized by the reference score.

Return type

float

property can_optimize_threshold(cls)

Returns a boolean determining if we can optimize the binary classification objective threshold. This will be false for any objective that works directly with predicted probabilities, like log loss and AUC. Otherwise, it will be true.

decision_function(self, ypred_proba, threshold=0.5, X=None)

Apply a learned threshold to predicted probabilities to get predicted classes.

Parameters
  • ypred_proba (pd.Series, np.ndarray) – The classifier’s predicted probabilities

  • threshold (float, optional) – Threshold used to make a prediction. Defaults to 0.5.

  • X (pd.DataFrame, optional) – Any extra columns that are needed from training data.

Returns

predictions

classmethod is_defined_for_problem_type(cls, problem_type)
objective_function(self, y_true, y_predicted, X=None, sample_weight=None)[source]

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

Arguments:

y_predicted (pd.Series): Predicted values of length [n_samples] y_true (pd.Series): Actual class labels of length [n_samples] X (pd.DataFrame or np.ndarray): Extra data of shape [n_samples, n_features] necessary to calculate score sample_weight (pd.DataFrame or np.ndarray): Sample weights used in computing objective value result

Returns

Numerical value used to calculate score

optimize_threshold(self, ypred_proba, y_true, X=None)

Learn a binary classification threshold which optimizes the current objective.

Parameters
  • ypred_proba (pd.Series) – The classifier’s predicted probabilities

  • y_true (pd.Series) – The ground truth for the predictions.

  • X (pd.DataFrame, optional) – Any extra columns that are needed from training data.

Returns

Optimal threshold for this objective

positive_only(cls)

If True, this objective is only valid for positive data. Default False.

score(self, y_true, y_predicted, X=None, sample_weight=None)

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

Parameters
  • y_predicted (pd.Series) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

  • X (pd.DataFrame or np.ndarray) – Extra data of shape [n_samples, n_features] necessary to calculate score

  • sample_weight (pd.DataFrame or np.ndarray) – Sample weights used in computing objective value result

Returns

score

validate_inputs(self, y_true, y_predicted)

Validates the input based on a few simple checks.

Parameters
  • y_predicted (pd.Series, or pd.DataFrame) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

Returns

None

class evalml.objectives.standard_metrics.AccuracyMulticlass[source]

Accuracy score for multiclass classification.

Attributes

expected_range

[0, 1]

greater_is_better

True

is_bounded_like_percentage

True

name

Accuracy Multiclass

perfect_score

1.0

problem_types

[ProblemTypes.MULTICLASS, ProblemTypes.TIME_SERIES_MULTICLASS]

score_needs_proba

False

Methods

calculate_percent_difference

Calculate the percent difference between scores.

is_defined_for_problem_type

objective_function

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

positive_only

If True, this objective is only valid for positive data. Default False.

score

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

validate_inputs

Validates the input based on a few simple checks.

classmethod calculate_percent_difference(cls, score, baseline_score)

Calculate the percent difference between scores.

Parameters
  • score (float) – A score. Output of the score method of this objective.

  • baseline_score (float) – A score. Output of the score method of this objective. In practice, this is the score achieved on this objective with a baseline estimator.

Returns

The percent difference between the scores. Note that for objectives that can be interpreted

as percentages, this will be the difference between the reference score and score. For all other objectives, the difference will be normalized by the reference score.

Return type

float

classmethod is_defined_for_problem_type(cls, problem_type)
objective_function(self, y_true, y_predicted, X=None, sample_weight=None)[source]

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

Arguments:

y_predicted (pd.Series): Predicted values of length [n_samples] y_true (pd.Series): Actual class labels of length [n_samples] X (pd.DataFrame or np.ndarray): Extra data of shape [n_samples, n_features] necessary to calculate score sample_weight (pd.DataFrame or np.ndarray): Sample weights used in computing objective value result

Returns

Numerical value used to calculate score

positive_only(cls)

If True, this objective is only valid for positive data. Default False.

score(self, y_true, y_predicted, X=None, sample_weight=None)

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

Parameters
  • y_predicted (pd.Series) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

  • X (pd.DataFrame or np.ndarray) – Extra data of shape [n_samples, n_features] necessary to calculate score

  • sample_weight (pd.DataFrame or np.ndarray) – Sample weights used in computing objective value result

Returns

score

validate_inputs(self, y_true, y_predicted)

Validates the input based on a few simple checks.

Parameters
  • y_predicted (pd.Series, or pd.DataFrame) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

Returns

None

class evalml.objectives.standard_metrics.AUC[source]

AUC score for binary classification.

Attributes

expected_range

[0, 1]

greater_is_better

True

is_bounded_like_percentage

True

name

AUC

perfect_score

1.0

problem_types

[ProblemTypes.BINARY, ProblemTypes.TIME_SERIES_BINARY]

score_needs_proba

True

Methods

calculate_percent_difference

Calculate the percent difference between scores.

can_optimize_threshold

Returns a boolean determining if we can optimize the binary classification objective threshold.

decision_function

Apply a learned threshold to predicted probabilities to get predicted classes.

is_defined_for_problem_type

objective_function

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

optimize_threshold

Learn a binary classification threshold which optimizes the current objective.

positive_only

If True, this objective is only valid for positive data. Default False.

score

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

validate_inputs

Validates the input based on a few simple checks.

classmethod calculate_percent_difference(cls, score, baseline_score)

Calculate the percent difference between scores.

Parameters
  • score (float) – A score. Output of the score method of this objective.

  • baseline_score (float) – A score. Output of the score method of this objective. In practice, this is the score achieved on this objective with a baseline estimator.

Returns

The percent difference between the scores. Note that for objectives that can be interpreted

as percentages, this will be the difference between the reference score and score. For all other objectives, the difference will be normalized by the reference score.

Return type

float

property can_optimize_threshold(cls)

Returns a boolean determining if we can optimize the binary classification objective threshold. This will be false for any objective that works directly with predicted probabilities, like log loss and AUC. Otherwise, it will be true.

decision_function(self, ypred_proba, threshold=0.5, X=None)

Apply a learned threshold to predicted probabilities to get predicted classes.

Parameters
  • ypred_proba (pd.Series, np.ndarray) – The classifier’s predicted probabilities

  • threshold (float, optional) – Threshold used to make a prediction. Defaults to 0.5.

  • X (pd.DataFrame, optional) – Any extra columns that are needed from training data.

Returns

predictions

classmethod is_defined_for_problem_type(cls, problem_type)
objective_function(self, y_true, y_predicted, X=None, sample_weight=None)[source]

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

Arguments:

y_predicted (pd.Series): Predicted values of length [n_samples] y_true (pd.Series): Actual class labels of length [n_samples] X (pd.DataFrame or np.ndarray): Extra data of shape [n_samples, n_features] necessary to calculate score sample_weight (pd.DataFrame or np.ndarray): Sample weights used in computing objective value result

Returns

Numerical value used to calculate score

optimize_threshold(self, ypred_proba, y_true, X=None)

Learn a binary classification threshold which optimizes the current objective.

Parameters
  • ypred_proba (pd.Series) – The classifier’s predicted probabilities

  • y_true (pd.Series) – The ground truth for the predictions.

  • X (pd.DataFrame, optional) – Any extra columns that are needed from training data.

Returns

Optimal threshold for this objective

positive_only(cls)

If True, this objective is only valid for positive data. Default False.

score(self, y_true, y_predicted, X=None, sample_weight=None)

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

Parameters
  • y_predicted (pd.Series) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

  • X (pd.DataFrame or np.ndarray) – Extra data of shape [n_samples, n_features] necessary to calculate score

  • sample_weight (pd.DataFrame or np.ndarray) – Sample weights used in computing objective value result

Returns

score

validate_inputs(self, y_true, y_predicted)

Validates the input based on a few simple checks.

Parameters
  • y_predicted (pd.Series, or pd.DataFrame) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

Returns

None

class evalml.objectives.standard_metrics.AUCMacro[source]

AUC score for multiclass classification using macro averaging.

Attributes

expected_range

[0, 1]

greater_is_better

True

is_bounded_like_percentage

True

name

AUC Macro

perfect_score

1.0

problem_types

[ProblemTypes.MULTICLASS, ProblemTypes.TIME_SERIES_MULTICLASS]

score_needs_proba

True

Methods

calculate_percent_difference

Calculate the percent difference between scores.

is_defined_for_problem_type

objective_function

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

positive_only

If True, this objective is only valid for positive data. Default False.

score

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

validate_inputs

Validates the input based on a few simple checks.

classmethod calculate_percent_difference(cls, score, baseline_score)

Calculate the percent difference between scores.

Parameters
  • score (float) – A score. Output of the score method of this objective.

  • baseline_score (float) – A score. Output of the score method of this objective. In practice, this is the score achieved on this objective with a baseline estimator.

Returns

The percent difference between the scores. Note that for objectives that can be interpreted

as percentages, this will be the difference between the reference score and score. For all other objectives, the difference will be normalized by the reference score.

Return type

float

classmethod is_defined_for_problem_type(cls, problem_type)
objective_function(self, y_true, y_predicted, X=None, sample_weight=None)[source]

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

Arguments:

y_predicted (pd.Series): Predicted values of length [n_samples] y_true (pd.Series): Actual class labels of length [n_samples] X (pd.DataFrame or np.ndarray): Extra data of shape [n_samples, n_features] necessary to calculate score sample_weight (pd.DataFrame or np.ndarray): Sample weights used in computing objective value result

Returns

Numerical value used to calculate score

positive_only(cls)

If True, this objective is only valid for positive data. Default False.

score(self, y_true, y_predicted, X=None, sample_weight=None)

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

Parameters
  • y_predicted (pd.Series) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

  • X (pd.DataFrame or np.ndarray) – Extra data of shape [n_samples, n_features] necessary to calculate score

  • sample_weight (pd.DataFrame or np.ndarray) – Sample weights used in computing objective value result

Returns

score

validate_inputs(self, y_true, y_predicted)

Validates the input based on a few simple checks.

Parameters
  • y_predicted (pd.Series, or pd.DataFrame) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

Returns

None

class evalml.objectives.standard_metrics.AUCMicro[source]

AUC score for multiclass classification using micro averaging.

Attributes

expected_range

[0, 1]

greater_is_better

True

is_bounded_like_percentage

True

name

AUC Micro

perfect_score

1.0

problem_types

[ProblemTypes.MULTICLASS, ProblemTypes.TIME_SERIES_MULTICLASS]

score_needs_proba

True

Methods

calculate_percent_difference

Calculate the percent difference between scores.

is_defined_for_problem_type

objective_function

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

positive_only

If True, this objective is only valid for positive data. Default False.

score

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

validate_inputs

Validates the input based on a few simple checks.

classmethod calculate_percent_difference(cls, score, baseline_score)

Calculate the percent difference between scores.

Parameters
  • score (float) – A score. Output of the score method of this objective.

  • baseline_score (float) – A score. Output of the score method of this objective. In practice, this is the score achieved on this objective with a baseline estimator.

Returns

The percent difference between the scores. Note that for objectives that can be interpreted

as percentages, this will be the difference between the reference score and score. For all other objectives, the difference will be normalized by the reference score.

Return type

float

classmethod is_defined_for_problem_type(cls, problem_type)
objective_function(self, y_true, y_predicted, X=None, sample_weight=None)[source]

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

Arguments:

y_predicted (pd.Series): Predicted values of length [n_samples] y_true (pd.Series): Actual class labels of length [n_samples] X (pd.DataFrame or np.ndarray): Extra data of shape [n_samples, n_features] necessary to calculate score sample_weight (pd.DataFrame or np.ndarray): Sample weights used in computing objective value result

Returns

Numerical value used to calculate score

positive_only(cls)

If True, this objective is only valid for positive data. Default False.

score(self, y_true, y_predicted, X=None, sample_weight=None)

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

Parameters
  • y_predicted (pd.Series) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

  • X (pd.DataFrame or np.ndarray) – Extra data of shape [n_samples, n_features] necessary to calculate score

  • sample_weight (pd.DataFrame or np.ndarray) – Sample weights used in computing objective value result

Returns

score

validate_inputs(self, y_true, y_predicted)

Validates the input based on a few simple checks.

Parameters
  • y_predicted (pd.Series, or pd.DataFrame) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

Returns

None

class evalml.objectives.standard_metrics.AUCWeighted[source]

AUC Score for multiclass classification using weighted averaging.

Attributes

expected_range

[0, 1]

greater_is_better

True

is_bounded_like_percentage

True

name

AUC Weighted

perfect_score

1.0

problem_types

[ProblemTypes.MULTICLASS, ProblemTypes.TIME_SERIES_MULTICLASS]

score_needs_proba

True

Methods

calculate_percent_difference

Calculate the percent difference between scores.

is_defined_for_problem_type

objective_function

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

positive_only

If True, this objective is only valid for positive data. Default False.

score

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

validate_inputs

Validates the input based on a few simple checks.

classmethod calculate_percent_difference(cls, score, baseline_score)

Calculate the percent difference between scores.

Parameters
  • score (float) – A score. Output of the score method of this objective.

  • baseline_score (float) – A score. Output of the score method of this objective. In practice, this is the score achieved on this objective with a baseline estimator.

Returns

The percent difference between the scores. Note that for objectives that can be interpreted

as percentages, this will be the difference between the reference score and score. For all other objectives, the difference will be normalized by the reference score.

Return type

float

classmethod is_defined_for_problem_type(cls, problem_type)
objective_function(self, y_true, y_predicted, X=None, sample_weight=None)[source]

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

Arguments:

y_predicted (pd.Series): Predicted values of length [n_samples] y_true (pd.Series): Actual class labels of length [n_samples] X (pd.DataFrame or np.ndarray): Extra data of shape [n_samples, n_features] necessary to calculate score sample_weight (pd.DataFrame or np.ndarray): Sample weights used in computing objective value result

Returns

Numerical value used to calculate score

positive_only(cls)

If True, this objective is only valid for positive data. Default False.

score(self, y_true, y_predicted, X=None, sample_weight=None)

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

Parameters
  • y_predicted (pd.Series) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

  • X (pd.DataFrame or np.ndarray) – Extra data of shape [n_samples, n_features] necessary to calculate score

  • sample_weight (pd.DataFrame or np.ndarray) – Sample weights used in computing objective value result

Returns

score

validate_inputs(self, y_true, y_predicted)

Validates the input based on a few simple checks.

Parameters
  • y_predicted (pd.Series, or pd.DataFrame) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

Returns

None

class evalml.objectives.standard_metrics.BalancedAccuracyBinary[source]

Balanced accuracy score for binary classification.

Attributes

expected_range

[0, 1]

greater_is_better

True

is_bounded_like_percentage

True

name

Balanced Accuracy Binary

perfect_score

1.0

problem_types

[ProblemTypes.BINARY, ProblemTypes.TIME_SERIES_BINARY]

score_needs_proba

False

Methods

calculate_percent_difference

Calculate the percent difference between scores.

can_optimize_threshold

Returns a boolean determining if we can optimize the binary classification objective threshold.

decision_function

Apply a learned threshold to predicted probabilities to get predicted classes.

is_defined_for_problem_type

objective_function

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

optimize_threshold

Learn a binary classification threshold which optimizes the current objective.

positive_only

If True, this objective is only valid for positive data. Default False.

score

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

validate_inputs

Validates the input based on a few simple checks.

classmethod calculate_percent_difference(cls, score, baseline_score)

Calculate the percent difference between scores.

Parameters
  • score (float) – A score. Output of the score method of this objective.

  • baseline_score (float) – A score. Output of the score method of this objective. In practice, this is the score achieved on this objective with a baseline estimator.

Returns

The percent difference between the scores. Note that for objectives that can be interpreted

as percentages, this will be the difference between the reference score and score. For all other objectives, the difference will be normalized by the reference score.

Return type

float

property can_optimize_threshold(cls)

Returns a boolean determining if we can optimize the binary classification objective threshold. This will be false for any objective that works directly with predicted probabilities, like log loss and AUC. Otherwise, it will be true.

decision_function(self, ypred_proba, threshold=0.5, X=None)

Apply a learned threshold to predicted probabilities to get predicted classes.

Parameters
  • ypred_proba (pd.Series, np.ndarray) – The classifier’s predicted probabilities

  • threshold (float, optional) – Threshold used to make a prediction. Defaults to 0.5.

  • X (pd.DataFrame, optional) – Any extra columns that are needed from training data.

Returns

predictions

classmethod is_defined_for_problem_type(cls, problem_type)
objective_function(self, y_true, y_predicted, X=None, sample_weight=None)[source]

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

Arguments:

y_predicted (pd.Series): Predicted values of length [n_samples] y_true (pd.Series): Actual class labels of length [n_samples] X (pd.DataFrame or np.ndarray): Extra data of shape [n_samples, n_features] necessary to calculate score sample_weight (pd.DataFrame or np.ndarray): Sample weights used in computing objective value result

Returns

Numerical value used to calculate score

optimize_threshold(self, ypred_proba, y_true, X=None)

Learn a binary classification threshold which optimizes the current objective.

Parameters
  • ypred_proba (pd.Series) – The classifier’s predicted probabilities

  • y_true (pd.Series) – The ground truth for the predictions.

  • X (pd.DataFrame, optional) – Any extra columns that are needed from training data.

Returns

Optimal threshold for this objective

positive_only(cls)

If True, this objective is only valid for positive data. Default False.

score(self, y_true, y_predicted, X=None, sample_weight=None)

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

Parameters
  • y_predicted (pd.Series) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

  • X (pd.DataFrame or np.ndarray) – Extra data of shape [n_samples, n_features] necessary to calculate score

  • sample_weight (pd.DataFrame or np.ndarray) – Sample weights used in computing objective value result

Returns

score

validate_inputs(self, y_true, y_predicted)

Validates the input based on a few simple checks.

Parameters
  • y_predicted (pd.Series, or pd.DataFrame) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

Returns

None

class evalml.objectives.standard_metrics.BalancedAccuracyMulticlass[source]

Balanced accuracy score for multiclass classification.

Attributes

expected_range

[0, 1]

greater_is_better

True

is_bounded_like_percentage

True

name

Balanced Accuracy Multiclass

perfect_score

1.0

problem_types

[ProblemTypes.MULTICLASS, ProblemTypes.TIME_SERIES_MULTICLASS]

score_needs_proba

False

Methods

calculate_percent_difference

Calculate the percent difference between scores.

is_defined_for_problem_type

objective_function

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

positive_only

If True, this objective is only valid for positive data. Default False.

score

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

validate_inputs

Validates the input based on a few simple checks.

classmethod calculate_percent_difference(cls, score, baseline_score)

Calculate the percent difference between scores.

Parameters
  • score (float) – A score. Output of the score method of this objective.

  • baseline_score (float) – A score. Output of the score method of this objective. In practice, this is the score achieved on this objective with a baseline estimator.

Returns

The percent difference between the scores. Note that for objectives that can be interpreted

as percentages, this will be the difference between the reference score and score. For all other objectives, the difference will be normalized by the reference score.

Return type

float

classmethod is_defined_for_problem_type(cls, problem_type)
objective_function(self, y_true, y_predicted, X=None, sample_weight=None)[source]

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

Arguments:

y_predicted (pd.Series): Predicted values of length [n_samples] y_true (pd.Series): Actual class labels of length [n_samples] X (pd.DataFrame or np.ndarray): Extra data of shape [n_samples, n_features] necessary to calculate score sample_weight (pd.DataFrame or np.ndarray): Sample weights used in computing objective value result

Returns

Numerical value used to calculate score

positive_only(cls)

If True, this objective is only valid for positive data. Default False.

score(self, y_true, y_predicted, X=None, sample_weight=None)

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

Parameters
  • y_predicted (pd.Series) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

  • X (pd.DataFrame or np.ndarray) – Extra data of shape [n_samples, n_features] necessary to calculate score

  • sample_weight (pd.DataFrame or np.ndarray) – Sample weights used in computing objective value result

Returns

score

validate_inputs(self, y_true, y_predicted)

Validates the input based on a few simple checks.

Parameters
  • y_predicted (pd.Series, or pd.DataFrame) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

Returns

None

class evalml.objectives.standard_metrics.ExpVariance[source]

Explained variance score for regression.

Attributes

expected_range

None

greater_is_better

True

is_bounded_like_percentage

False

name

ExpVariance

perfect_score

1.0

problem_types

[ProblemTypes.REGRESSION, ProblemTypes.TIME_SERIES_REGRESSION]

score_needs_proba

False

Methods

calculate_percent_difference

Calculate the percent difference between scores.

is_defined_for_problem_type

objective_function

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

positive_only

If True, this objective is only valid for positive data. Default False.

score

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

validate_inputs

Validates the input based on a few simple checks.

classmethod calculate_percent_difference(cls, score, baseline_score)

Calculate the percent difference between scores.

Parameters
  • score (float) – A score. Output of the score method of this objective.

  • baseline_score (float) – A score. Output of the score method of this objective. In practice, this is the score achieved on this objective with a baseline estimator.

Returns

The percent difference between the scores. Note that for objectives that can be interpreted

as percentages, this will be the difference between the reference score and score. For all other objectives, the difference will be normalized by the reference score.

Return type

float

classmethod is_defined_for_problem_type(cls, problem_type)
objective_function(self, y_true, y_predicted, X=None, sample_weight=None)[source]

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

Arguments:

y_predicted (pd.Series): Predicted values of length [n_samples] y_true (pd.Series): Actual class labels of length [n_samples] X (pd.DataFrame or np.ndarray): Extra data of shape [n_samples, n_features] necessary to calculate score sample_weight (pd.DataFrame or np.ndarray): Sample weights used in computing objective value result

Returns

Numerical value used to calculate score

positive_only(cls)

If True, this objective is only valid for positive data. Default False.

score(self, y_true, y_predicted, X=None, sample_weight=None)

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

Parameters
  • y_predicted (pd.Series) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

  • X (pd.DataFrame or np.ndarray) – Extra data of shape [n_samples, n_features] necessary to calculate score

  • sample_weight (pd.DataFrame or np.ndarray) – Sample weights used in computing objective value result

Returns

score

validate_inputs(self, y_true, y_predicted)

Validates the input based on a few simple checks.

Parameters
  • y_predicted (pd.Series, or pd.DataFrame) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

Returns

None

class evalml.objectives.standard_metrics.F1[source]

F1 score for binary classification.

Attributes

expected_range

[0, 1]

greater_is_better

True

is_bounded_like_percentage

True

name

F1

perfect_score

1.0

problem_types

[ProblemTypes.BINARY, ProblemTypes.TIME_SERIES_BINARY]

score_needs_proba

False

Methods

calculate_percent_difference

Calculate the percent difference between scores.

can_optimize_threshold

Returns a boolean determining if we can optimize the binary classification objective threshold.

decision_function

Apply a learned threshold to predicted probabilities to get predicted classes.

is_defined_for_problem_type

objective_function

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

optimize_threshold

Learn a binary classification threshold which optimizes the current objective.

positive_only

If True, this objective is only valid for positive data. Default False.

score

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

validate_inputs

Validates the input based on a few simple checks.

classmethod calculate_percent_difference(cls, score, baseline_score)

Calculate the percent difference between scores.

Parameters
  • score (float) – A score. Output of the score method of this objective.

  • baseline_score (float) – A score. Output of the score method of this objective. In practice, this is the score achieved on this objective with a baseline estimator.

Returns

The percent difference between the scores. Note that for objectives that can be interpreted

as percentages, this will be the difference between the reference score and score. For all other objectives, the difference will be normalized by the reference score.

Return type

float

property can_optimize_threshold(cls)

Returns a boolean determining if we can optimize the binary classification objective threshold. This will be false for any objective that works directly with predicted probabilities, like log loss and AUC. Otherwise, it will be true.

decision_function(self, ypred_proba, threshold=0.5, X=None)

Apply a learned threshold to predicted probabilities to get predicted classes.

Parameters
  • ypred_proba (pd.Series, np.ndarray) – The classifier’s predicted probabilities

  • threshold (float, optional) – Threshold used to make a prediction. Defaults to 0.5.

  • X (pd.DataFrame, optional) – Any extra columns that are needed from training data.

Returns

predictions

classmethod is_defined_for_problem_type(cls, problem_type)
objective_function(self, y_true, y_predicted, X=None, sample_weight=None)[source]

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

Arguments:

y_predicted (pd.Series): Predicted values of length [n_samples] y_true (pd.Series): Actual class labels of length [n_samples] X (pd.DataFrame or np.ndarray): Extra data of shape [n_samples, n_features] necessary to calculate score sample_weight (pd.DataFrame or np.ndarray): Sample weights used in computing objective value result

Returns

Numerical value used to calculate score

optimize_threshold(self, ypred_proba, y_true, X=None)

Learn a binary classification threshold which optimizes the current objective.

Parameters
  • ypred_proba (pd.Series) – The classifier’s predicted probabilities

  • y_true (pd.Series) – The ground truth for the predictions.

  • X (pd.DataFrame, optional) – Any extra columns that are needed from training data.

Returns

Optimal threshold for this objective

positive_only(cls)

If True, this objective is only valid for positive data. Default False.

score(self, y_true, y_predicted, X=None, sample_weight=None)

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

Parameters
  • y_predicted (pd.Series) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

  • X (pd.DataFrame or np.ndarray) – Extra data of shape [n_samples, n_features] necessary to calculate score

  • sample_weight (pd.DataFrame or np.ndarray) – Sample weights used in computing objective value result

Returns

score

validate_inputs(self, y_true, y_predicted)

Validates the input based on a few simple checks.

Parameters
  • y_predicted (pd.Series, or pd.DataFrame) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

Returns

None

class evalml.objectives.standard_metrics.F1Macro[source]

F1 score for multiclass classification using macro averaging.

Attributes

expected_range

[0, 1]

greater_is_better

True

is_bounded_like_percentage

True

name

F1 Macro

perfect_score

1.0

problem_types

[ProblemTypes.MULTICLASS, ProblemTypes.TIME_SERIES_MULTICLASS]

score_needs_proba

False

Methods

calculate_percent_difference

Calculate the percent difference between scores.

is_defined_for_problem_type

objective_function

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

positive_only

If True, this objective is only valid for positive data. Default False.

score

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

validate_inputs

Validates the input based on a few simple checks.

classmethod calculate_percent_difference(cls, score, baseline_score)

Calculate the percent difference between scores.

Parameters
  • score (float) – A score. Output of the score method of this objective.

  • baseline_score (float) – A score. Output of the score method of this objective. In practice, this is the score achieved on this objective with a baseline estimator.

Returns

The percent difference between the scores. Note that for objectives that can be interpreted

as percentages, this will be the difference between the reference score and score. For all other objectives, the difference will be normalized by the reference score.

Return type

float

classmethod is_defined_for_problem_type(cls, problem_type)
objective_function(self, y_true, y_predicted, X=None, sample_weight=None)[source]

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

Arguments:

y_predicted (pd.Series): Predicted values of length [n_samples] y_true (pd.Series): Actual class labels of length [n_samples] X (pd.DataFrame or np.ndarray): Extra data of shape [n_samples, n_features] necessary to calculate score sample_weight (pd.DataFrame or np.ndarray): Sample weights used in computing objective value result

Returns

Numerical value used to calculate score

positive_only(cls)

If True, this objective is only valid for positive data. Default False.

score(self, y_true, y_predicted, X=None, sample_weight=None)

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

Parameters
  • y_predicted (pd.Series) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

  • X (pd.DataFrame or np.ndarray) – Extra data of shape [n_samples, n_features] necessary to calculate score

  • sample_weight (pd.DataFrame or np.ndarray) – Sample weights used in computing objective value result

Returns

score

validate_inputs(self, y_true, y_predicted)

Validates the input based on a few simple checks.

Parameters
  • y_predicted (pd.Series, or pd.DataFrame) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

Returns

None

class evalml.objectives.standard_metrics.F1Micro[source]

F1 score for multiclass classification using micro averaging.

Attributes

expected_range

[0, 1]

greater_is_better

True

is_bounded_like_percentage

True

name

F1 Micro

perfect_score

1.0

problem_types

[ProblemTypes.MULTICLASS, ProblemTypes.TIME_SERIES_MULTICLASS]

score_needs_proba

False

Methods

calculate_percent_difference

Calculate the percent difference between scores.

is_defined_for_problem_type

objective_function

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

positive_only

If True, this objective is only valid for positive data. Default False.

score

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

validate_inputs

Validates the input based on a few simple checks.

classmethod calculate_percent_difference(cls, score, baseline_score)

Calculate the percent difference between scores.

Parameters
  • score (float) – A score. Output of the score method of this objective.

  • baseline_score (float) – A score. Output of the score method of this objective. In practice, this is the score achieved on this objective with a baseline estimator.

Returns

The percent difference between the scores. Note that for objectives that can be interpreted

as percentages, this will be the difference between the reference score and score. For all other objectives, the difference will be normalized by the reference score.

Return type

float

classmethod is_defined_for_problem_type(cls, problem_type)
objective_function(self, y_true, y_predicted, X=None, sample_weight=None)[source]

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

Arguments:

y_predicted (pd.Series): Predicted values of length [n_samples] y_true (pd.Series): Actual class labels of length [n_samples] X (pd.DataFrame or np.ndarray): Extra data of shape [n_samples, n_features] necessary to calculate score sample_weight (pd.DataFrame or np.ndarray): Sample weights used in computing objective value result

Returns

Numerical value used to calculate score

positive_only(cls)

If True, this objective is only valid for positive data. Default False.

score(self, y_true, y_predicted, X=None, sample_weight=None)

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

Parameters
  • y_predicted (pd.Series) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

  • X (pd.DataFrame or np.ndarray) – Extra data of shape [n_samples, n_features] necessary to calculate score

  • sample_weight (pd.DataFrame or np.ndarray) – Sample weights used in computing objective value result

Returns

score

validate_inputs(self, y_true, y_predicted)

Validates the input based on a few simple checks.

Parameters
  • y_predicted (pd.Series, or pd.DataFrame) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

Returns

None

class evalml.objectives.standard_metrics.F1Weighted[source]

F1 score for multiclass classification using weighted averaging.

Attributes

expected_range

[0, 1]

greater_is_better

True

is_bounded_like_percentage

True

name

F1 Weighted

perfect_score

1.0

problem_types

[ProblemTypes.MULTICLASS, ProblemTypes.TIME_SERIES_MULTICLASS]

score_needs_proba

False

Methods

calculate_percent_difference

Calculate the percent difference between scores.

is_defined_for_problem_type

objective_function

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

positive_only

If True, this objective is only valid for positive data. Default False.

score

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

validate_inputs

Validates the input based on a few simple checks.

classmethod calculate_percent_difference(cls, score, baseline_score)

Calculate the percent difference between scores.

Parameters
  • score (float) – A score. Output of the score method of this objective.

  • baseline_score (float) – A score. Output of the score method of this objective. In practice, this is the score achieved on this objective with a baseline estimator.

Returns

The percent difference between the scores. Note that for objectives that can be interpreted

as percentages, this will be the difference between the reference score and score. For all other objectives, the difference will be normalized by the reference score.

Return type

float

classmethod is_defined_for_problem_type(cls, problem_type)
objective_function(self, y_true, y_predicted, X=None, sample_weight=None)[source]

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

Arguments:

y_predicted (pd.Series): Predicted values of length [n_samples] y_true (pd.Series): Actual class labels of length [n_samples] X (pd.DataFrame or np.ndarray): Extra data of shape [n_samples, n_features] necessary to calculate score sample_weight (pd.DataFrame or np.ndarray): Sample weights used in computing objective value result

Returns

Numerical value used to calculate score

positive_only(cls)

If True, this objective is only valid for positive data. Default False.

score(self, y_true, y_predicted, X=None, sample_weight=None)

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

Parameters
  • y_predicted (pd.Series) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

  • X (pd.DataFrame or np.ndarray) – Extra data of shape [n_samples, n_features] necessary to calculate score

  • sample_weight (pd.DataFrame or np.ndarray) – Sample weights used in computing objective value result

Returns

score

validate_inputs(self, y_true, y_predicted)

Validates the input based on a few simple checks.

Parameters
  • y_predicted (pd.Series, or pd.DataFrame) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

Returns

None

class evalml.objectives.standard_metrics.Gini[source]

Gini coefficient for binary classification.

Attributes

expected_range

None

greater_is_better

True

is_bounded_like_percentage

False

name

Gini

perfect_score

1.0

problem_types

[ProblemTypes.BINARY, ProblemTypes.TIME_SERIES_BINARY]

score_needs_proba

True

Methods

calculate_percent_difference

Calculate the percent difference between scores.

can_optimize_threshold

Returns a boolean determining if we can optimize the binary classification objective threshold.

decision_function

Apply a learned threshold to predicted probabilities to get predicted classes.

is_defined_for_problem_type

objective_function

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

optimize_threshold

Learn a binary classification threshold which optimizes the current objective.

positive_only

If True, this objective is only valid for positive data. Default False.

score

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

validate_inputs

Validates the input based on a few simple checks.

classmethod calculate_percent_difference(cls, score, baseline_score)

Calculate the percent difference between scores.

Parameters
  • score (float) – A score. Output of the score method of this objective.

  • baseline_score (float) – A score. Output of the score method of this objective. In practice, this is the score achieved on this objective with a baseline estimator.

Returns

The percent difference between the scores. Note that for objectives that can be interpreted

as percentages, this will be the difference between the reference score and score. For all other objectives, the difference will be normalized by the reference score.

Return type

float

property can_optimize_threshold(cls)

Returns a boolean determining if we can optimize the binary classification objective threshold. This will be false for any objective that works directly with predicted probabilities, like log loss and AUC. Otherwise, it will be true.

decision_function(self, ypred_proba, threshold=0.5, X=None)

Apply a learned threshold to predicted probabilities to get predicted classes.

Parameters
  • ypred_proba (pd.Series, np.ndarray) – The classifier’s predicted probabilities

  • threshold (float, optional) – Threshold used to make a prediction. Defaults to 0.5.

  • X (pd.DataFrame, optional) – Any extra columns that are needed from training data.

Returns

predictions

classmethod is_defined_for_problem_type(cls, problem_type)
objective_function(self, y_true, y_predicted, X=None, sample_weight=None)[source]

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

Arguments:

y_predicted (pd.Series): Predicted values of length [n_samples] y_true (pd.Series): Actual class labels of length [n_samples] X (pd.DataFrame or np.ndarray): Extra data of shape [n_samples, n_features] necessary to calculate score sample_weight (pd.DataFrame or np.ndarray): Sample weights used in computing objective value result

Returns

Numerical value used to calculate score

optimize_threshold(self, ypred_proba, y_true, X=None)

Learn a binary classification threshold which optimizes the current objective.

Parameters
  • ypred_proba (pd.Series) – The classifier’s predicted probabilities

  • y_true (pd.Series) – The ground truth for the predictions.

  • X (pd.DataFrame, optional) – Any extra columns that are needed from training data.

Returns

Optimal threshold for this objective

positive_only(cls)

If True, this objective is only valid for positive data. Default False.

score(self, y_true, y_predicted, X=None, sample_weight=None)

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

Parameters
  • y_predicted (pd.Series) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

  • X (pd.DataFrame or np.ndarray) – Extra data of shape [n_samples, n_features] necessary to calculate score

  • sample_weight (pd.DataFrame or np.ndarray) – Sample weights used in computing objective value result

Returns

score

validate_inputs(self, y_true, y_predicted)

Validates the input based on a few simple checks.

Parameters
  • y_predicted (pd.Series, or pd.DataFrame) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

Returns

None

class evalml.objectives.standard_metrics.LogLossBinary[source]

Log Loss for binary classification.

Attributes

expected_range

[0, 1]

greater_is_better

False

is_bounded_like_percentage

False

name

Log Loss Binary

perfect_score

0.0

problem_types

[ProblemTypes.BINARY, ProblemTypes.TIME_SERIES_BINARY]

score_needs_proba

True

Methods

calculate_percent_difference

Calculate the percent difference between scores.

can_optimize_threshold

Returns a boolean determining if we can optimize the binary classification objective threshold.

decision_function

Apply a learned threshold to predicted probabilities to get predicted classes.

is_defined_for_problem_type

objective_function

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

optimize_threshold

Learn a binary classification threshold which optimizes the current objective.

positive_only

If True, this objective is only valid for positive data. Default False.

score

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

validate_inputs

Validates the input based on a few simple checks.

classmethod calculate_percent_difference(cls, score, baseline_score)

Calculate the percent difference between scores.

Parameters
  • score (float) – A score. Output of the score method of this objective.

  • baseline_score (float) – A score. Output of the score method of this objective. In practice, this is the score achieved on this objective with a baseline estimator.

Returns

The percent difference between the scores. Note that for objectives that can be interpreted

as percentages, this will be the difference between the reference score and score. For all other objectives, the difference will be normalized by the reference score.

Return type

float

property can_optimize_threshold(cls)

Returns a boolean determining if we can optimize the binary classification objective threshold. This will be false for any objective that works directly with predicted probabilities, like log loss and AUC. Otherwise, it will be true.

decision_function(self, ypred_proba, threshold=0.5, X=None)

Apply a learned threshold to predicted probabilities to get predicted classes.

Parameters
  • ypred_proba (pd.Series, np.ndarray) – The classifier’s predicted probabilities

  • threshold (float, optional) – Threshold used to make a prediction. Defaults to 0.5.

  • X (pd.DataFrame, optional) – Any extra columns that are needed from training data.

Returns

predictions

classmethod is_defined_for_problem_type(cls, problem_type)
objective_function(self, y_true, y_predicted, X=None, sample_weight=None)[source]

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

Arguments:

y_predicted (pd.Series): Predicted values of length [n_samples] y_true (pd.Series): Actual class labels of length [n_samples] X (pd.DataFrame or np.ndarray): Extra data of shape [n_samples, n_features] necessary to calculate score sample_weight (pd.DataFrame or np.ndarray): Sample weights used in computing objective value result

Returns

Numerical value used to calculate score

optimize_threshold(self, ypred_proba, y_true, X=None)

Learn a binary classification threshold which optimizes the current objective.

Parameters
  • ypred_proba (pd.Series) – The classifier’s predicted probabilities

  • y_true (pd.Series) – The ground truth for the predictions.

  • X (pd.DataFrame, optional) – Any extra columns that are needed from training data.

Returns

Optimal threshold for this objective

positive_only(cls)

If True, this objective is only valid for positive data. Default False.

score(self, y_true, y_predicted, X=None, sample_weight=None)

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

Parameters
  • y_predicted (pd.Series) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

  • X (pd.DataFrame or np.ndarray) – Extra data of shape [n_samples, n_features] necessary to calculate score

  • sample_weight (pd.DataFrame or np.ndarray) – Sample weights used in computing objective value result

Returns

score

validate_inputs(self, y_true, y_predicted)

Validates the input based on a few simple checks.

Parameters
  • y_predicted (pd.Series, or pd.DataFrame) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

Returns

None

class evalml.objectives.standard_metrics.LogLossMulticlass[source]

Log Loss for multiclass classification.

Attributes

expected_range

[0, 1]

greater_is_better

False

is_bounded_like_percentage

False

name

Log Loss Multiclass

perfect_score

0.0

problem_types

[ProblemTypes.MULTICLASS, ProblemTypes.TIME_SERIES_MULTICLASS]

score_needs_proba

True

Methods

calculate_percent_difference

Calculate the percent difference between scores.

is_defined_for_problem_type

objective_function

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

positive_only

If True, this objective is only valid for positive data. Default False.

score

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

validate_inputs

Validates the input based on a few simple checks.

classmethod calculate_percent_difference(cls, score, baseline_score)

Calculate the percent difference between scores.

Parameters
  • score (float) – A score. Output of the score method of this objective.

  • baseline_score (float) – A score. Output of the score method of this objective. In practice, this is the score achieved on this objective with a baseline estimator.

Returns

The percent difference between the scores. Note that for objectives that can be interpreted

as percentages, this will be the difference between the reference score and score. For all other objectives, the difference will be normalized by the reference score.

Return type

float

classmethod is_defined_for_problem_type(cls, problem_type)
objective_function(self, y_true, y_predicted, X=None, sample_weight=None)[source]

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

Arguments:

y_predicted (pd.Series): Predicted values of length [n_samples] y_true (pd.Series): Actual class labels of length [n_samples] X (pd.DataFrame or np.ndarray): Extra data of shape [n_samples, n_features] necessary to calculate score sample_weight (pd.DataFrame or np.ndarray): Sample weights used in computing objective value result

Returns

Numerical value used to calculate score

positive_only(cls)

If True, this objective is only valid for positive data. Default False.

score(self, y_true, y_predicted, X=None, sample_weight=None)

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

Parameters
  • y_predicted (pd.Series) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

  • X (pd.DataFrame or np.ndarray) – Extra data of shape [n_samples, n_features] necessary to calculate score

  • sample_weight (pd.DataFrame or np.ndarray) – Sample weights used in computing objective value result

Returns

score

validate_inputs(self, y_true, y_predicted)

Validates the input based on a few simple checks.

Parameters
  • y_predicted (pd.Series, or pd.DataFrame) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

Returns

None

class evalml.objectives.standard_metrics.MAE[source]

Mean absolute error for regression.

Attributes

expected_range

None

greater_is_better

False

is_bounded_like_percentage

True

name

MAE

perfect_score

0.0

problem_types

[ProblemTypes.REGRESSION, ProblemTypes.TIME_SERIES_REGRESSION]

score_needs_proba

False

Methods

calculate_percent_difference

Calculate the percent difference between scores.

is_defined_for_problem_type

objective_function

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

positive_only

If True, this objective is only valid for positive data. Default False.

score

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

validate_inputs

Validates the input based on a few simple checks.

classmethod calculate_percent_difference(cls, score, baseline_score)

Calculate the percent difference between scores.

Parameters
  • score (float) – A score. Output of the score method of this objective.

  • baseline_score (float) – A score. Output of the score method of this objective. In practice, this is the score achieved on this objective with a baseline estimator.

Returns

The percent difference between the scores. Note that for objectives that can be interpreted

as percentages, this will be the difference between the reference score and score. For all other objectives, the difference will be normalized by the reference score.

Return type

float

classmethod is_defined_for_problem_type(cls, problem_type)
objective_function(self, y_true, y_predicted, X=None, sample_weight=None)[source]

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

Arguments:

y_predicted (pd.Series): Predicted values of length [n_samples] y_true (pd.Series): Actual class labels of length [n_samples] X (pd.DataFrame or np.ndarray): Extra data of shape [n_samples, n_features] necessary to calculate score sample_weight (pd.DataFrame or np.ndarray): Sample weights used in computing objective value result

Returns

Numerical value used to calculate score

positive_only(cls)

If True, this objective is only valid for positive data. Default False.

score(self, y_true, y_predicted, X=None, sample_weight=None)

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

Parameters
  • y_predicted (pd.Series) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

  • X (pd.DataFrame or np.ndarray) – Extra data of shape [n_samples, n_features] necessary to calculate score

  • sample_weight (pd.DataFrame or np.ndarray) – Sample weights used in computing objective value result

Returns

score

validate_inputs(self, y_true, y_predicted)

Validates the input based on a few simple checks.

Parameters
  • y_predicted (pd.Series, or pd.DataFrame) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

Returns

None

class evalml.objectives.standard_metrics.MAPE[source]

Mean absolute percentage error for time series regression. Scaled by 100 to return a percentage.

Only valid for nonzero inputs. Otherwise, will throw a ValueError

Attributes

expected_range

None

greater_is_better

False

is_bounded_like_percentage

False

name

Mean Absolute Percentage Error

perfect_score

0.0

problem_types

[ProblemTypes.TIME_SERIES_REGRESSION]

score_needs_proba

False

Methods

calculate_percent_difference

Calculate the percent difference between scores.

is_defined_for_problem_type

objective_function

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

positive_only

If True, this objective is only valid for positive data. Default False.

score

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

validate_inputs

Validates the input based on a few simple checks.

classmethod calculate_percent_difference(cls, score, baseline_score)

Calculate the percent difference between scores.

Parameters
  • score (float) – A score. Output of the score method of this objective.

  • baseline_score (float) – A score. Output of the score method of this objective. In practice, this is the score achieved on this objective with a baseline estimator.

Returns

The percent difference between the scores. Note that for objectives that can be interpreted

as percentages, this will be the difference between the reference score and score. For all other objectives, the difference will be normalized by the reference score.

Return type

float

classmethod is_defined_for_problem_type(cls, problem_type)
objective_function(self, y_true, y_predicted, X=None, sample_weight=None)[source]

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

Arguments:

y_predicted (pd.Series): Predicted values of length [n_samples] y_true (pd.Series): Actual class labels of length [n_samples] X (pd.DataFrame or np.ndarray): Extra data of shape [n_samples, n_features] necessary to calculate score sample_weight (pd.DataFrame or np.ndarray): Sample weights used in computing objective value result

Returns

Numerical value used to calculate score

positive_only(self)

If True, this objective is only valid for positive data. Default False.

score(self, y_true, y_predicted, X=None, sample_weight=None)

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

Parameters
  • y_predicted (pd.Series) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

  • X (pd.DataFrame or np.ndarray) – Extra data of shape [n_samples, n_features] necessary to calculate score

  • sample_weight (pd.DataFrame or np.ndarray) – Sample weights used in computing objective value result

Returns

score

validate_inputs(self, y_true, y_predicted)

Validates the input based on a few simple checks.

Parameters
  • y_predicted (pd.Series, or pd.DataFrame) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

Returns

None

class evalml.objectives.standard_metrics.MaxError[source]

Maximum residual error for regression.

Attributes

expected_range

None

greater_is_better

False

is_bounded_like_percentage

False

name

MaxError

perfect_score

0.0

problem_types

[ProblemTypes.REGRESSION, ProblemTypes.TIME_SERIES_REGRESSION]

score_needs_proba

False

Methods

calculate_percent_difference

Calculate the percent difference between scores.

is_defined_for_problem_type

objective_function

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

positive_only

If True, this objective is only valid for positive data. Default False.

score

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

validate_inputs

Validates the input based on a few simple checks.

classmethod calculate_percent_difference(cls, score, baseline_score)

Calculate the percent difference between scores.

Parameters
  • score (float) – A score. Output of the score method of this objective.

  • baseline_score (float) – A score. Output of the score method of this objective. In practice, this is the score achieved on this objective with a baseline estimator.

Returns

The percent difference between the scores. Note that for objectives that can be interpreted

as percentages, this will be the difference between the reference score and score. For all other objectives, the difference will be normalized by the reference score.

Return type

float

classmethod is_defined_for_problem_type(cls, problem_type)
objective_function(self, y_true, y_predicted, X=None, sample_weight=None)[source]

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

Arguments:

y_predicted (pd.Series): Predicted values of length [n_samples] y_true (pd.Series): Actual class labels of length [n_samples] X (pd.DataFrame or np.ndarray): Extra data of shape [n_samples, n_features] necessary to calculate score sample_weight (pd.DataFrame or np.ndarray): Sample weights used in computing objective value result

Returns

Numerical value used to calculate score

positive_only(cls)

If True, this objective is only valid for positive data. Default False.

score(self, y_true, y_predicted, X=None, sample_weight=None)

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

Parameters
  • y_predicted (pd.Series) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

  • X (pd.DataFrame or np.ndarray) – Extra data of shape [n_samples, n_features] necessary to calculate score

  • sample_weight (pd.DataFrame or np.ndarray) – Sample weights used in computing objective value result

Returns

score

validate_inputs(self, y_true, y_predicted)

Validates the input based on a few simple checks.

Parameters
  • y_predicted (pd.Series, or pd.DataFrame) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

Returns

None

class evalml.objectives.standard_metrics.MCCBinary[source]

Matthews correlation coefficient for binary classification.

Attributes

expected_range

None

greater_is_better

True

is_bounded_like_percentage

False

name

MCC Binary

perfect_score

1.0

problem_types

[ProblemTypes.BINARY, ProblemTypes.TIME_SERIES_BINARY]

score_needs_proba

False

Methods

calculate_percent_difference

Calculate the percent difference between scores.

can_optimize_threshold

Returns a boolean determining if we can optimize the binary classification objective threshold.

decision_function

Apply a learned threshold to predicted probabilities to get predicted classes.

is_defined_for_problem_type

objective_function

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

optimize_threshold

Learn a binary classification threshold which optimizes the current objective.

positive_only

If True, this objective is only valid for positive data. Default False.

score

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

validate_inputs

Validates the input based on a few simple checks.

classmethod calculate_percent_difference(cls, score, baseline_score)

Calculate the percent difference between scores.

Parameters
  • score (float) – A score. Output of the score method of this objective.

  • baseline_score (float) – A score. Output of the score method of this objective. In practice, this is the score achieved on this objective with a baseline estimator.

Returns

The percent difference between the scores. Note that for objectives that can be interpreted

as percentages, this will be the difference between the reference score and score. For all other objectives, the difference will be normalized by the reference score.

Return type

float

property can_optimize_threshold(cls)

Returns a boolean determining if we can optimize the binary classification objective threshold. This will be false for any objective that works directly with predicted probabilities, like log loss and AUC. Otherwise, it will be true.

decision_function(self, ypred_proba, threshold=0.5, X=None)

Apply a learned threshold to predicted probabilities to get predicted classes.

Parameters
  • ypred_proba (pd.Series, np.ndarray) – The classifier’s predicted probabilities

  • threshold (float, optional) – Threshold used to make a prediction. Defaults to 0.5.

  • X (pd.DataFrame, optional) – Any extra columns that are needed from training data.

Returns

predictions

classmethod is_defined_for_problem_type(cls, problem_type)
objective_function(self, y_true, y_predicted, X=None, sample_weight=None)[source]

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

Arguments:

y_predicted (pd.Series): Predicted values of length [n_samples] y_true (pd.Series): Actual class labels of length [n_samples] X (pd.DataFrame or np.ndarray): Extra data of shape [n_samples, n_features] necessary to calculate score sample_weight (pd.DataFrame or np.ndarray): Sample weights used in computing objective value result

Returns

Numerical value used to calculate score

optimize_threshold(self, ypred_proba, y_true, X=None)

Learn a binary classification threshold which optimizes the current objective.

Parameters
  • ypred_proba (pd.Series) – The classifier’s predicted probabilities

  • y_true (pd.Series) – The ground truth for the predictions.

  • X (pd.DataFrame, optional) – Any extra columns that are needed from training data.

Returns

Optimal threshold for this objective

positive_only(cls)

If True, this objective is only valid for positive data. Default False.

score(self, y_true, y_predicted, X=None, sample_weight=None)

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

Parameters
  • y_predicted (pd.Series) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

  • X (pd.DataFrame or np.ndarray) – Extra data of shape [n_samples, n_features] necessary to calculate score

  • sample_weight (pd.DataFrame or np.ndarray) – Sample weights used in computing objective value result

Returns

score

validate_inputs(self, y_true, y_predicted)

Validates the input based on a few simple checks.

Parameters
  • y_predicted (pd.Series, or pd.DataFrame) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

Returns

None

class evalml.objectives.standard_metrics.MCCMulticlass[source]

Matthews correlation coefficient for multiclass classification.

Attributes

expected_range

None

greater_is_better

True

is_bounded_like_percentage

False

name

MCC Multiclass

perfect_score

1.0

problem_types

[ProblemTypes.MULTICLASS, ProblemTypes.TIME_SERIES_MULTICLASS]

score_needs_proba

False

Methods

calculate_percent_difference

Calculate the percent difference between scores.

is_defined_for_problem_type

objective_function

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

positive_only

If True, this objective is only valid for positive data. Default False.

score

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

validate_inputs

Validates the input based on a few simple checks.

classmethod calculate_percent_difference(cls, score, baseline_score)

Calculate the percent difference between scores.

Parameters
  • score (float) – A score. Output of the score method of this objective.

  • baseline_score (float) – A score. Output of the score method of this objective. In practice, this is the score achieved on this objective with a baseline estimator.

Returns

The percent difference between the scores. Note that for objectives that can be interpreted

as percentages, this will be the difference between the reference score and score. For all other objectives, the difference will be normalized by the reference score.

Return type

float

classmethod is_defined_for_problem_type(cls, problem_type)
objective_function(self, y_true, y_predicted, X=None, sample_weight=None)[source]

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

Arguments:

y_predicted (pd.Series): Predicted values of length [n_samples] y_true (pd.Series): Actual class labels of length [n_samples] X (pd.DataFrame or np.ndarray): Extra data of shape [n_samples, n_features] necessary to calculate score sample_weight (pd.DataFrame or np.ndarray): Sample weights used in computing objective value result

Returns

Numerical value used to calculate score

positive_only(cls)

If True, this objective is only valid for positive data. Default False.

score(self, y_true, y_predicted, X=None, sample_weight=None)

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

Parameters
  • y_predicted (pd.Series) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

  • X (pd.DataFrame or np.ndarray) – Extra data of shape [n_samples, n_features] necessary to calculate score

  • sample_weight (pd.DataFrame or np.ndarray) – Sample weights used in computing objective value result

Returns

score

validate_inputs(self, y_true, y_predicted)

Validates the input based on a few simple checks.

Parameters
  • y_predicted (pd.Series, or pd.DataFrame) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

Returns

None

class evalml.objectives.standard_metrics.MeanSquaredLogError[source]

Mean squared log error for regression.

Only valid for nonnegative inputs. Otherwise, will throw a ValueError

Attributes

expected_range

None

greater_is_better

False

is_bounded_like_percentage

False

name

Mean Squared Log Error

perfect_score

0.0

problem_types

[ProblemTypes.REGRESSION, ProblemTypes.TIME_SERIES_REGRESSION]

score_needs_proba

False

Methods

calculate_percent_difference

Calculate the percent difference between scores.

is_defined_for_problem_type

objective_function

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

positive_only

If True, this objective is only valid for positive data. Default False.

score

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

validate_inputs

Validates the input based on a few simple checks.

classmethod calculate_percent_difference(cls, score, baseline_score)

Calculate the percent difference between scores.

Parameters
  • score (float) – A score. Output of the score method of this objective.

  • baseline_score (float) – A score. Output of the score method of this objective. In practice, this is the score achieved on this objective with a baseline estimator.

Returns

The percent difference between the scores. Note that for objectives that can be interpreted

as percentages, this will be the difference between the reference score and score. For all other objectives, the difference will be normalized by the reference score.

Return type

float

classmethod is_defined_for_problem_type(cls, problem_type)
objective_function(self, y_true, y_predicted, X=None, sample_weight=None)[source]

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

Arguments:

y_predicted (pd.Series): Predicted values of length [n_samples] y_true (pd.Series): Actual class labels of length [n_samples] X (pd.DataFrame or np.ndarray): Extra data of shape [n_samples, n_features] necessary to calculate score sample_weight (pd.DataFrame or np.ndarray): Sample weights used in computing objective value result

Returns

Numerical value used to calculate score

positive_only(self)

If True, this objective is only valid for positive data. Default False.

score(self, y_true, y_predicted, X=None, sample_weight=None)

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

Parameters
  • y_predicted (pd.Series) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

  • X (pd.DataFrame or np.ndarray) – Extra data of shape [n_samples, n_features] necessary to calculate score

  • sample_weight (pd.DataFrame or np.ndarray) – Sample weights used in computing objective value result

Returns

score

validate_inputs(self, y_true, y_predicted)

Validates the input based on a few simple checks.

Parameters
  • y_predicted (pd.Series, or pd.DataFrame) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

Returns

None

class evalml.objectives.standard_metrics.MedianAE[source]

Median absolute error for regression.

Attributes

expected_range

None

greater_is_better

False

is_bounded_like_percentage

False

name

MedianAE

perfect_score

0.0

problem_types

[ProblemTypes.REGRESSION, ProblemTypes.TIME_SERIES_REGRESSION]

score_needs_proba

False

Methods

calculate_percent_difference

Calculate the percent difference between scores.

is_defined_for_problem_type

objective_function

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

positive_only

If True, this objective is only valid for positive data. Default False.

score

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

validate_inputs

Validates the input based on a few simple checks.

classmethod calculate_percent_difference(cls, score, baseline_score)

Calculate the percent difference between scores.

Parameters
  • score (float) – A score. Output of the score method of this objective.

  • baseline_score (float) – A score. Output of the score method of this objective. In practice, this is the score achieved on this objective with a baseline estimator.

Returns

The percent difference between the scores. Note that for objectives that can be interpreted

as percentages, this will be the difference between the reference score and score. For all other objectives, the difference will be normalized by the reference score.

Return type

float

classmethod is_defined_for_problem_type(cls, problem_type)
objective_function(self, y_true, y_predicted, X=None, sample_weight=None)[source]

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

Arguments:

y_predicted (pd.Series): Predicted values of length [n_samples] y_true (pd.Series): Actual class labels of length [n_samples] X (pd.DataFrame or np.ndarray): Extra data of shape [n_samples, n_features] necessary to calculate score sample_weight (pd.DataFrame or np.ndarray): Sample weights used in computing objective value result

Returns

Numerical value used to calculate score

positive_only(cls)

If True, this objective is only valid for positive data. Default False.

score(self, y_true, y_predicted, X=None, sample_weight=None)

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

Parameters
  • y_predicted (pd.Series) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

  • X (pd.DataFrame or np.ndarray) – Extra data of shape [n_samples, n_features] necessary to calculate score

  • sample_weight (pd.DataFrame or np.ndarray) – Sample weights used in computing objective value result

Returns

score

validate_inputs(self, y_true, y_predicted)

Validates the input based on a few simple checks.

Parameters
  • y_predicted (pd.Series, or pd.DataFrame) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

Returns

None

class evalml.objectives.standard_metrics.MSE[source]

Mean squared error for regression.

Attributes

expected_range

None

greater_is_better

False

is_bounded_like_percentage

False

name

MSE

perfect_score

0.0

problem_types

[ProblemTypes.REGRESSION, ProblemTypes.TIME_SERIES_REGRESSION]

score_needs_proba

False

Methods

calculate_percent_difference

Calculate the percent difference between scores.

is_defined_for_problem_type

objective_function

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

positive_only

If True, this objective is only valid for positive data. Default False.

score

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

validate_inputs

Validates the input based on a few simple checks.

classmethod calculate_percent_difference(cls, score, baseline_score)

Calculate the percent difference between scores.

Parameters
  • score (float) – A score. Output of the score method of this objective.

  • baseline_score (float) – A score. Output of the score method of this objective. In practice, this is the score achieved on this objective with a baseline estimator.

Returns

The percent difference between the scores. Note that for objectives that can be interpreted

as percentages, this will be the difference between the reference score and score. For all other objectives, the difference will be normalized by the reference score.

Return type

float

classmethod is_defined_for_problem_type(cls, problem_type)
objective_function(self, y_true, y_predicted, X=None, sample_weight=None)[source]

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

Arguments:

y_predicted (pd.Series): Predicted values of length [n_samples] y_true (pd.Series): Actual class labels of length [n_samples] X (pd.DataFrame or np.ndarray): Extra data of shape [n_samples, n_features] necessary to calculate score sample_weight (pd.DataFrame or np.ndarray): Sample weights used in computing objective value result

Returns

Numerical value used to calculate score

positive_only(cls)

If True, this objective is only valid for positive data. Default False.

score(self, y_true, y_predicted, X=None, sample_weight=None)

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

Parameters
  • y_predicted (pd.Series) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

  • X (pd.DataFrame or np.ndarray) – Extra data of shape [n_samples, n_features] necessary to calculate score

  • sample_weight (pd.DataFrame or np.ndarray) – Sample weights used in computing objective value result

Returns

score

validate_inputs(self, y_true, y_predicted)

Validates the input based on a few simple checks.

Parameters
  • y_predicted (pd.Series, or pd.DataFrame) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

Returns

None

class evalml.objectives.standard_metrics.Precision[source]

Precision score for binary classification.

Attributes

expected_range

[0, 1]

greater_is_better

True

is_bounded_like_percentage

True

name

Precision

perfect_score

1.0

problem_types

[ProblemTypes.BINARY, ProblemTypes.TIME_SERIES_BINARY]

score_needs_proba

False

Methods

calculate_percent_difference

Calculate the percent difference between scores.

can_optimize_threshold

Returns a boolean determining if we can optimize the binary classification objective threshold.

decision_function

Apply a learned threshold to predicted probabilities to get predicted classes.

is_defined_for_problem_type

objective_function

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

optimize_threshold

Learn a binary classification threshold which optimizes the current objective.

positive_only

If True, this objective is only valid for positive data. Default False.

score

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

validate_inputs

Validates the input based on a few simple checks.

classmethod calculate_percent_difference(cls, score, baseline_score)

Calculate the percent difference between scores.

Parameters
  • score (float) – A score. Output of the score method of this objective.

  • baseline_score (float) – A score. Output of the score method of this objective. In practice, this is the score achieved on this objective with a baseline estimator.

Returns

The percent difference between the scores. Note that for objectives that can be interpreted

as percentages, this will be the difference between the reference score and score. For all other objectives, the difference will be normalized by the reference score.

Return type

float

property can_optimize_threshold(cls)

Returns a boolean determining if we can optimize the binary classification objective threshold. This will be false for any objective that works directly with predicted probabilities, like log loss and AUC. Otherwise, it will be true.

decision_function(self, ypred_proba, threshold=0.5, X=None)

Apply a learned threshold to predicted probabilities to get predicted classes.

Parameters
  • ypred_proba (pd.Series, np.ndarray) – The classifier’s predicted probabilities

  • threshold (float, optional) – Threshold used to make a prediction. Defaults to 0.5.

  • X (pd.DataFrame, optional) – Any extra columns that are needed from training data.

Returns

predictions

classmethod is_defined_for_problem_type(cls, problem_type)
objective_function(self, y_true, y_predicted, X=None, sample_weight=None)[source]

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

Arguments:

y_predicted (pd.Series): Predicted values of length [n_samples] y_true (pd.Series): Actual class labels of length [n_samples] X (pd.DataFrame or np.ndarray): Extra data of shape [n_samples, n_features] necessary to calculate score sample_weight (pd.DataFrame or np.ndarray): Sample weights used in computing objective value result

Returns

Numerical value used to calculate score

optimize_threshold(self, ypred_proba, y_true, X=None)

Learn a binary classification threshold which optimizes the current objective.

Parameters
  • ypred_proba (pd.Series) – The classifier’s predicted probabilities

  • y_true (pd.Series) – The ground truth for the predictions.

  • X (pd.DataFrame, optional) – Any extra columns that are needed from training data.

Returns

Optimal threshold for this objective

positive_only(cls)

If True, this objective is only valid for positive data. Default False.

score(self, y_true, y_predicted, X=None, sample_weight=None)

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

Parameters
  • y_predicted (pd.Series) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

  • X (pd.DataFrame or np.ndarray) – Extra data of shape [n_samples, n_features] necessary to calculate score

  • sample_weight (pd.DataFrame or np.ndarray) – Sample weights used in computing objective value result

Returns

score

validate_inputs(self, y_true, y_predicted)

Validates the input based on a few simple checks.

Parameters
  • y_predicted (pd.Series, or pd.DataFrame) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

Returns

None

class evalml.objectives.standard_metrics.PrecisionMacro[source]

Precision score for multiclass classification using macro averaging.

Attributes

expected_range

[0, 1]

greater_is_better

True

is_bounded_like_percentage

True

name

Precision Macro

perfect_score

1.0

problem_types

[ProblemTypes.MULTICLASS, ProblemTypes.TIME_SERIES_MULTICLASS]

score_needs_proba

False

Methods

calculate_percent_difference

Calculate the percent difference between scores.

is_defined_for_problem_type

objective_function

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

positive_only

If True, this objective is only valid for positive data. Default False.

score

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

validate_inputs

Validates the input based on a few simple checks.

classmethod calculate_percent_difference(cls, score, baseline_score)

Calculate the percent difference between scores.

Parameters
  • score (float) – A score. Output of the score method of this objective.

  • baseline_score (float) – A score. Output of the score method of this objective. In practice, this is the score achieved on this objective with a baseline estimator.

Returns

The percent difference between the scores. Note that for objectives that can be interpreted

as percentages, this will be the difference between the reference score and score. For all other objectives, the difference will be normalized by the reference score.

Return type

float

classmethod is_defined_for_problem_type(cls, problem_type)
objective_function(self, y_true, y_predicted, X=None, sample_weight=None)[source]

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

Arguments:

y_predicted (pd.Series): Predicted values of length [n_samples] y_true (pd.Series): Actual class labels of length [n_samples] X (pd.DataFrame or np.ndarray): Extra data of shape [n_samples, n_features] necessary to calculate score sample_weight (pd.DataFrame or np.ndarray): Sample weights used in computing objective value result

Returns

Numerical value used to calculate score

positive_only(cls)

If True, this objective is only valid for positive data. Default False.

score(self, y_true, y_predicted, X=None, sample_weight=None)

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

Parameters
  • y_predicted (pd.Series) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

  • X (pd.DataFrame or np.ndarray) – Extra data of shape [n_samples, n_features] necessary to calculate score

  • sample_weight (pd.DataFrame or np.ndarray) – Sample weights used in computing objective value result

Returns

score

validate_inputs(self, y_true, y_predicted)

Validates the input based on a few simple checks.

Parameters
  • y_predicted (pd.Series, or pd.DataFrame) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

Returns

None

class evalml.objectives.standard_metrics.PrecisionMicro[source]

Precision score for multiclass classification using micro averaging.

Attributes

expected_range

[0, 1]

greater_is_better

True

is_bounded_like_percentage

True

name

Precision Micro

perfect_score

1.0

problem_types

[ProblemTypes.MULTICLASS, ProblemTypes.TIME_SERIES_MULTICLASS]

score_needs_proba

False

Methods

calculate_percent_difference

Calculate the percent difference between scores.

is_defined_for_problem_type

objective_function

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

positive_only

If True, this objective is only valid for positive data. Default False.

score

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

validate_inputs

Validates the input based on a few simple checks.

classmethod calculate_percent_difference(cls, score, baseline_score)

Calculate the percent difference between scores.

Parameters
  • score (float) – A score. Output of the score method of this objective.

  • baseline_score (float) – A score. Output of the score method of this objective. In practice, this is the score achieved on this objective with a baseline estimator.

Returns

The percent difference between the scores. Note that for objectives that can be interpreted

as percentages, this will be the difference between the reference score and score. For all other objectives, the difference will be normalized by the reference score.

Return type

float

classmethod is_defined_for_problem_type(cls, problem_type)
objective_function(self, y_true, y_predicted, X=None, sample_weight=None)[source]

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

Arguments:

y_predicted (pd.Series): Predicted values of length [n_samples] y_true (pd.Series): Actual class labels of length [n_samples] X (pd.DataFrame or np.ndarray): Extra data of shape [n_samples, n_features] necessary to calculate score sample_weight (pd.DataFrame or np.ndarray): Sample weights used in computing objective value result

Returns

Numerical value used to calculate score

positive_only(cls)

If True, this objective is only valid for positive data. Default False.

score(self, y_true, y_predicted, X=None, sample_weight=None)

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

Parameters
  • y_predicted (pd.Series) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

  • X (pd.DataFrame or np.ndarray) – Extra data of shape [n_samples, n_features] necessary to calculate score

  • sample_weight (pd.DataFrame or np.ndarray) – Sample weights used in computing objective value result

Returns

score

validate_inputs(self, y_true, y_predicted)

Validates the input based on a few simple checks.

Parameters
  • y_predicted (pd.Series, or pd.DataFrame) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

Returns

None

class evalml.objectives.standard_metrics.PrecisionWeighted[source]

Precision score for multiclass classification using weighted averaging.

Attributes

expected_range

[0, 1]

greater_is_better

True

is_bounded_like_percentage

True

name

Precision Weighted

perfect_score

1.0

problem_types

[ProblemTypes.MULTICLASS, ProblemTypes.TIME_SERIES_MULTICLASS]

score_needs_proba

False

Methods

calculate_percent_difference

Calculate the percent difference between scores.

is_defined_for_problem_type

objective_function

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

positive_only

If True, this objective is only valid for positive data. Default False.

score

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

validate_inputs

Validates the input based on a few simple checks.

classmethod calculate_percent_difference(cls, score, baseline_score)

Calculate the percent difference between scores.

Parameters
  • score (float) – A score. Output of the score method of this objective.

  • baseline_score (float) – A score. Output of the score method of this objective. In practice, this is the score achieved on this objective with a baseline estimator.

Returns

The percent difference between the scores. Note that for objectives that can be interpreted

as percentages, this will be the difference between the reference score and score. For all other objectives, the difference will be normalized by the reference score.

Return type

float

classmethod is_defined_for_problem_type(cls, problem_type)
objective_function(self, y_true, y_predicted, X=None, sample_weight=None)[source]

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

Arguments:

y_predicted (pd.Series): Predicted values of length [n_samples] y_true (pd.Series): Actual class labels of length [n_samples] X (pd.DataFrame or np.ndarray): Extra data of shape [n_samples, n_features] necessary to calculate score sample_weight (pd.DataFrame or np.ndarray): Sample weights used in computing objective value result

Returns

Numerical value used to calculate score

positive_only(cls)

If True, this objective is only valid for positive data. Default False.

score(self, y_true, y_predicted, X=None, sample_weight=None)

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

Parameters
  • y_predicted (pd.Series) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

  • X (pd.DataFrame or np.ndarray) – Extra data of shape [n_samples, n_features] necessary to calculate score

  • sample_weight (pd.DataFrame or np.ndarray) – Sample weights used in computing objective value result

Returns

score

validate_inputs(self, y_true, y_predicted)

Validates the input based on a few simple checks.

Parameters
  • y_predicted (pd.Series, or pd.DataFrame) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

Returns

None

class evalml.objectives.standard_metrics.R2[source]

Coefficient of determination for regression.

Attributes

expected_range

None

greater_is_better

True

is_bounded_like_percentage

False

name

R2

perfect_score

1

problem_types

[ProblemTypes.REGRESSION, ProblemTypes.TIME_SERIES_REGRESSION]

score_needs_proba

False

Methods

calculate_percent_difference

Calculate the percent difference between scores.

is_defined_for_problem_type

objective_function

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

positive_only

If True, this objective is only valid for positive data. Default False.

score

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

validate_inputs

Validates the input based on a few simple checks.

classmethod calculate_percent_difference(cls, score, baseline_score)

Calculate the percent difference between scores.

Parameters
  • score (float) – A score. Output of the score method of this objective.

  • baseline_score (float) – A score. Output of the score method of this objective. In practice, this is the score achieved on this objective with a baseline estimator.

Returns

The percent difference between the scores. Note that for objectives that can be interpreted

as percentages, this will be the difference between the reference score and score. For all other objectives, the difference will be normalized by the reference score.

Return type

float

classmethod is_defined_for_problem_type(cls, problem_type)
objective_function(self, y_true, y_predicted, X=None, sample_weight=None)[source]

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

Arguments:

y_predicted (pd.Series): Predicted values of length [n_samples] y_true (pd.Series): Actual class labels of length [n_samples] X (pd.DataFrame or np.ndarray): Extra data of shape [n_samples, n_features] necessary to calculate score sample_weight (pd.DataFrame or np.ndarray): Sample weights used in computing objective value result

Returns

Numerical value used to calculate score

positive_only(cls)

If True, this objective is only valid for positive data. Default False.

score(self, y_true, y_predicted, X=None, sample_weight=None)

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

Parameters
  • y_predicted (pd.Series) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

  • X (pd.DataFrame or np.ndarray) – Extra data of shape [n_samples, n_features] necessary to calculate score

  • sample_weight (pd.DataFrame or np.ndarray) – Sample weights used in computing objective value result

Returns

score

validate_inputs(self, y_true, y_predicted)

Validates the input based on a few simple checks.

Parameters
  • y_predicted (pd.Series, or pd.DataFrame) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

Returns

None

class evalml.objectives.standard_metrics.Recall[source]

Recall score for binary classification.

Attributes

expected_range

[0, 1]

greater_is_better

True

is_bounded_like_percentage

True

name

Recall

perfect_score

1.0

problem_types

[ProblemTypes.BINARY, ProblemTypes.TIME_SERIES_BINARY]

score_needs_proba

False

Methods

calculate_percent_difference

Calculate the percent difference between scores.

can_optimize_threshold

Returns a boolean determining if we can optimize the binary classification objective threshold.

decision_function

Apply a learned threshold to predicted probabilities to get predicted classes.

is_defined_for_problem_type

objective_function

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

optimize_threshold

Learn a binary classification threshold which optimizes the current objective.

positive_only

If True, this objective is only valid for positive data. Default False.

score

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

validate_inputs

Validates the input based on a few simple checks.

classmethod calculate_percent_difference(cls, score, baseline_score)

Calculate the percent difference between scores.

Parameters
  • score (float) – A score. Output of the score method of this objective.

  • baseline_score (float) – A score. Output of the score method of this objective. In practice, this is the score achieved on this objective with a baseline estimator.

Returns

The percent difference between the scores. Note that for objectives that can be interpreted

as percentages, this will be the difference between the reference score and score. For all other objectives, the difference will be normalized by the reference score.

Return type

float

property can_optimize_threshold(cls)

Returns a boolean determining if we can optimize the binary classification objective threshold. This will be false for any objective that works directly with predicted probabilities, like log loss and AUC. Otherwise, it will be true.

decision_function(self, ypred_proba, threshold=0.5, X=None)

Apply a learned threshold to predicted probabilities to get predicted classes.

Parameters
  • ypred_proba (pd.Series, np.ndarray) – The classifier’s predicted probabilities

  • threshold (float, optional) – Threshold used to make a prediction. Defaults to 0.5.

  • X (pd.DataFrame, optional) – Any extra columns that are needed from training data.

Returns

predictions

classmethod is_defined_for_problem_type(cls, problem_type)
objective_function(self, y_true, y_predicted, X=None, sample_weight=None)[source]

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

Arguments:

y_predicted (pd.Series): Predicted values of length [n_samples] y_true (pd.Series): Actual class labels of length [n_samples] X (pd.DataFrame or np.ndarray): Extra data of shape [n_samples, n_features] necessary to calculate score sample_weight (pd.DataFrame or np.ndarray): Sample weights used in computing objective value result

Returns

Numerical value used to calculate score

optimize_threshold(self, ypred_proba, y_true, X=None)

Learn a binary classification threshold which optimizes the current objective.

Parameters
  • ypred_proba (pd.Series) – The classifier’s predicted probabilities

  • y_true (pd.Series) – The ground truth for the predictions.

  • X (pd.DataFrame, optional) – Any extra columns that are needed from training data.

Returns

Optimal threshold for this objective

positive_only(cls)

If True, this objective is only valid for positive data. Default False.

score(self, y_true, y_predicted, X=None, sample_weight=None)

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

Parameters
  • y_predicted (pd.Series) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

  • X (pd.DataFrame or np.ndarray) – Extra data of shape [n_samples, n_features] necessary to calculate score

  • sample_weight (pd.DataFrame or np.ndarray) – Sample weights used in computing objective value result

Returns

score

validate_inputs(self, y_true, y_predicted)

Validates the input based on a few simple checks.

Parameters
  • y_predicted (pd.Series, or pd.DataFrame) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

Returns

None

class evalml.objectives.standard_metrics.RecallMacro[source]

Recall score for multiclass classification using macro averaging.

Attributes

expected_range

[0, 1]

greater_is_better

True

is_bounded_like_percentage

True

name

Recall Macro

perfect_score

1.0

problem_types

[ProblemTypes.MULTICLASS, ProblemTypes.TIME_SERIES_MULTICLASS]

score_needs_proba

False

Methods

calculate_percent_difference

Calculate the percent difference between scores.

is_defined_for_problem_type

objective_function

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

positive_only

If True, this objective is only valid for positive data. Default False.

score

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

validate_inputs

Validates the input based on a few simple checks.

classmethod calculate_percent_difference(cls, score, baseline_score)

Calculate the percent difference between scores.

Parameters
  • score (float) – A score. Output of the score method of this objective.

  • baseline_score (float) – A score. Output of the score method of this objective. In practice, this is the score achieved on this objective with a baseline estimator.

Returns

The percent difference between the scores. Note that for objectives that can be interpreted

as percentages, this will be the difference between the reference score and score. For all other objectives, the difference will be normalized by the reference score.

Return type

float

classmethod is_defined_for_problem_type(cls, problem_type)
objective_function(self, y_true, y_predicted, X=None, sample_weight=None)[source]

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

Arguments:

y_predicted (pd.Series): Predicted values of length [n_samples] y_true (pd.Series): Actual class labels of length [n_samples] X (pd.DataFrame or np.ndarray): Extra data of shape [n_samples, n_features] necessary to calculate score sample_weight (pd.DataFrame or np.ndarray): Sample weights used in computing objective value result

Returns

Numerical value used to calculate score

positive_only(cls)

If True, this objective is only valid for positive data. Default False.

score(self, y_true, y_predicted, X=None, sample_weight=None)

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

Parameters
  • y_predicted (pd.Series) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

  • X (pd.DataFrame or np.ndarray) – Extra data of shape [n_samples, n_features] necessary to calculate score

  • sample_weight (pd.DataFrame or np.ndarray) – Sample weights used in computing objective value result

Returns

score

validate_inputs(self, y_true, y_predicted)

Validates the input based on a few simple checks.

Parameters
  • y_predicted (pd.Series, or pd.DataFrame) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

Returns

None

class evalml.objectives.standard_metrics.RecallMicro[source]

Recall score for multiclass classification using micro averaging.

Attributes

expected_range

[0, 1]

greater_is_better

True

is_bounded_like_percentage

True

name

Recall Micro

perfect_score

1.0

problem_types

[ProblemTypes.MULTICLASS, ProblemTypes.TIME_SERIES_MULTICLASS]

score_needs_proba

False

Methods

calculate_percent_difference

Calculate the percent difference between scores.

is_defined_for_problem_type

objective_function

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

positive_only

If True, this objective is only valid for positive data. Default False.

score

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

validate_inputs

Validates the input based on a few simple checks.

classmethod calculate_percent_difference(cls, score, baseline_score)

Calculate the percent difference between scores.

Parameters
  • score (float) – A score. Output of the score method of this objective.

  • baseline_score (float) – A score. Output of the score method of this objective. In practice, this is the score achieved on this objective with a baseline estimator.

Returns

The percent difference between the scores. Note that for objectives that can be interpreted

as percentages, this will be the difference between the reference score and score. For all other objectives, the difference will be normalized by the reference score.

Return type

float

classmethod is_defined_for_problem_type(cls, problem_type)
objective_function(self, y_true, y_predicted, X=None, sample_weight=None)[source]

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

Arguments:

y_predicted (pd.Series): Predicted values of length [n_samples] y_true (pd.Series): Actual class labels of length [n_samples] X (pd.DataFrame or np.ndarray): Extra data of shape [n_samples, n_features] necessary to calculate score sample_weight (pd.DataFrame or np.ndarray): Sample weights used in computing objective value result

Returns

Numerical value used to calculate score

positive_only(cls)

If True, this objective is only valid for positive data. Default False.

score(self, y_true, y_predicted, X=None, sample_weight=None)

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

Parameters
  • y_predicted (pd.Series) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

  • X (pd.DataFrame or np.ndarray) – Extra data of shape [n_samples, n_features] necessary to calculate score

  • sample_weight (pd.DataFrame or np.ndarray) – Sample weights used in computing objective value result

Returns

score

validate_inputs(self, y_true, y_predicted)

Validates the input based on a few simple checks.

Parameters
  • y_predicted (pd.Series, or pd.DataFrame) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

Returns

None

class evalml.objectives.standard_metrics.RecallWeighted[source]

Recall score for multiclass classification using weighted averaging.

Attributes

expected_range

[0, 1]

greater_is_better

True

is_bounded_like_percentage

True

name

Recall Weighted

perfect_score

1.0

problem_types

[ProblemTypes.MULTICLASS, ProblemTypes.TIME_SERIES_MULTICLASS]

score_needs_proba

False

Methods

calculate_percent_difference

Calculate the percent difference between scores.

is_defined_for_problem_type

objective_function

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

positive_only

If True, this objective is only valid for positive data. Default False.

score

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

validate_inputs

Validates the input based on a few simple checks.

classmethod calculate_percent_difference(cls, score, baseline_score)

Calculate the percent difference between scores.

Parameters
  • score (float) – A score. Output of the score method of this objective.

  • baseline_score (float) – A score. Output of the score method of this objective. In practice, this is the score achieved on this objective with a baseline estimator.

Returns

The percent difference between the scores. Note that for objectives that can be interpreted

as percentages, this will be the difference between the reference score and score. For all other objectives, the difference will be normalized by the reference score.

Return type

float

classmethod is_defined_for_problem_type(cls, problem_type)
objective_function(self, y_true, y_predicted, X=None, sample_weight=None)[source]

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

Arguments:

y_predicted (pd.Series): Predicted values of length [n_samples] y_true (pd.Series): Actual class labels of length [n_samples] X (pd.DataFrame or np.ndarray): Extra data of shape [n_samples, n_features] necessary to calculate score sample_weight (pd.DataFrame or np.ndarray): Sample weights used in computing objective value result

Returns

Numerical value used to calculate score

positive_only(cls)

If True, this objective is only valid for positive data. Default False.

score(self, y_true, y_predicted, X=None, sample_weight=None)

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

Parameters
  • y_predicted (pd.Series) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

  • X (pd.DataFrame or np.ndarray) – Extra data of shape [n_samples, n_features] necessary to calculate score

  • sample_weight (pd.DataFrame or np.ndarray) – Sample weights used in computing objective value result

Returns

score

validate_inputs(self, y_true, y_predicted)

Validates the input based on a few simple checks.

Parameters
  • y_predicted (pd.Series, or pd.DataFrame) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

Returns

None

class evalml.objectives.standard_metrics.RootMeanSquaredError[source]

Root mean squared error for regression.

Attributes

expected_range

None

greater_is_better

False

is_bounded_like_percentage

False

name

Root Mean Squared Error

perfect_score

0.0

problem_types

[ProblemTypes.REGRESSION, ProblemTypes.TIME_SERIES_REGRESSION]

score_needs_proba

False

Methods

calculate_percent_difference

Calculate the percent difference between scores.

is_defined_for_problem_type

objective_function

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

positive_only

If True, this objective is only valid for positive data. Default False.

score

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

validate_inputs

Validates the input based on a few simple checks.

classmethod calculate_percent_difference(cls, score, baseline_score)

Calculate the percent difference between scores.

Parameters
  • score (float) – A score. Output of the score method of this objective.

  • baseline_score (float) – A score. Output of the score method of this objective. In practice, this is the score achieved on this objective with a baseline estimator.

Returns

The percent difference between the scores. Note that for objectives that can be interpreted

as percentages, this will be the difference between the reference score and score. For all other objectives, the difference will be normalized by the reference score.

Return type

float

classmethod is_defined_for_problem_type(cls, problem_type)
objective_function(self, y_true, y_predicted, X=None, sample_weight=None)[source]

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

Arguments:

y_predicted (pd.Series): Predicted values of length [n_samples] y_true (pd.Series): Actual class labels of length [n_samples] X (pd.DataFrame or np.ndarray): Extra data of shape [n_samples, n_features] necessary to calculate score sample_weight (pd.DataFrame or np.ndarray): Sample weights used in computing objective value result

Returns

Numerical value used to calculate score

positive_only(cls)

If True, this objective is only valid for positive data. Default False.

score(self, y_true, y_predicted, X=None, sample_weight=None)

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

Parameters
  • y_predicted (pd.Series) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

  • X (pd.DataFrame or np.ndarray) – Extra data of shape [n_samples, n_features] necessary to calculate score

  • sample_weight (pd.DataFrame or np.ndarray) – Sample weights used in computing objective value result

Returns

score

validate_inputs(self, y_true, y_predicted)

Validates the input based on a few simple checks.

Parameters
  • y_predicted (pd.Series, or pd.DataFrame) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

Returns

None

class evalml.objectives.standard_metrics.RootMeanSquaredLogError[source]

Root mean squared log error for regression.

Only valid for nonnegative inputs.Otherwise, will throw a ValueError.

Attributes

expected_range

None

greater_is_better

False

is_bounded_like_percentage

False

name

Root Mean Squared Log Error

perfect_score

0.0

problem_types

[ProblemTypes.REGRESSION, ProblemTypes.TIME_SERIES_REGRESSION]

score_needs_proba

False

Methods

calculate_percent_difference

Calculate the percent difference between scores.

is_defined_for_problem_type

objective_function

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

positive_only

If True, this objective is only valid for positive data. Default False.

score

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

validate_inputs

Validates the input based on a few simple checks.

classmethod calculate_percent_difference(cls, score, baseline_score)

Calculate the percent difference between scores.

Parameters
  • score (float) – A score. Output of the score method of this objective.

  • baseline_score (float) – A score. Output of the score method of this objective. In practice, this is the score achieved on this objective with a baseline estimator.

Returns

The percent difference between the scores. Note that for objectives that can be interpreted

as percentages, this will be the difference between the reference score and score. For all other objectives, the difference will be normalized by the reference score.

Return type

float

classmethod is_defined_for_problem_type(cls, problem_type)
objective_function(self, y_true, y_predicted, X=None, sample_weight=None)[source]

Computes the relative value of the provided predictions compared to the actual labels, according a specified metric

Arguments:

y_predicted (pd.Series): Predicted values of length [n_samples] y_true (pd.Series): Actual class labels of length [n_samples] X (pd.DataFrame or np.ndarray): Extra data of shape [n_samples, n_features] necessary to calculate score sample_weight (pd.DataFrame or np.ndarray): Sample weights used in computing objective value result

Returns

Numerical value used to calculate score

positive_only(self)

If True, this objective is only valid for positive data. Default False.

score(self, y_true, y_predicted, X=None, sample_weight=None)

Returns a numerical score indicating performance based on the differences between the predicted and actual values.

Parameters
  • y_predicted (pd.Series) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

  • X (pd.DataFrame or np.ndarray) – Extra data of shape [n_samples, n_features] necessary to calculate score

  • sample_weight (pd.DataFrame or np.ndarray) – Sample weights used in computing objective value result

Returns

score

validate_inputs(self, y_true, y_predicted)

Validates the input based on a few simple checks.

Parameters
  • y_predicted (pd.Series, or pd.DataFrame) – Predicted values of length [n_samples]

  • y_true (pd.Series) – Actual class labels of length [n_samples]

Returns

None