Skip to content

Commit

Permalink
Unmark sklearn.metrics.mean_squared_error and `mean_squared_log_err…
Browse files Browse the repository at this point in the history
…or` as deprecated (#319)
  • Loading branch information
InSyncWithFoo authored Oct 22, 2024
1 parent 70ddd7e commit b46b33f
Showing 1 changed file with 27 additions and 6 deletions.
33 changes: 27 additions & 6 deletions stubs/sklearn/metrics/_regression.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from typing import Literal
from typing import Literal, overload
from typing_extensions import deprecated

import numpy as np
from numpy import ndarray
from scipy.special import xlogy as xlogy

Expand Down Expand Up @@ -57,23 +56,45 @@ def mean_absolute_percentage_error(
sample_weight: None | ArrayLike = None,
multioutput: ArrayLike | Literal["raw_values", "uniform_average", "uniform_average"] = "uniform_average",
) -> ndarray | Float: ...
@deprecated()
@overload
def mean_squared_error(
y_true: MatrixLike | ArrayLike,
y_pred: MatrixLike | ArrayLike,
*,
sample_weight: None | ArrayLike = None,
multioutput: ArrayLike | Literal["raw_values", "uniform_average", "uniform_average"] = "uniform_average",
squared: bool = True,
) -> ndarray | Float: ...
@deprecated()
@deprecated(
"`squared` is deprecated in 1.4 and will be removed in 1.6. Use `root_mean_squared_error` instead to calculate the root mean squared error."
)
@overload
def mean_squared_error(
y_true: MatrixLike | ArrayLike,
y_pred: MatrixLike | ArrayLike,
*,
sample_weight: None | ArrayLike = None,
multioutput: ArrayLike | Literal["raw_values", "uniform_average", "uniform_average"] = "uniform_average",
squared: bool,
) -> ndarray | Float: ...
@overload
def mean_squared_log_error(
y_true: MatrixLike | ArrayLike,
y_pred: MatrixLike | ArrayLike,
*,
sample_weight: None | ArrayLike = None,
multioutput: ArrayLike | Literal["raw_values", "uniform_average", "uniform_average"] = "uniform_average",
) -> float | ndarray: ...
@deprecated(
"`squared` is deprecated in 1.4 and will be removed in 1.6. Use `root_mean_squared_log_error` instead to calculate the root mean squared logarithmic error."
)
@overload
def mean_squared_log_error(
y_true: MatrixLike | ArrayLike,
y_pred: MatrixLike | ArrayLike,
*,
sample_weight: None | ArrayLike = None,
multioutput: ArrayLike | Literal["raw_values", "uniform_average", "uniform_average"] = "uniform_average",
squared: bool = True,
squared: bool,
) -> float | ndarray: ...
def median_absolute_error(
y_true: MatrixLike | ArrayLike,
Expand Down

0 comments on commit b46b33f

Please sign in to comment.