SlideShare una empresa de Scribd logo
1 de 47
Introduction to Machine
Learning
杜岳華
講machine learning之前講講AI好了
• 甚麼是智慧
• 會觀察、了解,並且對於人事物做出反應
• 可以找到最佳的方法
• 能夠推論及規劃
• 能夠學習並調適
Introduction to AI
• 1950: Alan Turing
• Enigma
• Universal calculation machine
• Does machine think?
• Turing test
• 1956年達特矛斯第一屆AI會議
http://cdn.worldscreen.com.tw/uploadfile/201410/movie_014407_11
4559.jpg
Classification of AI
• Strong AI
• 能夠像人類一樣具備心靈
• Weak AI
• 能夠表現出類似人類思考、推論等等智慧的行為
4 school of aspect
Human-like Rational
Thinking
Thinking humanly Thinking rationally
Acting
Acting humanly Acting rationally
Acting humanly
Thinking humanly
Thinking rationally
Acting rationally
Dive into machine learning
• Start from linear model
Introduction to linear regression
𝑌 = 𝑚𝑋 + 𝑏
Find the model
The best fit
Error measurement
( 𝑦 − 𝑦) = ((𝑚𝑥 + 𝑏) − 𝑦)
𝐿 𝑥, 𝑦 = 𝑦 − 𝑦 2 = 𝑚𝑥 + 𝑏 − 𝑦 2
Loss function
𝑚𝑖𝑛 𝑚,𝑏 𝐿 𝑥, 𝑦
= 𝑚𝑖𝑛 𝑚,𝑏 𝑦 − 𝑦 2
= 𝑚𝑖𝑛 𝑚,𝑏 𝑚𝑥 + 𝑏 − 𝑦 2
Gradient descent
There are some components
• Model
• Linear model
• Loss function and formulation
• Least square method
• Optimization algorithm
• Gradient descent method
Multivariate regression
𝑌 = 𝑎0 + 𝑎1 𝑋1 + 𝑎2 𝑋2 + … + 𝑎𝑛𝑋𝑛
Various kind of regressions
• Polynomial regression
• Logistic regression
• Isotonic regression
• Kernel regression
• Lasso regression
• Ridge regression
• SVM (台大林智仁)
Regression problem
• There are several features (𝑋1, 𝑋2, 𝑋3 … 𝑋𝑛)
• There are corresponding continuous labels 𝑌
• Train a model given features to predict the labels
• Supervised learning problem
Machine Learning
• Supervised learning
• Training model with labels
• Unsupervised learning
• Training model with labels
• Semi-supervised learning
• Training model with partial labels
• Reinforced learning
• Online learning
Introduction to models
Continuous label Discrete label
Supervised
Regression Classification
Unsupervised
Density estimation Clustering
Classification
Clustering
Density estimation
Deep learning
Overfitting
Overfitting
Model complexity
Error
Model complexity
In-sample error
Out-sample error
*
VC dimension
Validation
• K-fold cross validation
Training
dataset
Testing
dataset
1/K
Dataset
Learning flow
Dataset
Training
dataset
Testing
dataset
Model Algorithm
Trained
Model
Validation
Complexity
Data size
Features
Dimension
姓名 年齡 地址
王曉明 12 ……
李小狼 13
14
姓名 年齡
地址
王曉明
12李小狼
13
14
What is data science?
Data-driven science
Data science 收集資料 探索資料 假設 實驗 分析
Empirical
research
觀察 假設 收集資料 實驗 分析
Data processing
Knowledge Discovery in Databases, by Fayyad, Piatetsky-Shapiro, and Smyth
• Stage 1: Ask A Question
• Skills: science, domain expertise, curiosity
• Tools: your brain, talking to experts,
experience
• Stage 2: Get the Data
• Skills: web scraping, data cleaning,
querying databases, CS stuff
• Tools: python, pandas
• Stage 3: Explore the Data
• Skills: Get to know data, develop
hypotheses, patterns? anomalies?
• Tools: matplotlib, numpy, scipy, pandas,
mrjob
By Matthew Mayo, KDnuggetshttp://www.kdnuggets.com/2016/03/data-science-process-rediscovered.html
• Stage 4: Model the Data
• Skills: regression, machine learning,
validation, big data
• Tools: scikits learn, pandas, mrjob,
mapreduce
• Stage 5: Communicate the Data
• Skills: presentation, speaking, visuals,
writing
• Tools: matplotlib, adobe illustrator,
powerpoint/keynote
By Matthew Mayo, KDnuggetshttp://www.kdnuggets.com/2016/03/data-science-process-rediscovered.html
Before analysis you should take a look
• Anscombe's quartet, 1973
• r = 0.816
• y = 3.00 + 0.500x
Data science – case study
Data science
陳昇瑋
HIPPO
https://pbs.twimg.com/media/B0W2MYdCcAAsUA4.jpg
Open data
• 其實眾多的資料掌握在大型企業跟政府手上……
• 從人民身上收集到的資料應該要回饋應用在人民自身……
• 開放跟透明的資料跟分析流程,讓資料科學不成為專制……
• 透明的公共政策決策流程
Open data
• Availability and Access / 可得性與可讀性
• 資料必須完整釋出,同時只能依照再製的成本徵收適當的費用。最好能
提供網路下載。同時提供的資料格式必須是適用和可被修改的。
• Re-use and Redistribution / 重新使用與散播
• 資料釋出時必須採用允許資料的重新使用和散播的授權聲明。並允許與
其他資料混合使用。
• Universal Participation/ 分享的普遍性
• 任何人都可使用,重新使用和散佈這些資料 - 不能限制資料使用的範圍,
或是使用者的資格。例如,「非商業使用」將禁止資料在所有「商業性
質」的使用,或是限制資料只能使用在某個範圍內 (例如,只能作為教育
上使用)。這些限制都是不被允許的。
開放資料的格式
Open data台灣第一
• 根據英國開放知識基金會(Open Knowledge Foundation)去年底發表的開放資料評比,
台灣的資料開放指數在全球149個國家中排名第一,勝過英國、丹麥、美國、日本等國家,
也比2014年的第11名和2013年的36名進步許多。
Data Visualization
• 觀賞影片
• https://www.ted.com/talks/hans_rosling_shows_the_best_stats_y
ou_ve_ever_seen?language=zh-tw#t-32354

