nntm.metrics package

Module contents

The nntm.metrics module includes score functions, performance metrics, pairwise metrics and distance computations.

nntm.metrics.check_scoring(estimator, scoring=None, *, allow_none=False)

Determine scorer from user options. A TypeError will be thrown if the estimator cannot be scored. :param estimator: The object to use to fit the data. :type estimator: estimator object implementing ‘fit’ :param scoring: A string (see model evaluation documentation) or

a scorer callable object / function with signature scorer(estimator, X, y). If None, the provided estimator object’s score method is used.

Parameters:

allow_none (bool, default=False) – If no scoring is specified and the estimator has no score function, we can either return None or raise an exception.

Returns:

scoring – A scorer callable object / function with signature scorer(estimator, X, y).

Return type:

callable

nntm.metrics.corr_score(y_true, y_pred, eras)

Spearman’s rank correlation coefficient.

This score is referred to as correlation (corr) in the Numerai main tournament.

Parameters:

TODO

Return type:

TODO

References

https://docs.numer.ai/tournament/learn#scoring https://github.com/numerai/example-scripts/blob/96677b980ffa1bf17f62f8f3d9695a1aac054a4a/analysis_and_tips.ipynb

nntm.metrics.get_scorer(scoring)

Get a scorer from string. Read more in the User Guide. :param scoring: Scoring method as string. If callable it is returned as is. :type scoring: str or callable

Returns:

scorer – The scorer.

Return type:

callable