Python报错:TypeError: __init__() got an unexpected keyword argument ‘n_jobs‘
Python报错:TypeError: __init__() got an unexpected keyword argument 'n_jobs'
·
Python报错:TypeError: init() got an unexpected keyword argument ‘n_jobs’
错误原因:sklearn0.24的KMeans函数已经弃用参数n_jobs
解决方法一:降低sklearn版本为0.23以下
conda install scikit-learn==0.19.1
或者在用sklearn新版时改函数传递参数,新版的kmeans使用及参数为:
sklearn.cluster.KMeans(n_clusters=8, *, init='k-means++', n_init=10, max_iter=300, tol=0.0001, verbose=0, random_state=None, copy_x=True, algorithm='auto')
更多推荐
已为社区贡献5条内容
所有评论(0)