Más contenido relacionado

Similar a Introduction to machine learning

您也可以成為古火田任三郎~假說思考的力量
您也可以成為古火田任三郎~假說思考的力量您也可以成為古火田任三郎~假說思考的力量
您也可以成為古火田任三郎~假說思考的力量基欽 劉
 
Why is data so important?
Why is data so important?Why is data so important?
Why is data so important?Ye (Julia) Li
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to pythonimetliao
 
20211119 - demystified artificial intelligence with NLP
20211119 - demystified artificial intelligence with NLP20211119 - demystified artificial intelligence with NLP
20211119 - demystified artificial intelligence with NLPJamie (Taka) Wang
 
數位科技工具在自我學習上的運用
數位科技工具在自我學習上的運用數位科技工具在自我學習上的運用
數位科技工具在自我學習上的運用基欽 劉
 
資料如何幫助產品決策
資料如何幫助產品決策資料如何幫助產品決策
資料如何幫助產品決策Soldier Hsieh
 
个人知识管理(网络分享版)20110429
个人知识管理(网络分享版)20110429个人知识管理(网络分享版)20110429
个人知识管理(网络分享版)20110429mrchy
 
renchouduoxuexi
renchouduoxuexirenchouduoxuexi
renchouduoxuexi晓峰 杜
 
大数据时代的"简读"之道
大数据时代的"简读"之道大数据时代的"简读"之道
大数据时代的"简读"之道Guang Chen
 
人类思维与学科史论-计算机第一讲
人类思维与学科史论-计算机第一讲人类思维与学科史论-计算机第一讲
人类思维与学科史论-计算机第一讲WeiningQian
 
Training L1 Thinking 2022702.pptx.pptx
Training L1 Thinking 2022702.pptx.pptxTraining L1 Thinking 2022702.pptx.pptx
Training L1 Thinking 2022702.pptx.pptxssuserb4d806
 
2012居家智慧day2-2(文化探針與脈絡研究)
2012居家智慧day2-2(文化探針與脈絡研究)2012居家智慧day2-2(文化探針與脈絡研究)
2012居家智慧day2-2(文化探針與脈絡研究)Ian Jang
 
机器学习概述
机器学习概述机器学习概述
机器学习概述Dong Guo
 
Design Thinking Notes
Design Thinking NotesDesign Thinking Notes
Design Thinking NotesTsungYi Tsai
 
敏捷需求探索工作坊
敏捷需求探索工作坊敏捷需求探索工作坊
敏捷需求探索工作坊Xudong Yu
 
龍骨王 研究到創業
龍骨王 研究到創業龍骨王 研究到創業
龍骨王 研究到創業Long Good
 
Lab405ML01
Lab405ML01Lab405ML01
Lab405ML01ChenYo2
 
Problem solving
Problem solvingProblem solving
Problem solvingAqua Chen
 
Information search
Information searchInformation search
Information searchmookmur
 
M9910305 research second
M9910305 research secondM9910305 research second
M9910305 research second豊儒 駱
 

