Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions sklearn/neighbors/_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
from ..utils.validation import _deprecate_positional_args


class KNeighborsClassifier(NeighborsBase, KNeighborsMixin,
SupervisedIntegerMixin, ClassifierMixin):
class KNeighborsClassifier(KNeighborsMixin,
SupervisedIntegerMixin,
ClassifierMixin,
NeighborsBase):
"""Classifier implementing the k-nearest neighbors vote.

Read more in the :ref:`User Guide <classification>`.
Expand Down Expand Up @@ -256,8 +258,10 @@ def predict_proba(self, X):
return probabilities


class RadiusNeighborsClassifier(NeighborsBase, RadiusNeighborsMixin,
SupervisedIntegerMixin, ClassifierMixin):
class RadiusNeighborsClassifier(RadiusNeighborsMixin,
SupervisedIntegerMixin,
ClassifierMixin,
NeighborsBase):
"""Classifier implementing a vote among neighbors within a given radius

Read more in the :ref:`User Guide <classification>`.
Expand Down
10 changes: 6 additions & 4 deletions sklearn/neighbors/_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@
from ..utils.validation import _deprecate_positional_args


class KNeighborsRegressor(NeighborsBase, KNeighborsMixin,
class KNeighborsRegressor(KNeighborsMixin,
SupervisedFloatMixin,
RegressorMixin):
RegressorMixin,
NeighborsBase):
"""Regression based on k-nearest neighbors.

The target is predicted by local interpolation of the targets
Expand Down Expand Up @@ -200,9 +201,10 @@ def predict(self, X):
return y_pred


class RadiusNeighborsRegressor(NeighborsBase, RadiusNeighborsMixin,
class RadiusNeighborsRegressor(RadiusNeighborsMixin,
SupervisedFloatMixin,
RegressorMixin):
RegressorMixin,
NeighborsBase):
"""Regression based on neighbors within a fixed radius.

The target is predicted by local interpolation of the targets
Expand Down