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










share|improve this question


























    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










    share|improve this question
























      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










      share|improve this question













      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 11 at 7:44









      Creator -3000

      198




      198
























          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





          share|improve this answer





















          • Nope, that didn't help me
            – Creator -3000
            Nov 11 at 9:02











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          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

























          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





          share|improve this answer





















          • Nope, that didn't help me
            – Creator -3000
            Nov 11 at 9:02















          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





          share|improve this answer





















          • Nope, that didn't help me
            – Creator -3000
            Nov 11 at 9:02













          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





          share|improve this answer












          Use the following to import make_blobs that will not give you any warning.



          from sklearn.datasets import make_blobs






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 11 at 8:27









          ask

          727




          727












          • 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




          Nope, that didn't help me
          – Creator -3000
          Nov 11 at 9:02


















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          Xamarin.iOS Cant Deploy on Iphone

          Glorious Revolution

          Dulmage-Mendelsohn matrix decomposition in Python