Similar a Introduction to machine learning (20)

您也可以成為古火田任三郎~假說思考的力量
您也可以成為古火田任三郎~假說思考的力量您也可以成為古火田任三郎~假說思考的力量
您也可以成為古火田任三郎~假說思考的力量
 
Why is data so important?
Why is data so important?Why is data so important?
Why is data so important?
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
20211119 - demystified artificial intelligence with NLP
20211119 - demystified artificial intelligence with NLP20211119 - demystified artificial intelligence with NLP
20211119 - demystified artificial intelligence with NLP
 
數位科技工具在自我學習上的運用
數位科技工具在自我學習上的運用數位科技工具在自我學習上的運用
數位科技工具在自我學習上的運用
 
資料如何幫助產品決策
資料如何幫助產品決策資料如何幫助產品決策
資料如何幫助產品決策
 
个人知识管理(网络分享版)20110429
个人知识管理(网络分享版)20110429个人知识管理(网络分享版)20110429
个人知识管理(网络分享版)20110429
 
renchouduoxuexi
renchouduoxuexirenchouduoxuexi
renchouduoxuexi
 
大数据时代的"简读"之道
大数据时代的"简读"之道大数据时代的"简读"之道
大数据时代的"简读"之道
 
人类思维与学科史论-计算机第一讲
人类思维与学科史论-计算机第一讲人类思维与学科史论-计算机第一讲
人类思维与学科史论-计算机第一讲
 
Training L1 Thinking 2022702.pptx.pptx
Training L1 Thinking 2022702.pptx.pptxTraining L1 Thinking 2022702.pptx.pptx
Training L1 Thinking 2022702.pptx.pptx
 
2012居家智慧day2-2(文化探針與脈絡研究)
2012居家智慧day2-2(文化探針與脈絡研究)2012居家智慧day2-2(文化探針與脈絡研究)
2012居家智慧day2-2(文化探針與脈絡研究)
 
机器学习概述
机器学习概述机器学习概述
机器学习概述
 
Design Thinking Notes
Design Thinking NotesDesign Thinking Notes
Design Thinking Notes
 
敏捷需求探索工作坊
敏捷需求探索工作坊敏捷需求探索工作坊
敏捷需求探索工作坊
 
龍骨王 研究到創業
龍骨王 研究到創業龍骨王 研究到創業
龍骨王 研究到創業
 
Lab405ML01
Lab405ML01Lab405ML01
Lab405ML01
 
Problem solving
Problem solvingProblem solving
Problem solving
 
Information search
Information searchInformation search
Information search
 
M9910305 research second
M9910305 research secondM9910305 research second
M9910305 research second
 

Más de 岳華 杜

[COSCUP 2023] 我的Julia軟體架構演進之旅
[COSCUP 2023] 我的Julia軟體架構演進之旅[COSCUP 2023] 我的Julia軟體架構演進之旅
[COSCUP 2023] 我的Julia軟體架構演進之旅岳華 杜
 
Julia: The language for future
Julia: The language for futureJulia: The language for future
Julia: The language for future岳華 杜
 
The Language for future-julia
The Language for future-juliaThe Language for future-julia
The Language for future-julia岳華 杜
 
20190907 Julia the language for future
20190907 Julia the language for future20190907 Julia the language for future
20190907 Julia the language for future岳華 杜
 
Metaprogramming in julia
Metaprogramming in juliaMetaprogramming in julia
Metaprogramming in julia岳華 杜
 
Introduction to julia
Introduction to juliaIntroduction to julia
Introduction to julia岳華 杜
 
自然語言處理概覽
自然語言處理概覽自然語言處理概覽
自然語言處理概覽岳華 杜
 
Semantic Segmentation - Fully Convolutional Networks for Semantic Segmentation
Semantic Segmentation - Fully Convolutional Networks for Semantic SegmentationSemantic Segmentation - Fully Convolutional Networks for Semantic Segmentation
Semantic Segmentation - Fully Convolutional Networks for Semantic Segmentation岳華 杜
 
Batch normalization 與他愉快的小伙伴
Batch normalization 與他愉快的小伙伴Batch normalization 與他愉快的小伙伴
Batch normalization 與他愉快的小伙伴岳華 杜
 
從 VAE 走向深度學習新理論
從 VAE 走向深度學習新理論從 VAE 走向深度學習新理論
從 VAE 走向深度學習新理論岳華 杜
 
COSCUP: Foreign Function Call in Julia
COSCUP: Foreign Function Call in JuliaCOSCUP: Foreign Function Call in Julia
COSCUP: Foreign Function Call in Julia岳華 杜
 
