IPython notebookã使ã
æ¥åã§æ±ããã¼ã¿ã¯ãããªã«å¤§ãããªããµã¤ãºã§ããããå°éã«ç¹åããææ³ãªã©ä½¿ããã¨ãå¤ãã®ã§Rã§ååãªããã§ãã
ãã kaggleã¨ãã³ã³ãã®å ´åRã ã¨é£åãããã¨ãå¤ãã®ã§Pythonã使ãã¾ãã
ã§ãæè¿PCãæ°èª¿ããã®ã§ã¤ãã§ã«ç°å¢ãæ°ããã®ã試ããã¨æããAnacondaãå°å
¥ãããã¨ã«ãã¾ããã
Anacondaãå
¥ããã¨ãnumpyã ã®scipyã ã®pandasã ã®matplotlibã ã®IPython notebookã ã®ã¤ãã¦ããã®ã§ã ãããããã§äºè¶³ãã¾ãã
ä¸è¨ããã¤ã³ã¹ãã¼ã©ããã¦ã³ãã¼ããã¦Yes!Yes!Yes!ãªæãã§ç¡äºã¤ã³ã¹ãã¼ã«ã§ãã¾ããã便å©ãªä¸ã®ä¸ã§ãã
https://store.continuum.io/cshop/anaconda/
ä¸å¿rpy2ãå
¥ãã¦ããï¼ä¸è¨åç
§ï¼ã
https://bitbucket.org/lgautier/rpy2/src/cfc769eacc586a46f3b147fb7e1fcde2b4ac57ab/INSTALL_WINDOWS?at=default
ããã§IPython notebookã使ãæºåãã§ãã¾ããã
ãã¥ã¼ããªã¢ã«ï¼æ¥æ¬èªï¼
便å©ãªä¸ã®ä¸ã§ãã
http://life.ess.sci.osaka-u.ac.jp/katsura/ipython_notebook/intro_data_analysis.htm
http://yymm.bitbucket.org/blog/html/2013/10/03/ipython_entrance.html
使ç¨ä¾
å¤é¨ãããã¼ã¿ããèªã¿è¾¼ãã§GBMãå®è¡ããã¾ã§ã試ãã¦ã¿ã¾ããã
https://dl.dropboxusercontent.com/u/956851/gbm_sample.html
ä»åç¨ãããã¼ã¿ã¯ãã¡ãã
Skin Segmentation Data Set
http://archive.ics.uci.edu/ml/datasets/Skin+Segmentation
40%ããã¹ããã¼ã¿ã¨ããä¸ã§RGBå¤ããskin typeãäºæ¸¬ãã¦ãã¾ãã
ã³ã¼ãã¯ä»¥ä¸ã®éãã
import pandas as pd from sklearn.ensemble import GradientBoostingClassifier from sklearn import cross_validation d = pd.read_table('http://archive.ics.uci.edu/ml/machine-learning-databases/00229/Skin_NonSkin.txt', header=None) d.columns = ['r','g','b','skintype'] print(d) X_train, X_test, y_train, y_test = cross_validation.train_test_split(d[['r','g','b']], d['skintype'],test_size=0.4, random_state=0) clf = GradientBoostingClassifier(n_estimators=100, learning_rate=1.0, max_depth=1, random_state=0).fit(X_train, y_train) clf.score(X_test, y_test)
ããããã¼ã¿ã®ä¸èº«ãè¦ããã¨ãã¦printã¨ããã¨è¦åãåºã¾ãããdeprecatedã¨ããªãã¨ãã
ipython notebookã®htmlã¸ã®å¤æ
ãã¡ããåç
§ã®ãã¨ã
http://ipython.org/ipython-doc/rel-1.0.0/interactive/nbconvert.html#converting-notebooks-to-other-formats
FileâDownload asâIPythonã§ãã¦ã³ãã¼ããããã¡ã¤ã«ã«ä¸è¨ã³ãã³ããé©ç¨ãã¦ããã©ã«ãã®ãã©ã¼ãããï¼htmlï¼ã«å¤æã§ãã¾ãã
ipython nbconvert filename.ipynb
ãããIPythonãã°ããè¦ãªãéã«ããã¶ã便å©ã«ãªã£ããªãã