Introduction to Machine Learning机器学习分享导论.pdf

Introduction to Machine Learning机器学习分享导论.pdf

ID:51437424

大小:250.15 KB

页数:37页

时间:2020-03-24

Introduction to Machine Learning机器学习分享导论.pdf_第1页
Introduction to Machine Learning机器学习分享导论.pdf_第2页
Introduction to Machine Learning机器学习分享导论.pdf_第3页
Introduction to Machine Learning机器学习分享导论.pdf_第4页
Introduction to Machine Learning机器学习分享导论.pdf_第5页
资源描述:

《Introduction to Machine Learning机器学习分享导论.pdf》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、IntroductiontoMachineLearningUsefultools:Python,NumPy,scikit-learnAntonioSuteraandJean-MichelBegonSeptember29,20162/37HowtoinstallPython?DownloadandusetheAnacondapythondistributionhttps://store.continuum.io/cshop/anaconda/.Itcomeswithallthescientificpy

2、thonstack.Alternatives:linuxpackages,pythonxy,canopy,...3/37UsingthepythoninterpreterInteractivemode1.Startapythonshell$ipython2.Writepythoncode>>>print("HelloWorld!")HelloWorld!Scriptmode1.hello.pyprint("HelloWorld!")2.Launchthescript$ipythonhello.py

3、Helloworld!4/37BasictypesInteger>>>55>>>a=5>>>a5Float>>>pi=3.14complex>>>c=1-1jboolean>>>b=5>3#5<=3>>>bTrue#Falsestring>>>s=’hello!’#Alsoworkswith"hello!">>>s’hello!’5/37PythonisadynamicprogramlanguageVariabletypesareimplicitlyinferredduringtheassignm

4、ent.Variablesarenotdeclared.>>>#Inpython>>>a=1Bycontrastinstaticallytypedlanguage,youmustdeclaredthetype.//Injava,c,c++inta=16/37Numbersandtheirarithmeticoperations(+,-,/,//,*,**,%)>>>1+23>>>50-5*620>>>2/3#withpy30.66...0>>>2./3#floatdivisioninpy2andp

5、y30.6666666666666666>>>4//3#Integerdivisionwithpy2andpy31>>>5**3.5#exponent279.5084971874737>>>4%2#modulooperation07/37Playingwithstrings>>>s=’Greatday!’>>>s’Greatday!’>>>s[0]#stringsaresequences’G’>>>"""Averyverylongstring"""’Averyverylongstring’

6、>>>’i={0}f={2}s={1}’.format(1,’test’,3.14)’i=1f=3.14s=test’8/37list,anorderedcollectionofobjectsInstantiation>>>l=[]#anemptylist>>>l=[’spam’,’egg’,[’anotherlist’],42]Indexing>>>l[1]’egg’>>>l[-1]#n_elements-142>>>l[1:2]#aslice["egg",[’anotherlist’]]Met

7、hods>>>len(l)4>>>l.pop(0)’spam’>>>l.append(3)>>>l[’egg’,[’anotherlist’],42,3]9/37dict,anunorderedandassociativedatastructureofkey-valuepairsInstantiation>>>d={1:"a","b":2,0:[4,5,6]}>>>d{0:[4,5,6],1:’a’,’b’:2}Indexing>>>d[’b’]2>>>’b’indTrueInsertion>>>

8、d[’new’]=56>>>d{0:[4,5,6],1:’a’,’b’:2,’new’:56}Deletion>>>deld[’new’]>>>d{0:[4,5,6],1:’a’,’b’:2}10/37dict,anunorderedandassociativedatastructureofkey-valuepairsMethods>>>len(d)3>>>d.keys()[0,1,’b’]>>>d.values()[[4,5,6],’a’,2]11/37Controlflow:if

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。