
您具有1个特征的许多样本,因此可以使用numpy的reshape将数组重塑为(13,876,1):
from sklearn.cluster import KMeansimport numpy as npx = np.random.random(13876)km = KMeans()km.fit(x.reshape(-1,1)) # -1 will be calculated to be 13876 here
欢迎分享,转载请注明来源:内存溢出

您具有1个特征的许多样本,因此可以使用numpy的reshape将数组重塑为(13,876,1):
from sklearn.cluster import KMeansimport numpy as npx = np.random.random(13876)km = KMeans()km.fit(x.reshape(-1,1)) # -1 will be calculated to be 13876 here
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)