COSCUP: Metaprogramming in Julia
COSCUP: Metaprogramming in JuliaCOSCUP: Metaprogramming in Julia
COSCUP: Metaprogramming in Julia岳華 杜
 
COSCUP: Introduction to Julia
COSCUP: Introduction to JuliaCOSCUP: Introduction to Julia
COSCUP: Introduction to Julia岳華 杜
 
Introduction to Julia
Introduction to JuliaIntroduction to Julia
Introduction to Julia岳華 杜
 
20171127 當julia遇上資料科學
20171127 當julia遇上資料科學20171127 當julia遇上資料科學
20171127 當julia遇上資料科學岳華 杜
 
20171117 oop and design patterns in julia
20171117 oop and design patterns in julia20171117 oop and design patterns in julia
20171117 oop and design patterns in julia岳華 杜
 
20171014 tips for manipulating filesystem in julia
20171014 tips for manipulating filesystem in julia20171014 tips for manipulating filesystem in julia
20171014 tips for manipulating filesystem in julia岳華 杜
 
20170807 julia的簡單而高效資料處理
20170807 julia的簡單而高效資料處理20170807 julia的簡單而高效資料處理
20170807 julia的簡單而高效資料處理岳華 杜
 
20170715 北Bio meetup
20170715 北Bio meetup20170715 北Bio meetup
20170715 北Bio meetup岳華 杜
 
20170714 concurrency in julia
20170714 concurrency in julia20170714 concurrency in julia
20170714 concurrency in julia岳華 杜
 

Más de 岳華 杜 (20)

[COSCUP 2023] 我的Julia軟體架構演進之旅
[COSCUP 2023] 我的Julia軟體架構演進之旅[COSCUP 2023] 我的Julia軟體架構演進之旅
[COSCUP 2023] 我的Julia軟體架構演進之旅
 
Julia: The language for future
Julia: The language for futureJulia: The language for future
Julia: The language for future
 
The Language for future-julia
The Language for future-juliaThe Language for future-julia
The Language for future-julia
 
20190907 Julia the language for future
20190907 Julia the language for future20190907 Julia the language for future
20190907 Julia the language for future
 
Metaprogramming in julia
Metaprogramming in juliaMetaprogramming in julia
Metaprogramming in julia
 
Introduction to julia
Introduction to juliaIntroduction to julia
Introduction to julia
 
自然語言處理概覽
自然語言處理概覽自然語言處理概覽
自然語言處理概覽
 
Semantic Segmentation - Fully Convolutional Networks for Semantic Segmentation
Semantic Segmentation - Fully Convolutional Networks for Semantic SegmentationSemantic Segmentation - Fully Convolutional Networks for Semantic Segmentation
Semantic Segmentation - Fully Convolutional Networks for Semantic Segmentation
 
Batch normalization 與他愉快的小伙伴
Batch normalization 與他愉快的小伙伴Batch normalization 與他愉快的小伙伴
Batch normalization 與他愉快的小伙伴
 
從 VAE 走向深度學習新理論
從 VAE 走向深度學習新理論從 VAE 走向深度學習新理論
從 VAE 走向深度學習新理論
 
COSCUP: Foreign Function Call in Julia
COSCUP: Foreign Function Call in JuliaCOSCUP: Foreign Function Call in Julia
COSCUP: Foreign Function Call in Julia
 
COSCUP: Metaprogramming in Julia
COSCUP: Metaprogramming in JuliaCOSCUP: Metaprogramming in Julia
COSCUP: Metaprogramming in Julia
 
COSCUP: Introduction to Julia
COSCUP: Introduction to JuliaCOSCUP: Introduction to Julia
COSCUP: Introduction to Julia
 
Introduction to Julia
Introduction to JuliaIntroduction to Julia
Introduction to Julia
 
20171127 當julia遇上資料科學
20171127 當julia遇上資料科學20171127 當julia遇上資料科學
20171127 當julia遇上資料科學
 
20171117 oop and design patterns in julia
20171117 oop and design patterns in julia20171117 oop and design patterns in julia
20171117 oop and design patterns in julia
 
20171014 tips for manipulating filesystem in julia
20171014 tips for manipulating filesystem in julia20171014 tips for manipulating filesystem in julia
20171014 tips for manipulating filesystem in julia
 
20170807 julia的簡單而高效資料處理
20170807 julia的簡單而高效資料處理20170807 julia的簡單而高效資料處理
20170807 julia的簡單而高效資料處理
 
20170715 北Bio meetup
20170715 北Bio meetup20170715 北Bio meetup
20170715 北Bio meetup
 
20170714 concurrency in julia
20170714 concurrency in julia20170714 concurrency in julia
20170714 concurrency in julia
 

Introduction to machine learning