日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

Py之mglearn:python库之mglearn简介、安装、使用方法之详细攻略

發布時間:2025/3/21 python 18 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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简介、安装、使用方法之详细攻略的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。