SlideShare a Scribd company logo
MACHINE
LEARNING WITH
ACCORD
FRAMEWORK
A N D R I U S D A P Š E V I Č I U S
Machine Learning
MACHINE LEARNING
• Decision tree
• Artificial neural networks
• Clustering
• Association rule discovery
• Genetic algorithms
• etc...
MACHINE LEARNING
• Decision tree
• Artificial neural networks
• Clustering
• Association rule discovery
• Genetic algorithms
• etc...
MACHINE LEARNING
• Decision tree
• Artificial neural networks
• Clustering
ACCORD FRAMEWORK
•Machine learning made in a minute
• GNU LGPL
• Entirely C#
• Runs on ONE machine
DECISION TREE
𝑥 ∙ 𝑦
𝑥 ∙ 𝑦 = 0
𝑥 ∙ 𝑦 = 0
𝑥 ∙ 𝑦 = 1
CAN WE PLAY TENNIS
Outlook Temperature Humidity Wind PlayTennis
Sunny Hot High Weak No
Sunny Hot High Strong No
Overcast Hot High Weak Yes
Rain Mild High Weak Yes
Rain Cool Normal Weak Yes
Rain Cool Normal Strong No
Overcast Cool Normal Strong Yes
Sunny Mild High Weak No
Sunny Cool Normal Weak Yes
Rain Mild Normal Weak Yes
Sunny Mild Normal Strong Yes
Overcast Mild High Strong Yes
Overcast Hot Normal Weak Yes
Rain Mild High Strong No Dataset from Mitchell, T. M. Machine
Learning. McGraw-Hill, 1997. pp. 59-
60.
CAN WE PLAY TENNIS
Outlook Temperature Humidity Wind PlayTennis
Sunny Hot High Weak No
Sunny Hot High Strong No
Overcast Hot High Weak Yes
Rain Mild High Weak Yes
Rain Cool Normal Weak Yes
Rain Cool Normal Strong No
Overcast Cool Normal Strong Yes
Sunny Mild High Weak No
Sunny Cool Normal Weak Yes
Rain Mild Normal Weak Yes
Sunny Mild Normal Strong Yes
Overcast Mild High Strong Yes
Overcast Hot Normal Weak Yes
Rain Mild High Strong No
CAN WE PLAY TENNIS
Outlook PlayTennis
Sunny No
Sunny No
Overcast Yes
Rain Yes
Rain Yes
Rain No
Overcast Yes
Sunny No
Sunny Yes
Rain Yes
Sunny Yes
Overcast Yes
Overcast Yes
Rain No
CAN WE PLAY TENNIS
Outlook PlayTennis
Overcast Yes
Overcast Yes
Overcast Yes
Overcast Yes
Rain Yes
Rain Yes
Rain Yes
Rain No
Rain No
Sunny Yes
Sunny Yes
Sunny No
Sunny No
Sunny No
CAN WE PLAY TENNIS
Outlook PlayTennis
Overcast Yes
Overcast Yes
Overcast Yes
Overcast Yes
Rain Yes
Rain Yes
Rain Yes
Rain No
Rain No
Sunny Yes
Sunny Yes
Sunny No
Sunny No
Sunny No
CAN WE PLAY TENNIS
Outlook PlayTennis
Overcast Yes
Overcast Yes
Overcast Yes
Overcast Yes
Rain Yes
Rain Yes
Rain Yes
Rain No
Rain No
Sunny Yes
Sunny Yes
Sunny No
Sunny No
Sunny No
𝑒𝑛𝑡𝑟𝑜𝑝𝑦 𝐻(𝑥) = −𝑝 𝑦𝑒𝑠 log2(𝑝 𝑦𝑒𝑠) −𝑝 𝑛𝑜 log2(𝑝 𝑛𝑜)
CAN WE PLAY TENNIS
Outlook PlayTennis
Overcast Yes
Overcast Yes
Overcast Yes
Overcast Yes
Rain Yes
Rain Yes
Rain Yes
Rain No
Rain No
Sunny Yes
Sunny Yes
Sunny No
Sunny No
Sunny No
𝑒𝑛𝑡𝑟𝑜𝑝𝑦 𝑂𝑣𝑒𝑟𝑐𝑎𝑠𝑡 = −1 log2 1 − 0 log2 0 = 0
𝑒𝑛𝑡𝑟𝑜𝑝𝑦 𝑅𝑎𝑖𝑛 = −0.6 log2 0.6 − 0.4 log2 0.4 = 0.97
𝑒𝑛𝑡𝑟𝑜𝑝𝑦𝑆𝑢𝑛𝑛𝑦 = −0.4 log2 0.4 − 0.6 log2 0.6 = 0.97
CAN WE PLAY TENNIS
Outlook PlayTennis
Overcast Yes
Overcast Yes
Overcast Yes
Overcast Yes
Rain Yes
Rain Yes
Rain Yes
Rain No
Rain No
Sunny Yes
Sunny Yes
Sunny No
Sunny No
Sunny No
𝑒𝑛𝑡𝑟𝑜𝑝𝑦 𝑂𝑣𝑒𝑟𝑐𝑎𝑠𝑡 = −1 log2 1 − 0 log2 0 = 0
𝑒𝑛𝑡𝑟𝑜𝑝𝑦 𝑅𝑎𝑖𝑛 = −0.6 log2 0.6 − 0.4 log2 0.4 = 0.97
𝑒𝑛𝑡𝑟𝑜𝑝𝑦𝑆𝑢𝑛𝑛𝑦 = −0.4 log2 0.4 − 0.6 log2 0.6 = 0.97
CAN WE PLAY TENNIS
Outlook PlayTennis
Overcast Yes
Overcast Yes
Overcast Yes
Overcast Yes
Rain Yes
Rain Yes
Rain Yes
Rain No
Rain No
Sunny Yes
Sunny Yes
Sunny No
Sunny No
Sunny No
𝑒𝑛𝑡𝑟𝑜𝑝𝑦 𝐵𝑒𝑓𝑜𝑟𝑒 = 0.94 𝑒𝑛𝑡𝑟𝑜𝑝𝑦 𝑎𝑓𝑡𝑒𝑟 = 0.7
𝑖𝑛𝑓𝑜𝑟𝑚𝑎𝑡𝑖𝑜𝑛 𝑔𝑎𝑖𝑛 = 0.94 − 0.7 = 0.24
CAN WE PLAY TENNIS
Outlook Temperature Humidity Wind PlayTennis
Sunny Cool Normal Weak Yes
Sunny Mild Normal Strong Yes
Sunny Hot High Weak No
Sunny Hot High Strong No
𝑂𝑢𝑡𝑙𝑜𝑜𝑘?
𝑅𝑎𝑖𝑛
𝑌𝑒𝑠
Outlook Temperature Humidity Wind PlayTennis
Rain Mild High Weak Yes
Rain Cool Normal Weak Yes
Rain Mild Normal Weak Yes
Rain Cool Normal Strong No
CAN WE PLAY TENNIS
Outlook Temperature Humidity Wind PlayTennis
Sunny Cool Normal Weak Yes
Sunny Mild Normal Strong Yes
Sunny Hot High Weak No
Sunny Hot High Strong No
𝑂𝑢𝑡𝑙𝑜𝑜𝑘?
𝑅𝑎𝑖𝑛
𝑌𝑒𝑠
𝑊𝑖𝑛𝑑?
𝑌𝑒𝑠
𝑁𝑜
CAN WE PLAY TENNIS
𝑂𝑢𝑡𝑙𝑜𝑜𝑘?
𝑅𝑎𝑖𝑛
𝑌𝑒𝑠
𝑊𝑖𝑛𝑑?
𝑌𝑒𝑠
𝑁𝑜
𝑌𝑒𝑠
𝑁𝑜
𝐻𝑢𝑚𝑖𝑑𝑖𝑡𝑦?
CREATING TREE
DecisionVariable[] attributes =
{
new DecisionVariable("Outlook", 3),
new DecisionVariable("Temperature", 3),
new DecisionVariable("Humidity", 2),
new DecisionVariable("Wind", 2)
};
int classCount = 2;
DecisionTree tree = new DecisionTree(attributes, classCount);
CONSTRUCTING TRAINER
ID3Learning id3learning = new ID3Learning(tree);
public class ID3Learning
{
public double Run(int[][] inputs, int[] outputs);
}
NORMALIZING DATA
Codification codebook = ...;
DataTable symbols = codebook.Apply(data);
int[][] inputs =
symbols.ToArray<int>("Outlook","Temperature“, . . .);
int[] outputs = symbols.ToArray<int>("PlayTennis");
NORMALIZING DATA
Outlook Temperature Humidity Wind PlayTennis
Sunny Hot High Weak No
Sunny Hot High Strong No
Overcast Hot High Weak Yes
Rain Mild High Weak Yes
Rain Cool Normal Weak Yes
Rain Cool Normal Strong No
Overcast Cool Normal Strong Yes
Sunny Mild High Weak No
Sunny Cool Normal Weak Yes
Rain Mild Normal Weak Yes
Sunny Mild Normal Strong Yes
Overcast Mild High Strong Yes
Overcast Hot Normal Weak Yes
Rain Mild High Strong No
0, 1, 2, 3
0, 0, 0, 0
0, 0, 0, 1
1, 0, 0, 0
2, 1, 0, 0
2, 2, 1, 0
2, 2, 1, 1
1, 2, 1, 1
0, 1, 0, 0
0, 2, 1, 0
2, 1, 1, 0
0, 1, 1, 1
1, 1, 0, 1
1, 0, 1, 0
2, 1, 0, 1
COMBINING EVERYTHING
id3learning.Run(inputs, outputs);
var question = codebook.Translate("Sunny",
"Hot", "High", "Strong")
int answer = tree.Compute(question);
string willPlayTenis =
codebook.Translate("PlayTennis", answer);
ID3 ALGORITHM WITH ACCORD
tree.ToRules():
0 =: (Outlook == 0) && (Humidity == 0)
0 =: (Outlook == 2) && (Wind == 1)
1 =: (Outlook == 1)
1 =: (Outlook == 0) && (Humidity == 1)
1 =: (Outlook == 2) && (Wind == 0)
tree.Save("./tree");
DecisionTree.Load("./tree");
tree.ToCode("Tree");
USES
𝑂𝑢𝑡𝑙𝑜𝑜𝑘?
𝑅𝑎𝑖𝑛
𝑌𝑒𝑠
𝑊𝑖𝑛𝑑?
𝑌𝑒𝑠
𝑁𝑜
𝑌𝑒𝑠
𝑁𝑜
𝐻𝑢𝑚𝑖𝑑𝑖𝑡𝑦?
• Image
classification
• Face recognition
• Visualisation
• Algorithm
refinement
CLUSTERING
KMEANS
var k = new KMeans(2);
int[] clusters = k.Compute(inputs);
MEANS SHIFT
var k = new MeanShift(2, new UniformKernel(), 0.2);
int[] clusters = k.Compute(inputs);
USE CASES
Market segmentation
Customer analysis
NEURAL NETWORKS
MAGIC
NEURAL NETWORKS
𝑋 ∗ 𝑤1
𝑌 ∗ 𝑤2
NEURAL NETWORKS
𝑌 ∗ 𝑤3
𝑥1 ∗ 𝑤1
𝑥2 ∗ 𝑤2
NEURAL NETWORKS
𝑌1 ∗ 𝑤
𝑥1 ∗ 𝑤1
𝑥2 ∗ 𝑤2
𝑥2 ∗ 𝑤2
𝑌2 ∗ 𝑤
Mixed National Institute of Standards and
Technology database
NEURAL NETWORK
var network = new ActivationNetwork(new SigmoidFunction(), 28 * 28, 10);
NEURAL NETWORK
var network = new ActivationNetwork(new SigmoidFunction(), 28 * 28, 10);
NEURAL NETWORK
var network = new ActivationNetwork(new SigmoidFunction(), 28 * 28, 10);
𝑥
𝑥
𝑦
𝑦
NEURAL NETWORK
var network = new ActivationNetwork(new SigmoidFunction(), 28 * 28, 10);
new NguyenWidrow(network).Randomize();
var teacher = new ResilientBackpropagationLearning(network);
double[] [][] inputs = ...
double[] [][] outputs = ...
for (var i = 0; i < 20; i++)
{
teacher.RunEpoch(inputs[i], outputs[i]);
}
NEURAL NETWORK
+
−
NEURAL NETWORK
public abstract class Network
{
...
double[] Compute(double[] input);
}
NEURAL NETWORKS
𝑌1 ∗ 𝑤
𝑥1 ∗ 𝑤1
𝑥2 ∗ 𝑤2
𝑥2 ∗ 𝑤2
𝑌2 ∗ 𝑤
Self driving cars
Spam filters
OVERFITTING
OVERFITTING
30-
20%
70-80%
DIFFICULTIES
Everything is double[]
Data preparation
WHAT’S NEXT
tensorflow

More Related Content

Similar to Machine Learning with Accord Framework

Machine Learning 2D5362
Machine Learning 2D5362Machine Learning 2D5362
Machine Learning 2D5362
butest
 
Classification using decision tree in detail
Classification using decision tree in detailClassification using decision tree in detail
Classification using decision tree in detail
Ramadan Babers, PhD
 
Ai & Ml presentation purushottam.pptx
Ai & Ml presentation purushottam.pptxAi & Ml presentation purushottam.pptx
Ai & Ml presentation purushottam.pptx
puruskarDubey
 
Introduction to ML and Decision Tree
Introduction to ML and Decision TreeIntroduction to ML and Decision Tree
Introduction to ML and Decision Tree
Suman Debnath
 
Aula controle discreto
Aula controle discretoAula controle discreto
Aula controle discreto
Fladimy Rocha Santo
 
Least Squares Fitting
Least Squares Fitting Least Squares Fitting
Least Squares Fitting
MANREET SOHAL
 
Id3,c4.5 algorithim
Id3,c4.5 algorithimId3,c4.5 algorithim
Id3,c4.5 algorithim
Abdelfattah Al Zaqqa
 
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in RIntroduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
Stefano Dalla Palma
 
Jordan Higher (𝜎, 𝜏)-Centralizer on Prime Ring
Jordan Higher (𝜎, 𝜏)-Centralizer on Prime RingJordan Higher (𝜎, 𝜏)-Centralizer on Prime Ring
Jordan Higher (𝜎, 𝜏)-Centralizer on Prime Ring
IOSR Journals
 
Mpc 006 - 02-02 types of correlation
Mpc 006 - 02-02 types of correlationMpc 006 - 02-02 types of correlation
Mpc 006 - 02-02 types of correlation
Vasant Kothari
 
ID3_Explanation.pptx
ID3_Explanation.pptxID3_Explanation.pptx
ID3_Explanation.pptx
SanketMani1
 

Similar to Machine Learning with Accord Framework (11)

Machine Learning 2D5362
Machine Learning 2D5362Machine Learning 2D5362
Machine Learning 2D5362
 
Classification using decision tree in detail
Classification using decision tree in detailClassification using decision tree in detail
Classification using decision tree in detail
 
Ai & Ml presentation purushottam.pptx
Ai & Ml presentation purushottam.pptxAi & Ml presentation purushottam.pptx
Ai & Ml presentation purushottam.pptx
 
Introduction to ML and Decision Tree
Introduction to ML and Decision TreeIntroduction to ML and Decision Tree
Introduction to ML and Decision Tree
 
Aula controle discreto
Aula controle discretoAula controle discreto
Aula controle discreto
 
Least Squares Fitting
Least Squares Fitting Least Squares Fitting
Least Squares Fitting
 
Id3,c4.5 algorithim
Id3,c4.5 algorithimId3,c4.5 algorithim
Id3,c4.5 algorithim
 
Introduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in RIntroduction to Machine Learning with examples in R
Introduction to Machine Learning with examples in R
 
Jordan Higher (𝜎, 𝜏)-Centralizer on Prime Ring
Jordan Higher (𝜎, 𝜏)-Centralizer on Prime RingJordan Higher (𝜎, 𝜏)-Centralizer on Prime Ring
Jordan Higher (𝜎, 𝜏)-Centralizer on Prime Ring
 
Mpc 006 - 02-02 types of correlation
Mpc 006 - 02-02 types of correlationMpc 006 - 02-02 types of correlation
Mpc 006 - 02-02 types of correlation
 
ID3_Explanation.pptx
ID3_Explanation.pptxID3_Explanation.pptx
ID3_Explanation.pptx
 

Recently uploaded

Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......
Sachin Paul
 
DSSML24_tspann_CodelessGenerativeAIPipelines
DSSML24_tspann_CodelessGenerativeAIPipelinesDSSML24_tspann_CodelessGenerativeAIPipelines
DSSML24_tspann_CodelessGenerativeAIPipelines
Timothy Spann
 
The Building Blocks of QuestDB, a Time Series Database
The Building Blocks of QuestDB, a Time Series DatabaseThe Building Blocks of QuestDB, a Time Series Database
The Building Blocks of QuestDB, a Time Series Database
javier ramirez
 
Population Growth in Bataan: The effects of population growth around rural pl...
Population Growth in Bataan: The effects of population growth around rural pl...Population Growth in Bataan: The effects of population growth around rural pl...
Population Growth in Bataan: The effects of population growth around rural pl...
Bill641377
 
A presentation that explain the Power BI Licensing
A presentation that explain the Power BI LicensingA presentation that explain the Power BI Licensing
A presentation that explain the Power BI Licensing
AlessioFois2
 
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
bopyb
 
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Aggregage
 
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
nuttdpt
 
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
v7oacc3l
 
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
nuttdpt
 
Udemy_2024_Global_Learning_Skills_Trends_Report (1).pdf
Udemy_2024_Global_Learning_Skills_Trends_Report (1).pdfUdemy_2024_Global_Learning_Skills_Trends_Report (1).pdf
Udemy_2024_Global_Learning_Skills_Trends_Report (1).pdf
Fernanda Palhano
 
The Ipsos - AI - Monitor 2024 Report.pdf
The  Ipsos - AI - Monitor 2024 Report.pdfThe  Ipsos - AI - Monitor 2024 Report.pdf
The Ipsos - AI - Monitor 2024 Report.pdf
Social Samosa
 
Analysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performanceAnalysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performance
roli9797
 
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
apvysm8
 
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
nyfuhyz
 
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
Timothy Spann
 
原版一比一利兹贝克特大学毕业证(LeedsBeckett毕业证书)如何办理
原版一比一利兹贝克特大学毕业证(LeedsBeckett毕业证书)如何办理原版一比一利兹贝克特大学毕业证(LeedsBeckett毕业证书)如何办理
原版一比一利兹贝克特大学毕业证(LeedsBeckett毕业证书)如何办理
wyddcwye1
 
University of New South Wales degree offer diploma Transcript
University of New South Wales degree offer diploma TranscriptUniversity of New South Wales degree offer diploma Transcript
University of New South Wales degree offer diploma Transcript
soxrziqu
 
Experts live - Improving user adoption with AI
Experts live - Improving user adoption with AIExperts live - Improving user adoption with AI
Experts live - Improving user adoption with AI
jitskeb
 
一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理
aqzctr7x
 

Recently uploaded (20)

Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......Palo Alto Cortex XDR presentation .......
Palo Alto Cortex XDR presentation .......
 
DSSML24_tspann_CodelessGenerativeAIPipelines
DSSML24_tspann_CodelessGenerativeAIPipelinesDSSML24_tspann_CodelessGenerativeAIPipelines
DSSML24_tspann_CodelessGenerativeAIPipelines
 
The Building Blocks of QuestDB, a Time Series Database
The Building Blocks of QuestDB, a Time Series DatabaseThe Building Blocks of QuestDB, a Time Series Database
The Building Blocks of QuestDB, a Time Series Database
 
Population Growth in Bataan: The effects of population growth around rural pl...
Population Growth in Bataan: The effects of population growth around rural pl...Population Growth in Bataan: The effects of population growth around rural pl...
Population Growth in Bataan: The effects of population growth around rural pl...
 
A presentation that explain the Power BI Licensing
A presentation that explain the Power BI LicensingA presentation that explain the Power BI Licensing
A presentation that explain the Power BI Licensing
 
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
一比一原版(GWU,GW文凭证书)乔治·华盛顿大学毕业证如何办理
 
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
Beyond the Basics of A/B Tests: Highly Innovative Experimentation Tactics You...
 
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
一比一原版(UCSF文凭证书)旧金山分校毕业证如何办理
 
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
在线办理(英国UCA毕业证书)创意艺术大学毕业证在读证明一模一样
 
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
一比一原版(UCSB文凭证书)圣芭芭拉分校毕业证如何办理
 
Udemy_2024_Global_Learning_Skills_Trends_Report (1).pdf
Udemy_2024_Global_Learning_Skills_Trends_Report (1).pdfUdemy_2024_Global_Learning_Skills_Trends_Report (1).pdf
Udemy_2024_Global_Learning_Skills_Trends_Report (1).pdf
 
The Ipsos - AI - Monitor 2024 Report.pdf
The  Ipsos - AI - Monitor 2024 Report.pdfThe  Ipsos - AI - Monitor 2024 Report.pdf
The Ipsos - AI - Monitor 2024 Report.pdf
 
Analysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performanceAnalysis insight about a Flyball dog competition team's performance
Analysis insight about a Flyball dog competition team's performance
 
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
办(uts毕业证书)悉尼科技大学毕业证学历证书原版一模一样
 
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
一比一原版(UMN文凭证书)明尼苏达大学毕业证如何办理
 
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
 
原版一比一利兹贝克特大学毕业证(LeedsBeckett毕业证书)如何办理
原版一比一利兹贝克特大学毕业证(LeedsBeckett毕业证书)如何办理原版一比一利兹贝克特大学毕业证(LeedsBeckett毕业证书)如何办理
原版一比一利兹贝克特大学毕业证(LeedsBeckett毕业证书)如何办理
 
University of New South Wales degree offer diploma Transcript
University of New South Wales degree offer diploma TranscriptUniversity of New South Wales degree offer diploma Transcript
University of New South Wales degree offer diploma Transcript
 
Experts live - Improving user adoption with AI
Experts live - Improving user adoption with AIExperts live - Improving user adoption with AI
Experts live - Improving user adoption with AI
 
一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理
 

Machine Learning with Accord Framework

  • 1. MACHINE LEARNING WITH ACCORD FRAMEWORK A N D R I U S D A P Š E V I Č I U S
  • 3. MACHINE LEARNING • Decision tree • Artificial neural networks • Clustering • Association rule discovery • Genetic algorithms • etc...
  • 4. MACHINE LEARNING • Decision tree • Artificial neural networks • Clustering • Association rule discovery • Genetic algorithms • etc...
  • 5. MACHINE LEARNING • Decision tree • Artificial neural networks • Clustering
  • 6. ACCORD FRAMEWORK •Machine learning made in a minute • GNU LGPL • Entirely C# • Runs on ONE machine
  • 7. DECISION TREE 𝑥 ∙ 𝑦 𝑥 ∙ 𝑦 = 0 𝑥 ∙ 𝑦 = 0 𝑥 ∙ 𝑦 = 1
  • 8. CAN WE PLAY TENNIS Outlook Temperature Humidity Wind PlayTennis Sunny Hot High Weak No Sunny Hot High Strong No Overcast Hot High Weak Yes Rain Mild High Weak Yes Rain Cool Normal Weak Yes Rain Cool Normal Strong No Overcast Cool Normal Strong Yes Sunny Mild High Weak No Sunny Cool Normal Weak Yes Rain Mild Normal Weak Yes Sunny Mild Normal Strong Yes Overcast Mild High Strong Yes Overcast Hot Normal Weak Yes Rain Mild High Strong No Dataset from Mitchell, T. M. Machine Learning. McGraw-Hill, 1997. pp. 59- 60.
  • 9. CAN WE PLAY TENNIS Outlook Temperature Humidity Wind PlayTennis Sunny Hot High Weak No Sunny Hot High Strong No Overcast Hot High Weak Yes Rain Mild High Weak Yes Rain Cool Normal Weak Yes Rain Cool Normal Strong No Overcast Cool Normal Strong Yes Sunny Mild High Weak No Sunny Cool Normal Weak Yes Rain Mild Normal Weak Yes Sunny Mild Normal Strong Yes Overcast Mild High Strong Yes Overcast Hot Normal Weak Yes Rain Mild High Strong No
  • 10. CAN WE PLAY TENNIS Outlook PlayTennis Sunny No Sunny No Overcast Yes Rain Yes Rain Yes Rain No Overcast Yes Sunny No Sunny Yes Rain Yes Sunny Yes Overcast Yes Overcast Yes Rain No
  • 11. CAN WE PLAY TENNIS Outlook PlayTennis Overcast Yes Overcast Yes Overcast Yes Overcast Yes Rain Yes Rain Yes Rain Yes Rain No Rain No Sunny Yes Sunny Yes Sunny No Sunny No Sunny No
  • 12. CAN WE PLAY TENNIS Outlook PlayTennis Overcast Yes Overcast Yes Overcast Yes Overcast Yes Rain Yes Rain Yes Rain Yes Rain No Rain No Sunny Yes Sunny Yes Sunny No Sunny No Sunny No
  • 13. CAN WE PLAY TENNIS Outlook PlayTennis Overcast Yes Overcast Yes Overcast Yes Overcast Yes Rain Yes Rain Yes Rain Yes Rain No Rain No Sunny Yes Sunny Yes Sunny No Sunny No Sunny No 𝑒𝑛𝑡𝑟𝑜𝑝𝑦 𝐻(𝑥) = −𝑝 𝑦𝑒𝑠 log2(𝑝 𝑦𝑒𝑠) −𝑝 𝑛𝑜 log2(𝑝 𝑛𝑜)
  • 14. CAN WE PLAY TENNIS Outlook PlayTennis Overcast Yes Overcast Yes Overcast Yes Overcast Yes Rain Yes Rain Yes Rain Yes Rain No Rain No Sunny Yes Sunny Yes Sunny No Sunny No Sunny No 𝑒𝑛𝑡𝑟𝑜𝑝𝑦 𝑂𝑣𝑒𝑟𝑐𝑎𝑠𝑡 = −1 log2 1 − 0 log2 0 = 0 𝑒𝑛𝑡𝑟𝑜𝑝𝑦 𝑅𝑎𝑖𝑛 = −0.6 log2 0.6 − 0.4 log2 0.4 = 0.97 𝑒𝑛𝑡𝑟𝑜𝑝𝑦𝑆𝑢𝑛𝑛𝑦 = −0.4 log2 0.4 − 0.6 log2 0.6 = 0.97
  • 15. CAN WE PLAY TENNIS Outlook PlayTennis Overcast Yes Overcast Yes Overcast Yes Overcast Yes Rain Yes Rain Yes Rain Yes Rain No Rain No Sunny Yes Sunny Yes Sunny No Sunny No Sunny No 𝑒𝑛𝑡𝑟𝑜𝑝𝑦 𝑂𝑣𝑒𝑟𝑐𝑎𝑠𝑡 = −1 log2 1 − 0 log2 0 = 0 𝑒𝑛𝑡𝑟𝑜𝑝𝑦 𝑅𝑎𝑖𝑛 = −0.6 log2 0.6 − 0.4 log2 0.4 = 0.97 𝑒𝑛𝑡𝑟𝑜𝑝𝑦𝑆𝑢𝑛𝑛𝑦 = −0.4 log2 0.4 − 0.6 log2 0.6 = 0.97
  • 16. CAN WE PLAY TENNIS Outlook PlayTennis Overcast Yes Overcast Yes Overcast Yes Overcast Yes Rain Yes Rain Yes Rain Yes Rain No Rain No Sunny Yes Sunny Yes Sunny No Sunny No Sunny No 𝑒𝑛𝑡𝑟𝑜𝑝𝑦 𝐵𝑒𝑓𝑜𝑟𝑒 = 0.94 𝑒𝑛𝑡𝑟𝑜𝑝𝑦 𝑎𝑓𝑡𝑒𝑟 = 0.7 𝑖𝑛𝑓𝑜𝑟𝑚𝑎𝑡𝑖𝑜𝑛 𝑔𝑎𝑖𝑛 = 0.94 − 0.7 = 0.24
  • 17. CAN WE PLAY TENNIS Outlook Temperature Humidity Wind PlayTennis Sunny Cool Normal Weak Yes Sunny Mild Normal Strong Yes Sunny Hot High Weak No Sunny Hot High Strong No 𝑂𝑢𝑡𝑙𝑜𝑜𝑘? 𝑅𝑎𝑖𝑛 𝑌𝑒𝑠 Outlook Temperature Humidity Wind PlayTennis Rain Mild High Weak Yes Rain Cool Normal Weak Yes Rain Mild Normal Weak Yes Rain Cool Normal Strong No
  • 18. CAN WE PLAY TENNIS Outlook Temperature Humidity Wind PlayTennis Sunny Cool Normal Weak Yes Sunny Mild Normal Strong Yes Sunny Hot High Weak No Sunny Hot High Strong No 𝑂𝑢𝑡𝑙𝑜𝑜𝑘? 𝑅𝑎𝑖𝑛 𝑌𝑒𝑠 𝑊𝑖𝑛𝑑? 𝑌𝑒𝑠 𝑁𝑜
  • 19. CAN WE PLAY TENNIS 𝑂𝑢𝑡𝑙𝑜𝑜𝑘? 𝑅𝑎𝑖𝑛 𝑌𝑒𝑠 𝑊𝑖𝑛𝑑? 𝑌𝑒𝑠 𝑁𝑜 𝑌𝑒𝑠 𝑁𝑜 𝐻𝑢𝑚𝑖𝑑𝑖𝑡𝑦?
  • 20. CREATING TREE DecisionVariable[] attributes = { new DecisionVariable("Outlook", 3), new DecisionVariable("Temperature", 3), new DecisionVariable("Humidity", 2), new DecisionVariable("Wind", 2) }; int classCount = 2; DecisionTree tree = new DecisionTree(attributes, classCount);
  • 21. CONSTRUCTING TRAINER ID3Learning id3learning = new ID3Learning(tree); public class ID3Learning { public double Run(int[][] inputs, int[] outputs); }
  • 22. NORMALIZING DATA Codification codebook = ...; DataTable symbols = codebook.Apply(data); int[][] inputs = symbols.ToArray<int>("Outlook","Temperature“, . . .); int[] outputs = symbols.ToArray<int>("PlayTennis");
  • 23. NORMALIZING DATA Outlook Temperature Humidity Wind PlayTennis Sunny Hot High Weak No Sunny Hot High Strong No Overcast Hot High Weak Yes Rain Mild High Weak Yes Rain Cool Normal Weak Yes Rain Cool Normal Strong No Overcast Cool Normal Strong Yes Sunny Mild High Weak No Sunny Cool Normal Weak Yes Rain Mild Normal Weak Yes Sunny Mild Normal Strong Yes Overcast Mild High Strong Yes Overcast Hot Normal Weak Yes Rain Mild High Strong No 0, 1, 2, 3 0, 0, 0, 0 0, 0, 0, 1 1, 0, 0, 0 2, 1, 0, 0 2, 2, 1, 0 2, 2, 1, 1 1, 2, 1, 1 0, 1, 0, 0 0, 2, 1, 0 2, 1, 1, 0 0, 1, 1, 1 1, 1, 0, 1 1, 0, 1, 0 2, 1, 0, 1
  • 24. COMBINING EVERYTHING id3learning.Run(inputs, outputs); var question = codebook.Translate("Sunny", "Hot", "High", "Strong") int answer = tree.Compute(question); string willPlayTenis = codebook.Translate("PlayTennis", answer);
  • 25. ID3 ALGORITHM WITH ACCORD tree.ToRules(): 0 =: (Outlook == 0) && (Humidity == 0) 0 =: (Outlook == 2) && (Wind == 1) 1 =: (Outlook == 1) 1 =: (Outlook == 0) && (Humidity == 1) 1 =: (Outlook == 2) && (Wind == 0) tree.Save("./tree"); DecisionTree.Load("./tree"); tree.ToCode("Tree");
  • 28. KMEANS var k = new KMeans(2); int[] clusters = k.Compute(inputs);
  • 29. MEANS SHIFT var k = new MeanShift(2, new UniformKernel(), 0.2); int[] clusters = k.Compute(inputs);
  • 32. NEURAL NETWORKS 𝑋 ∗ 𝑤1 𝑌 ∗ 𝑤2
  • 33. NEURAL NETWORKS 𝑌 ∗ 𝑤3 𝑥1 ∗ 𝑤1 𝑥2 ∗ 𝑤2
  • 34. NEURAL NETWORKS 𝑌1 ∗ 𝑤 𝑥1 ∗ 𝑤1 𝑥2 ∗ 𝑤2 𝑥2 ∗ 𝑤2 𝑌2 ∗ 𝑤
  • 35. Mixed National Institute of Standards and Technology database
  • 36. NEURAL NETWORK var network = new ActivationNetwork(new SigmoidFunction(), 28 * 28, 10);
  • 37. NEURAL NETWORK var network = new ActivationNetwork(new SigmoidFunction(), 28 * 28, 10);
  • 38. NEURAL NETWORK var network = new ActivationNetwork(new SigmoidFunction(), 28 * 28, 10); 𝑥 𝑥 𝑦 𝑦
  • 39. NEURAL NETWORK var network = new ActivationNetwork(new SigmoidFunction(), 28 * 28, 10); new NguyenWidrow(network).Randomize(); var teacher = new ResilientBackpropagationLearning(network); double[] [][] inputs = ... double[] [][] outputs = ... for (var i = 0; i < 20; i++) { teacher.RunEpoch(inputs[i], outputs[i]); }
  • 41. NEURAL NETWORK public abstract class Network { ... double[] Compute(double[] input); }
  • 42. NEURAL NETWORKS 𝑌1 ∗ 𝑤 𝑥1 ∗ 𝑤1 𝑥2 ∗ 𝑤2 𝑥2 ∗ 𝑤2 𝑌2 ∗ 𝑤 Self driving cars Spam filters