yikit.metrics package#
Evaluation metrics for machine learning models.
This module provides various metrics for evaluating regression models, including root mean squared error and log-likelihood for NGBoost.
- yikit.metrics.log_likelihood(estimator, X, y)#
Compute the negative log-likelihood for an NGBoost estimator.
- Parameters:
estimator (NGBRegressor or NGBClassifier) – A fitted NGBoost regressor or classifier.
X (array-like of shape (n_samples, n_features)) – Input samples for which to compute the log-likelihood.
y (array-like of shape (n_samples,)) – True target values or class labels.
- Returns:
The negative log-likelihood computed by the estimator. Returns -estimator.score(X, y).
- Return type:
float
- Raises:
TypeError – If the estimator is not an instance of NGBRegressor or NGBClassifier.
Notes
This function is only supported for NGBoost estimators.
- yikit.metrics.root_mean_squared_error(y_true, y_pred, **kwargs)#
Compute the root mean squared error for a set of predictions.
- Parameters:
y_true (array-like of shape (n_samples,)) – True target values.
y_pred (array-like of shape (n_samples,)) – Predicted target values.
**kwargs – Additional keyword arguments to pass to the root mean squared error function.
- Returns:
The root mean squared error computed by the estimator.
- Return type:
float
Notes
This function is a wrapper around the root mean squared error function from the scikit-learn library. If the root mean squared error function is not available, the mean squared error function is used instead.