ipython notebook clusters_IPython Notebook Kernel在运行Kmeans时死机

我在12个变量的400K观测值上运行K-means聚类.最初,当我使用Kmeans代码运行单元格时,它会在2分钟后弹出一条消息,说内核被中断并将重新启动.然后需要很长时间,好像内核已经死了,代码将不再运行.

所以我尝试了125k观察,同样没有.变量.但仍然是我得到的同样的信息.

这是什么意思?这是否意味着ipython笔记本无法在125k观察中运行kmeans并杀死内核?

怎么解决这个?这对我来说非常重要. 🙁

请指教.

我使用的代码:

来自sklearn.cluster导入KMeans

来自sklearn.metrics导入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)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值