forked from scikit-learn/scikit-learn
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make cosmetic adjustments, Fix random.py header, use message with ass…
…ert_warns
- Loading branch information
Showing
5 changed files
with
32 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Author: Mathieu Blondel <[email protected]> | ||
# Arnaud Joly <[email protected]> | ||
# Maheshakya Wijewardena<[email protected]> | ||
# Maheshakya Wijewardena <[email protected]> | ||
# License: BSD 3 clause | ||
from __future__ import division | ||
|
||
|
@@ -100,7 +100,7 @@ def fit(self, X, y, sample_weight=None): | |
|
||
if self.strategy == "uniform" and sp.issparse(y): | ||
y = y.toarray() | ||
warnings.warn('A Local copy of the target data has been converted ' | ||
warnings.warn('A local copy of the target data has been converted ' | ||
'to a numpy array. Predicting on sparse target data ' | ||
'with the uniform strategy would not save memory ' | ||
'and would be slower.', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# This file contains a backport of np.random.choice from numpy 1.7 | ||
# The function can be removed when we bump the requirements to >=1.7 | ||
# Author: Hamzeh Alsalhi <[email protected]> | ||
# | ||
# License: BSD 3 clause | ||
from __future__ import division | ||
import numpy as np | ||
import scipy.sparse as sp | ||
|
@@ -13,6 +14,8 @@ | |
__all__ = ['sample_without_replacement', 'choice'] | ||
|
||
|
||
# This is a backport of np.random.choice from numpy 1.7 | ||
# The function can be removed when we bump the requirements to >=1.7 | ||
def choice(a, size=None, replace=True, p=None, random_state=None): | ||
""" | ||
choice(a, size=None, replace=True, p=None) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters