Py之mglearn:python库之mglearn简介、安装、使用方法之详细攻略
Py之mglearn:python库之mglearn简介、安装、使用方法之详细攻略
目录
mglearn简介
1、英文解释
mglearn安装
mglearn使用方法
1、Helper functions for the book "Introduction to Machine Learning with Python"
2、Setup
mglearn简介
mglearn库,该库集成了sklearn和数据的许多操作方法,很便捷,获取对应数据。Helper functions for the book "Introduction to Machine Learning with Python"
GitHub:https://github.com/amueller/mglearn
1、英文解释
This repository holds the code for the forthcoming book "Introduction to Machine Learning with Python" by Andreas Muellerand Sarah Guido. You can find details about the book on the O'Reilly website.
The books requires the current stable version of scikit-learn, that is 0.20.0. Most of the book can also be used with previous versions of scikit-learn, though you need to adjust the import for everything from the model_selection
module, mostly cross_val_score
, train_test_split
and GridSearchCV
.
This repository provides the notebooks from which the book is created, together with the mglearn
library of helper functions to create figures and datasets.
For the curious ones, the cover depicts a hellbender.
All datasets are included in the repository, with the exception of the aclImdb dataset, which you can download from the page of Andrew Maas. See the book for details.
If you get ImportError: No module named mglearn
you can try to install mglearn into your python environment using the command pip install mglearn
in your terminal or !pip install mglearn
in Jupyter Notebook.
mglearn安装
pip install mglearn==0.1.6
mglearn使用方法
1、Helper functions for the book "Introduction to Machine Learning with Python"
This is the mglearn
package used in the book, which you can also find in the accompanying repository
You don't need this repo, all the code is there:
https://github.com/amueller/introduction_to_ml_with_python
This repository is a stand-alone package in case you really feel like you want to install mglearn into your Python environment, for some reason or another. You can install it by running
pip install mglearn
in your terminal, or by running
!pip install mglearn
in Jupyter Notebook.
In particular, installing this package is a very easy way to add it to your Python search path. Or you can just check out the notebooks from the repository above, and add the path to the mglearn subfolder to your PYTHONPATH environment variable (or set it in your IDE).
2、Setup
To run the code, you need the packages numpy
, scipy
, scikit-learn
, matplotlib
, pandas
and pillow
. Some of the visualizations of decision trees and neural networks structures also require graphviz
. The chapter on text processing also requirs nltk
and spacy
.
The easiest way to set up an environment is by installing Anaconda.
Installing packages with conda:
If you already have a Python environment set up, and you are using the conda
package manager, you can get all packages by running
conda install numpy scipy scikit-learn matplotlib pandas pillow graphviz python-graphviz
For the chapter on text processing you also need to install nltk
and spacy
:
conda install nltk spacy
Installing packages with pip
If you already have a Python environment and are using pip to install packages, you need to run
pip install numpy scipy scikit-learn matplotlib pandas pillow graphviz
You also need to install the graphiz C-library, which is easiest using a package manager. If you are using OS X and homebrew, you can brew install graphviz
. If you are on Ubuntu or debian, you can apt-get install graphviz
. Installing graphviz on Windows can be tricky and using conda / anaconda is recommended. For the chapter on text processing you also need to install nltk
and spacy
:
pip install nltk spacy
Downloading English language model
For the text processing chapter, you need to download the English language model for spacy using
python -m spacy download en
Py之mglearn:python库之mglearn简介、安装、使用方法之详细攻略相关推荐
- Python:numpy库中的一些函数简介、使用方法之详细攻略
Python:numpy库中的一些函数简介.使用方法之详细攻略 目录 numpy库中的一些函数简介.使用方法 1.np.concatenate() 1.1.函数案例 1.2.函数用法 numpy库中的 ...
- Py之glob: glob库文件名模式匹配+返回所有匹配的文件路径列表库的简介、使用方法之详细攻略
Py之glob: glob库文件名模式匹配+返回所有匹配的文件路径列表库的简介.使用方法之详细攻略 目录 glob库的简介 glob库的使用方法 1.单个字符通配符:用问号(?)匹配任何单个的字符.
- Python语言学习:Python常用自带库(imageio、pickle)简介、使用方法之详细攻略
Python语言学习:Python常用自带库(imageio.pickle)简介.使用方法之详细攻略 目录 imageio简介及其常见使用方法 pickle简介及其常见使用方法 简介 使用方法 简介及 ...
- Python之 sklearn:sklearn中的RobustScaler 函数的简介及使用方法之详细攻略
Python之 sklearn:sklearn中的RobustScaler 函数的简介及使用方法之详细攻略 目录 sklearn中的RobustScaler 函数的简介及使用方法 sklearn中的R ...
- Python编程语言学习:包导入和模块搜索路径简介、使用方法之详细攻略
Python编程语言学习:包导入和模块搜索路径简介.使用方法之详细攻略 目录 包导入和模块搜索路径简介 1.Pyhon搜索模块路径的机制 2.自定义配置搜索路径
- Python之 sklearn:sklearn.preprocessing中的StandardScaler函数的简介及使用方法之详细攻略
Python之 sklearn:sklearn.preprocessing中的StandardScaler函数的简介及使用方法之详细攻略 目录 sklearn.preprocessing中的Stand ...
- Py之matplotlib.pyplot:matplotlib.pyplot的plt.legend函数的简介、使用方法之详细攻略
Py之matplotlib.pyplot:matplotlib.pyplot的plt.legend函数的简介.使用方法之详细攻略 目录 matplotlib.pyplot的plt.legend函数的简 ...
- Python之 sklearn:sklearn中的train_test_split函数的简介及使用方法之详细攻略
Python之 sklearn:sklearn中的train_test_split函数的简介及使用方法之详细攻略 目录 sklearn中的train_test_split函数的简介 train_tes ...
- sklearn之XGBModel:XGBModel之feature_importances_、plot_importance的简介、使用方法之详细攻略
sklearn之XGBModel:XGBModel之feature_importances_.plot_importance的简介.使用方法之详细攻略 目录 feature_importances_ ...
- ML之sklearn:sklearn.linear_mode中的LogisticRegression函数的简介、使用方法之详细攻略
ML之sklearn:sklearn.linear_mode中的LogisticRegression函数的简介.使用方法之详细攻略 目录 sklearn.linear_mode中的LogisticRe ...
最新文章
- 线程局部存储(很有局限性,但有时候可以用一下)
- python编写篮球_Python编程2——Python实现计算篮球比赛是否领先安全的程序
- [react] 在React中如何引入图片?哪种方式更好?
- java if hasvalue_首选:可为空 .HasValue或Nullable !=空吗?
- java二维数组排序先行后列,数组知识点归纳
- 蓝桥杯第六届省赛JAVA真题----循环节长度
- python AES使用
- win7旗舰恢复出厂设置_iphone12怎么恢复出厂设置 iphone12还原所有设置方法介绍
- xadmin获取mysql_Django2集成xadmin详解-5-获取登录用户信息并填充相应Model字段
- zeal刷新不出来_Zeal——好用的离线 API 文档大全!
- Roson的Qt之旅 #117 QTcpSocket和QUdpSocket详细介绍
- html如何设置自动点击事件,使用javascript给html元素添加click事件
- 台式计算机键盘灯打开方式,台式电脑开机时键盘灯不亮,必须要按一下Numlock才会亮,但系统没什么问题。怎么办?...
- 华硕固件无线打印机服务器设置,华硕路由器远程打印机LPD设置-Windows.pdf
- 高阶多项式合并同类项程序c语言,多项式合并同类项问题
- 米哈游维尔薇vs千劫
- Python File处理方法
- 来源(Provenance)介绍
- 前端学习之HTML——表格
- 网页实现文件打包下载