At the CROSS 2015 python session the other day, I thought that machine learning would be interesting, so I tried to prepare the environment for the time being, so I'm sorry.
The other day's article on CROSS 2015 is here.
--Building an environment where machine learning can be done with python ――I haven't done much, so I thought it was necessary to give it to Qiita, but I personally got into various things, so I will give it to you.
$ brew update $ brew upgrade $ brew install python
For the time being, check the version
$ python -V Python 2.7.5
pip
$ pip install --upgrade setuptools $ pip install --upgrade pip
Set the path in .bash_profile. I forgot. .. If you don't do this, you will get the following error when importing scikit-learn.
ImportError: No module named sklearn
So add the path to .bash_profile.
export PATH=/usr/local/bin:$PATH export PATH=/usr/local/share/python:$PATH
Update after adding the above to .bash_profile.
source ~/.bash_profile
--Install various math libraries
$ pip install numpy $ pip install scipy $ pip install matplotlib $ pip install scikit-learn $ pip install pandas $ pip install pydot $ pip install rpy2 $ pip install ipython $ pip install pyzmq $ pip install tornado $ pip install jinja2
I ran into the following error when installing rpy2.
$ pip install rpy2 Collecting rpy2 Using cached rpy2-2.5.5.tar.gz Error: Tried to guess R's HOME but no R command in the PATH. Complete output from command python setup.py egg_info: Error: Tried to guess R's HOME but no R command in the PATH. ---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/jl/h7wk98516f1_tj7zg87r08b00000gn/T/pip-build-Cs7fDa/rpy2
You don't have R installed. .. That's right. .. Refer to the following for how to install R on MacOSX. Thank you. Thank you. Install R with homebrew on MacOSX I was quite addicted to it. ..
――I feel like I somehow understand why python is attracting attention in machine learning. ――Because there are abundant libraries in mathematics, engineering, and statistics? ――Is there so much Ruby? I can't say anything because I haven't investigated it properly. .. --It's great to be able to call R-related libraries with rpy2 and pandas ――Is it a feature of Python that there are Scipy and scikit-learn? --This completes the environment for boxplots, histograms, regression analysis, cluster analysis, etc. ――By the way, I remembered that I was doing statistical things when I was a student, and I felt a little nostalgic. .. .. ――If you have a good library other than the above, please let me know. ――After all, I think it wasn't enough to give to Qiita. ..
-I put ipython in Mavericks -Install R with homebrew on MacOSX