【发布时间】:2020-04-28 04:01:14
【问题描述】:
我是机器学习的新手,我正在查看一些 Scikit-Learn 文档。 我在 Microsoft Azure 上使用帐户 https://notebooks.azure.com/。
现在我正在尝试运行此示例的代码:
https://scikit-learn.org/stable/auto_examples/cluster/plot_agglomerative_dendrogram.html.
我得到以下错误
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-23-fc0d954d99ec> in <module>
44
45 # setting distance_threshold=0 ensures we compute the full tree.
---> 46 model = AgglomerativeClustering(distance_threshold=0, n_clusters=None)
47
48 model = model.fit(X)
TypeError: __init__() got an unexpected keyword argument 'distance_threshold'
我进行了搜索,问题是我有 sklearn '0.20.3' 版本,为了运行该代码,我需要 0.22 版本。 我一直在尝试用
更新 sklearn!pip install --update sklearn
并得到这个结果:
Usage:
pip install [options] <requirement specifier> [package-index-options] ...
pip install [options] -r <requirements file> [package-index-options] ...
pip install [options] [-e] <vcs project url> ...
pip install [options] [-e] <local project path> ...
pip install [options] <archive url/path> ...
no such option: --update
在网上搜索,似乎在尝试更新 jupyter notebook 中的 sklearn 时出现了一些问题,但通常答案与 Anaconda Jupyter notebooks 相关,而不是与 Azure notebooks 相关。
我将不胜感激任何解决此问题的提示。
【问题讨论】:
标签: python azure scikit-learn jupyter-notebook