|
13 | 13 |
|
14 | 14 | import numpy as np |
15 | 15 |
|
16 | | -from . import __version__ |
17 | | -from ._config import config_context, get_config |
18 | | -from .exceptions import InconsistentVersionWarning |
19 | | -from .utils._metadata_requests import _MetadataRequester, _routing_enabled |
20 | | -from .utils._missing import is_scalar_nan |
21 | | -from .utils._param_validation import validate_parameter_constraints |
22 | | -from .utils._repr_html.base import ReprHTMLMixin, _HTMLDocumentationLinkMixin |
23 | | -from .utils._repr_html.estimator import estimator_html_repr |
24 | | -from .utils._repr_html.params import ParamsDict |
25 | | -from .utils._set_output import _SetOutputMixin |
26 | | -from .utils._tags import ( |
| 16 | +from sklearn import __version__ |
| 17 | +from sklearn._config import config_context, get_config |
| 18 | +from sklearn.exceptions import InconsistentVersionWarning |
| 19 | +from sklearn.utils._metadata_requests import _MetadataRequester, _routing_enabled |
| 20 | +from sklearn.utils._missing import is_scalar_nan |
| 21 | +from sklearn.utils._param_validation import validate_parameter_constraints |
| 22 | +from sklearn.utils._repr_html.base import ReprHTMLMixin, _HTMLDocumentationLinkMixin |
| 23 | +from sklearn.utils._repr_html.estimator import estimator_html_repr |
| 24 | +from sklearn.utils._repr_html.params import ParamsDict |
| 25 | +from sklearn.utils._set_output import _SetOutputMixin |
| 26 | +from sklearn.utils._tags import ( |
27 | 27 | ClassifierTags, |
28 | 28 | RegressorTags, |
29 | 29 | Tags, |
30 | 30 | TargetTags, |
31 | 31 | TransformerTags, |
32 | 32 | get_tags, |
33 | 33 | ) |
34 | | -from .utils.fixes import _IS_32BIT |
35 | | -from .utils.validation import ( |
| 34 | +from sklearn.utils.fixes import _IS_32BIT |
| 35 | +from sklearn.utils.validation import ( |
36 | 36 | _check_feature_names_in, |
37 | 37 | _generate_get_feature_names_out, |
38 | 38 | _is_fitted, |
@@ -366,7 +366,7 @@ def __repr__(self, N_CHAR_MAX=700): |
366 | 366 | # characters to render. We pass it as an optional parameter to ease |
367 | 367 | # the tests. |
368 | 368 |
|
369 | | - from .utils._pprint import _EstimatorPrettyPrinter |
| 369 | + from sklearn.utils._pprint import _EstimatorPrettyPrinter |
370 | 370 |
|
371 | 371 | N_MAX_ELEMENTS_TO_SHOW = 30 # number of elements to show in sequences |
372 | 372 |
|
@@ -543,7 +543,7 @@ def score(self, X, y, sample_weight=None): |
543 | 543 | score : float |
544 | 544 | Mean accuracy of ``self.predict(X)`` w.r.t. `y`. |
545 | 545 | """ |
546 | | - from .metrics import accuracy_score |
| 546 | + from sklearn.metrics import accuracy_score |
547 | 547 |
|
548 | 548 | return accuracy_score(y, self.predict(X), sample_weight=sample_weight) |
549 | 549 |
|
@@ -633,7 +633,7 @@ def score(self, X, y, sample_weight=None): |
633 | 633 | :class:`~sklearn.multioutput.MultiOutputRegressor`). |
634 | 634 | """ |
635 | 635 |
|
636 | | - from .metrics import r2_score |
| 636 | + from sklearn.metrics import r2_score |
637 | 637 |
|
638 | 638 | y_pred = self.predict(X) |
639 | 639 | return r2_score(y, y_pred, sample_weight=sample_weight) |
|
0 commit comments