astra.metrics

This module contains functions for model selection and evaluation.

astra.metrics.CLASSIFICATION_METRICS

A dictionary mapping classification metric names to their corresponding functions. [source]

Type:

dict

astra.metrics.REGRESSION_METRICS

A dictionary mapping regression metric names to their corresponding functions. [source]

Type:

dict

astra.metrics.MULTICLASS_METRICS

A dictionary mapping multiclass classification metric names to their corresponding functions. [source]

Type:

dict

astra.metrics.KNOWN_METRICS

A dictionary mapping all metric names to their corresponding functions. [source]

Type:

dict

astra.metrics.SCORING

A dictionary mapping all metric names to their corresponding scoring functions. [source]

Type:

dict

astra.metrics.HIGHER_BETTER

A list of metrics for which higher scores are better. [source]

Type:

list

astra.metrics.LOWER_BETTER

A list of metrics for which lower scores are better. [source]

Type:

list

Functions

get_kendalltau_score(y_true, y_pred)

Calculate the Kendall Tau correlation coefficient.

get_pearsonr_score(y_true, y_pred)

Calculate the Pearson correlation coefficient.

get_spearmanr_score(y_true, y_pred)

Calculate the Spearman correlation coefficient.

astra.metrics.get_kendalltau_score(y_true, y_pred)[source]

Calculate the Kendall Tau correlation coefficient.

Parameters:
  • y_true (list) -- True values.

  • y_pred (list) -- Predicted values.

Returns:

The Kendall Tau correlation coefficient.

Return type:

float

astra.metrics.get_pearsonr_score(y_true, y_pred)[source]

Calculate the Pearson correlation coefficient.

Parameters:
  • y_true (list) -- True values.

  • y_pred (list) -- Predicted values.

Returns:

The Pearson correlation coefficient.

Return type:

float

astra.metrics.get_spearmanr_score(y_true, y_pred)[source]

Calculate the Spearman correlation coefficient.

Parameters:
  • y_true (list) -- True values.

  • y_pred (list) -- Predicted values.

Returns:

The Spearman correlation

Return type:

float