IPython laptop core gets dead while Kmeans is running

I am running K-value clusters for some 400K cases with 12 variables. Initially, as soon as I launch a cell with Kmeans code, after 2 minutes I get a message that the kernel is interrupted and restarts. And then it takes time, as if the kernel was dead, and the code will no longer work.

So, I tried with observations of 125 thousand and also not. variables. But still the same message as me.

What is meant by this? Does this mean that the ipython laptop is not able to run kmeans on observations at 125 thousand and kills the kernel?

How to solve this? This is very important for me to do today. :(

Please inform.

The code I used:

from sklearn.cluster import KMeans from sklearn.metrics import silhouette_score

    # Initialize the clusterer with n_clusters value and a random generator
    # seed of 10 for reproducibility.
kmeans=KMeans(n_clusters=2,init='k-means++',n_init=10, max_iter=100)
kmeans.fit(Data_sampled.ix[:,1:])
cluster_labels = kmeans.labels_
    # The silhouette_score gives the average value for all the samples.
    # This gives a perspective into the density and separation of the formed
    # clusters
silhouette_avg = silhouette_score(Data_sampled.ix[:,1:],cluster_labels)
+4
1

- , , iPython Notebook/Jupyter. , sklearn, numpy. . github sklearn , numpy .

, , , . , (OSX, 8 ) - - 10 . , ... .. 40 . :

memory pressure

SO- , , , .

, sklearn / numpy. , :

  • , (spotify, slack ..), , , script
  • , , , (, -, , )
  • , . ( , , 20-30 .).

, , sklearn / numpy:)

0

Source: https://habr.com/ru/post/1607347/


All Articles