Compute the mean_squared_log_error metric — provided by scikit-learn. Use when the user has predictions and ground-truth and needs to compute mean_squared_log_error, or asks how to score with mean_squared_log_error.
Scanned 9/11/2026
Install to Claude Code
npx -y skills add qhjqhj00/research-skills-pool --skill mean-squared-log-error --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Mean Squared Log Error?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/qhjqhj00-mean-squared-log-error)More formats (shields.io, HTML) on the badges page.
---
name: mean-squared-log-error
description: Compute the mean_squared_log_error metric — provided by scikit-learn. Use when the user has predictions and ground-truth and needs to compute mean_squared_log_error, or asks how to score with mean_squared_log_error.
metadata:
skill_kind: metric
source_lib: scikit-learn
import_path: sklearn.metrics.mean_squared_log_error
source: library_introspection
---
# mean-squared-log-error
> Metric `mean_squared_log_error` from `scikit-learn` (sklearn.metrics.mean_squared_log_error)
## When to invoke this skill
The user has predictions + ground truth and asks to evaluate with mean_squared_log_error, or
mentions `sklearn.metrics.mean_squared_log_error` directly, or wants the standard scikit-learn implementation.
## Reference signature
```python
from sklearn.metrics import mean_squared_log_error
# mean_squared_log_error(y_true, y_pred, *, sample_weight=None, multioutput='uniform_average')
```
## Library docstring
```
Mean squared logarithmic error regression loss.
Read more in the :ref:`User Guide <mean_squared_log_error>`.
Parameters
----------
y_true : array-like of shape (n_samples,) or (n_samples, n_outputs)
Ground truth (correct) target values.
y_pred : array-like of shape (n_samples,) or (n_samples, n_outputs)
Estimated target values.
sample_weight : array-like of shape (n_samples,), default=None
Sample weights.
multioutput : {'raw_values', 'uniform_average'} or array-like of shape (n_outputs,), default='uniform_average'
Defines aggregating of multiple output values.
Array-like value defines weights used to average errors.
'raw_values' :
Returns a full set of errors when the input is of multioutput
format.
'uniform_average' :
Errors of all outputs are averaged with uniform weight.
Returns
-------
loss : float or ndarray of floats
A non-negative floating point value (the best value is 0.0), or an
array of floating point values, one for each individual target.
Examples
--------
>>> from sklearn.metrics import mean_squared_log_error
>>> y_true = [3, 5, 2.5, 7]
>>> y_pred = [2.5, 5, 4, 8]
>>> mean_squared_log_error(y_true, y_pred)
0.039...
>>> y_true = [[0.5, 1], [1, 2], [7, 6]]
>>> y_pred = [[0.5, 2], [1, 2.5], [8, 8]]
>>> mean_squared_log_error(y_true, y_pred)
0.044...
>>> mean_squared_log_error(y_true, y_pred, multioutput='raw_values')
array([0.00462428, 0.08377444])
>>> mean_squared_log_error(y_true, y_pred, multioutput=[0.3, 0.7])
0.060...
```
## Quick recipe
```python
import sklearn.metrics as _m
score = _m.mean_squared_log_error(y_true, y_pred)
```
## Don'ts
- Don't reimplement when the library version handles edge cases (NaN, ties, empty inputs) better than a hand-rolled formula.
- Always check the library version's argument order — sklearn is `(y_true, y_pred)` while torchmetrics is `(preds, target)`.
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!