sklearn.neighbors 安装
时间: 2023-09-25 20:06:56 浏览: 300
Python 机器学习工具包SKlearn的安装与使用
5星 · 资源好评率100%
安装sklearn.neighbors需要按照以下步骤进行操作:
1. 确保你安装了符合要求的Python版本(2.7或3.3以上)、NumPy(1.8.2以上)和SciPy(0.13.3以上)。如果你已经安装了NumPy和SciPy,可以使用以下命令来安装scikit-learn:
```
pip install -U scikit-learn
```
2. 如果你想安装0.22.1之前的版本,可以按照以下步骤进行操作:
- 安装指定版本的scikit-learn,例如0.22.0:
```
pip install scikit-learn==0.22.0
```
- 在你的代码中添加以下代码来解决sklearn.neighbors.base的问题:
```
import sklearn.neighbors._base
import sys
sys.modules['sklearn.neighbors.base'] = sklearn.neighbors._base
```
这样,你就可以成功安装sklearn.neighbors了。请根据你的具体需求选择合适的安装方法和版本。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [ModuleNotFoundError: No module named ‘sklearn.neighbors.base](https://blog.csdn.net/wenhaochu321/article/details/117080231)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [Python之Sklearn使用教程](https://blog.csdn.net/qq_36182852/article/details/106614328)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文