pythonとrによるデータ分析環境の構築と機械学習によるデータ認識

Download PythonとRによるデータ分析環境の構築と機械学習によるデータ認識

If you can't read please download the document

Upload: katsuhiro-morishita

Post on 18-Jun-2015

5.280 views

Category:

Data & Analytics


11 download

DESCRIPTION

2014-09-03開催の熊本高専 高専カフェで紹介する、PythonとRを使ったデータ分析環境の解説です。

TRANSCRIPT

  • 1. PythonR2014/9/3Katushiro MORISHITA1

2. PythonR Python Python or R or 2 3. Index Python Python R 3 4. /4 5. etc.xnetc.Deep Learning*GByte5 6. Python6 7. Python 37 8. PythonHello World8 9. Python 29 10. = + - * / **, a = 20 ** 2 # 400 %10 11. int11 12. 12 13. C13 14. OK 14 15. C#PHP15 16. 16 17. Pythonif17 18. Pythonfor 1018 19. Python19 20. Python20 21. Python GPSephemerisgps.ephemeris21 22. 22 23. 23 24. 24 OK 25. 25 26. Python 26 27. os sys datetime re27 28. 28 29. 29 30. Python OS 30 31. 31 32. Why?oo32 33. Python 10 1C++33 34. Python PyCUDAGPUo o o + GIS34 35. CPython35 36. Python36 37. Python Pythono http://www.python.jp/ o https://pypi.python.org/pypi Windowso http://www.lfd.uci.edu/~gohlke/pythonlibs/ WindowsPyscriptero https://code.google.com/p/pyscripter/ *2014-08-28pyscripterPython 3.3.x37 38. IPython+Notebook oOSo38OK 39. oopipo39Python3Windows 40. https://www.python.org/downloads/release/python-341/ @2014-08-2840OS1& 41. pip http://www.lfd.uci.edu/~gohlke/pythonlibs/#pip41for 64 bitfor 32 bitpyX.YPython 42. 3 http://www.lfd.uci.edu/~gohlke/pythonlibs/ oNumPyoSciPyomatplotlib42 43. http://www.lfd.uci.edu/~gohlke/pythonlibs/ scikit-learn Pandas43 44. matplotlib *http://matplotlib.org/gallery.html 44 45. scikit-learn 45*http://scikit-learn.org/stable/auto_examples/plot_classifier_comparison.html**http://www.slideshare.net/moa108/20130715-lt-scikitlearn 46. Python opython install setup.py46 47. C o Pythonbito MinGW + msys Visual Studio 2010/2012/2013 Express/pro CMake python install setup.pyo o pip install lib_name 47 48. PYTHONPATHo PATHo C:python34o C:python34Scriptso C:python34Libsite-packages*pythonXYXYPython48 49. Anaconda http://continuum.io/downloads#271st, OS3rd, 2nd, AnacondaOpenCV49 50. http://www.sublimetext.com/350 51. opython Vopython51 52. MacLinuxo http://www.slideshare.net/katsuhiromorishita/python201452 53. 53Python 54. R54 55. R Excel55 56. R OS RGUIWEB56 57. R wikiohttp://www.okada.jp.org/RWiki/57 58. R58 59. ()59 60. GUI RRcmdr EZREZR 60 61. EZR ohttp://www.jichi.ac.jp/saitama-sct/SaitamaHP.files/statmed.html61 62. R http://www.cwk.zaq.ne.jp/fkhud708/files/R-intro/R-stat-intro_99.pdf62 63. R for Windowso http://cran.md.tsukuba.ac.jp/bin/windows/base/ for Mac OS Xo http://cran.md.tsukuba.ac.jp/bin/macosx/ Linuxo http://www.okada.jp.org/RWiki/?R%20%A4%CE%A5%A4%A5%F3%A5%B9%A5%C8%A1%BC%A5%EB#if8c08b463 64. Rcmdr/EZR GUI200 MByte o 64 65. 65 66. ohttp://home.a00.itscom.net/hatada/ml/data/iris01.htmlohttp://d.hatena.ne.jp/tsutatsutatsuta/20121206/135473746166 67. 67http://pds.exblog.jp/pds/1/200609/01/07/b0077607_17371584.jpg 68. 68 69. 69 70. EZR 70 71. Python oo scikit-learn 71 72. Python script*Pandascsv72 73. 73#!usr/bin/python3import pandasfrom sklearn.ensemble import RandomForestClassifierdata = pandas.read_csv("iris2.csv")#print(data)trainFeature = (data.iloc[:, 0:4]).values # transform to ndarraytrainLabel = (data.iloc[:, 4:5]).valuestrainLabel = [flatten for inner in trainLabel for flatten in inner] # transform 2to 1clf = RandomForestClassifier()clf.fit(trainFeature, trainLabel)result = clf.score(trainFeature, trainLabel) # print(result)print(clf.feature_importances_) # 74. 74* 75. 75 76. Python Python R o o http://www.slideshare.net/hamadakoichi/randomforest-web?related=176 77. 77 78. 78Git 79. 79 80. Git WindowsMacoSourceTreeohttp://www.sourcetreeapp.com/80 81. Git81 82. SourceTree82*http://blog.sourcetreeapp.com/files/2013/02/sourcetree-on-windows-large.png 83. 83 84. GitHub https://github.com/ Gitwiki http://www.mocchiblog.com/ 84 85. GitHub RTKLIBohttps://github.com/tomojitakasu/RTKLIBoGNSS o1o85 86. 86 87. Fin.87 88. 88 89. PythonPython 3D Java VM .NET89 90. Python OK pip90 91. Python Python oMacpyenvoWindowsvirtualenvoPython91 92. PythonWindows Python Python 3.3.5Visual Studio 2010Visual Studio 2012 PythonmsysVisual Studio92 93. Python Python23 23o2to3.py Python 3 293 94. RR Studio http://www.rstudio.com/94 95. StatWorksGUI o1095 96. Q&A QC#Python APython QPython ALightweight Language(LL)LL2 Q AC#1096 97. Amazon Web ServiceAWSHadoopAmazon Elastic MapReduceAmazon EMRo 1o AWS30 97 98. AMI 98 99. o 99 100. oScala, go, swift C/C++1 100