Import make_blobs from scikit-learn
up vote
0
down vote
favorite
I am getting next Warning:
D:ProgrammingPythonMLvenvlibsite-packagessklearnutilsdeprecation.py:77: DeprecationWarning: Function make_blobs is deprecated; Please import make_blobs directly from scikit-learn
warnings.warn(msg, category=DeprecationWarning)
even with this
from sklearn.datasets.samples_generator import make_blobs
And my simple code
# generate dataset
X, y = mglearn.datasets.make_forge()
# plot dataset
mglearn.discrete_scatter(X[:, 0], X[:, 1], y)
plt.legend(["Class 0", "Class 1"], loc=4)
plt.xlabel("First feature")
plt.ylabel("Second feature")
print("X.shape: {}".format(X.shape))
plt.show()
Function make_forge()
def make_forge():
# a carefully hand-designed dataset lol
X, y = make_blobs(centers=2, random_state=4, n_samples=30)
y[np.array([7, 27])] = 0
mask = np.ones(len(X), dtype=np.bool)
mask[np.array([0, 1, 5, 26])] = 0
X, y = X[mask], y[mask]
return X, y
Well, in make_blobs.py
I found next thing
@deprecated("Please import make_blobs directly from scikit-learn")
def make_blobs(n_samples=100, n_features=2, centers=2, cluster_std=1.0,
center_box=(-10.0, 10.0), shuffle=True, random_state=None):
Yes, I know that my code will succesfully compile even with this warning but I want to know why I`m getting this and why this is deprecated. Thanks for help
python scikit-learn
add a comment |
up vote
0
down vote
favorite
I am getting next Warning:
D:ProgrammingPythonMLvenvlibsite-packagessklearnutilsdeprecation.py:77: DeprecationWarning: Function make_blobs is deprecated; Please import make_blobs directly from scikit-learn
warnings.warn(msg, category=DeprecationWarning)
even with this
from sklearn.datasets.samples_generator import make_blobs
And my simple code
# generate dataset
X, y = mglearn.datasets.make_forge()
# plot dataset
mglearn.discrete_scatter(X[:, 0], X[:, 1], y)
plt.legend(["Class 0", "Class 1"], loc=4)
plt.xlabel("First feature")
plt.ylabel("Second feature")
print("X.shape: {}".format(X.shape))
plt.show()
Function make_forge()
def make_forge():
# a carefully hand-designed dataset lol
X, y = make_blobs(centers=2, random_state=4, n_samples=30)
y[np.array([7, 27])] = 0
mask = np.ones(len(X), dtype=np.bool)
mask[np.array([0, 1, 5, 26])] = 0
X, y = X[mask], y[mask]
return X, y
Well, in make_blobs.py
I found next thing
@deprecated("Please import make_blobs directly from scikit-learn")
def make_blobs(n_samples=100, n_features=2, centers=2, cluster_std=1.0,
center_box=(-10.0, 10.0), shuffle=True, random_state=None):
Yes, I know that my code will succesfully compile even with this warning but I want to know why I`m getting this and why this is deprecated. Thanks for help
python scikit-learn
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am getting next Warning:
D:ProgrammingPythonMLvenvlibsite-packagessklearnutilsdeprecation.py:77: DeprecationWarning: Function make_blobs is deprecated; Please import make_blobs directly from scikit-learn
warnings.warn(msg, category=DeprecationWarning)
even with this
from sklearn.datasets.samples_generator import make_blobs
And my simple code
# generate dataset
X, y = mglearn.datasets.make_forge()
# plot dataset
mglearn.discrete_scatter(X[:, 0], X[:, 1], y)
plt.legend(["Class 0", "Class 1"], loc=4)
plt.xlabel("First feature")
plt.ylabel("Second feature")
print("X.shape: {}".format(X.shape))
plt.show()
Function make_forge()
def make_forge():
# a carefully hand-designed dataset lol
X, y = make_blobs(centers=2, random_state=4, n_samples=30)
y[np.array([7, 27])] = 0
mask = np.ones(len(X), dtype=np.bool)
mask[np.array([0, 1, 5, 26])] = 0
X, y = X[mask], y[mask]
return X, y
Well, in make_blobs.py
I found next thing
@deprecated("Please import make_blobs directly from scikit-learn")
def make_blobs(n_samples=100, n_features=2, centers=2, cluster_std=1.0,
center_box=(-10.0, 10.0), shuffle=True, random_state=None):
Yes, I know that my code will succesfully compile even with this warning but I want to know why I`m getting this and why this is deprecated. Thanks for help
python scikit-learn
I am getting next Warning:
D:ProgrammingPythonMLvenvlibsite-packagessklearnutilsdeprecation.py:77: DeprecationWarning: Function make_blobs is deprecated; Please import make_blobs directly from scikit-learn
warnings.warn(msg, category=DeprecationWarning)
even with this
from sklearn.datasets.samples_generator import make_blobs
And my simple code
# generate dataset
X, y = mglearn.datasets.make_forge()
# plot dataset
mglearn.discrete_scatter(X[:, 0], X[:, 1], y)
plt.legend(["Class 0", "Class 1"], loc=4)
plt.xlabel("First feature")
plt.ylabel("Second feature")
print("X.shape: {}".format(X.shape))
plt.show()
Function make_forge()
def make_forge():
# a carefully hand-designed dataset lol
X, y = make_blobs(centers=2, random_state=4, n_samples=30)
y[np.array([7, 27])] = 0
mask = np.ones(len(X), dtype=np.bool)
mask[np.array([0, 1, 5, 26])] = 0
X, y = X[mask], y[mask]
return X, y
Well, in make_blobs.py
I found next thing
@deprecated("Please import make_blobs directly from scikit-learn")
def make_blobs(n_samples=100, n_features=2, centers=2, cluster_std=1.0,
center_box=(-10.0, 10.0), shuffle=True, random_state=None):
Yes, I know that my code will succesfully compile even with this warning but I want to know why I`m getting this and why this is deprecated. Thanks for help
python scikit-learn
python scikit-learn
asked Nov 11 at 7:44
Creator -3000
198
198
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Use the following to import make_blobs
that will not give you any warning.
from sklearn.datasets import make_blobs
Nope, that didn't help me
– Creator -3000
Nov 11 at 9:02
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Use the following to import make_blobs
that will not give you any warning.
from sklearn.datasets import make_blobs
Nope, that didn't help me
– Creator -3000
Nov 11 at 9:02
add a comment |
up vote
0
down vote
Use the following to import make_blobs
that will not give you any warning.
from sklearn.datasets import make_blobs
Nope, that didn't help me
– Creator -3000
Nov 11 at 9:02
add a comment |
up vote
0
down vote
up vote
0
down vote
Use the following to import make_blobs
that will not give you any warning.
from sklearn.datasets import make_blobs
Use the following to import make_blobs
that will not give you any warning.
from sklearn.datasets import make_blobs
answered Nov 11 at 8:27
ask
727
727
Nope, that didn't help me
– Creator -3000
Nov 11 at 9:02
add a comment |
Nope, that didn't help me
– Creator -3000
Nov 11 at 9:02
Nope, that didn't help me
– Creator -3000
Nov 11 at 9:02
Nope, that didn't help me
– Creator -3000
Nov 11 at 9:02
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53246784%2fimport-make-blobs-from-scikit-learn%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown