我是机器学习的新手,我正在查看一些 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 笔记本中的 sklearn 时存在一些问题,但通常答案与 Anaconda Jupyter 笔记本有关,而不是与 Azure 笔记本有关。
我将不胜感激任何解决此问题的提示。