今天可能是写笔记写上瘾了吧。
晚上闲来无事,准备把Mac上面在书上要用的环境搭一下。最近可能是用编辑器用惯了,简直不想用IDE。
书上第一章大概介绍了一些基础知识,有监督和无监督学习以及增强学习。介绍了一下聚类呀分类呀以及evaluating这些。
然后是装环境。
书上是基于Python version >=3.4.3.It is recommended to use Python3. And the book provide a link for difference between 3.4 and 2.7.
https://wiki.python.org/moin/Python2orPython3
But my Mac already has python 2.7 and I dont wanna install another version anymore. So I decide use 2.7 first. I would like install python3 if there are some problems with the version in the future.
sudo easy_install pip;
And here are some package we should install too.
pip install numpy
We need gfortran to compile SciPy but it is not included with the other Xcode tools. Luckily, Homebrew can help us out again:
brew install gfortran
which might updating your homebrew first.
I have an error bellow:
Error: No available formula with the name "gfortran"
GNU Fortran is now provided as part of GCC, and can be installed with:
brew install gcc
but i already got a gcc in my mac.
i’ll try just install scipy first.
that’s done it’s a cinch to install Scipy
pip install scipy
brew install pkg-config
pip install matplotlib
sudo pip install sklearn
sudo pip install pandas
when its all done, the following should work in Python with no errors:
import numpy
import scipy
import matplotlib
import sklearn
import pandas