Classification Process 1 Model Construction Training Data Classification

  • Slides: 53
Download presentation

Classification Process (1): Model Construction Training Data Classification Algorithms Classifier (Model) IF rank =

Classification Process (1): Model Construction Training Data Classification Algorithms Classifier (Model) IF rank = ‘professor’ OR years > 6 THEN tenured = ‘yes’ 4

Classification Process (2): Use the Model in Prediction Classifier Testing Data Unseen Data (Jeff,

Classification Process (2): Use the Model in Prediction Classifier Testing Data Unseen Data (Jeff, Professor, 4) Tenured? 5

Visualization of a Decision Tree in SGI/Mine. Set 3. 0 09 九月 2021 8

Visualization of a Decision Tree in SGI/Mine. Set 3. 0 09 九月 2021 8

Supervised vs. Unsupervised Learning n Supervised learning (classification) n n n Supervision: The training

Supervised vs. Unsupervised Learning n Supervised learning (classification) n n n Supervision: The training data (observations, measurements, etc. ) are accompanied by labels indicating the class of the observations New data is classified based on the training set Unsupervised learning (clustering) n n The class labels of training data is unknown Given a set of measurements, observations, etc. with the aim of establishing the existence of classes or clusters in the data 9

Training dataset Class: C 1: buys_computer= ‘yes’ C 2: buys_computer= ‘no’ Data sample X

Training dataset Class: C 1: buys_computer= ‘yes’ C 2: buys_computer= ‘no’ Data sample X =(age<=30, Income=medium, Student=yes Credit_rating= Fair) 20

Naïve Bayesian Classifier: An Example n Compute P(X|Ci) for each class P(buys_computer=“yes”) = 9/14=0.

Naïve Bayesian Classifier: An Example n Compute P(X|Ci) for each class P(buys_computer=“yes”) = 9/14=0. 643 P(buys_computer=“no”) = 5/14=0. 357 P(age=“<30” | buys_computer=“yes”) = 2/9=0. 222 P(age=“<30” | buys_computer=“no”) = 3/5 =0. 6 P(income=“medium” | buys_computer=“yes”)= 4/9 =0. 444 P(income=“medium” | buys_computer=“no”) = 2/5 = 0. 4 P(student=“yes” | buys_computer=“yes)= 6/9 =0. 667 P(student=“yes” | buys_computer=“no”)= 1/5=0. 2 P(credit_rating=“fair” | buys_computer=“yes”)=6/9=0. 667 P(credit_rating=“fair” | buys_computer=“no”)=2/5=0. 4 X=(age<=30 , income =medium, student=yes, credit_rating=fair) P(X|Ci) : P(X|buys_computer=“yes”)= 0. 222 x 0. 444 x 0. 667 =0. 044 P(X|buys_computer=“no”)= 0. 6 x 0. 4 x 0. 2 x 0. 4 =0. 019 P(X|Ci)*P(Ci ) : P(X|buys_computer=“yes”) * P(buys_computer=“yes”)=0. 044 x 0. 643=0. 028 P(X|buys_computer=“no”) * P(buys_computer=“no”)= 0. 019 x 0. 357=0. 007 Therefore, X belongs to class “buys_computer=yes” 21

后向传播算法 Output vector Output nodes Hidden nodes wij Input nodes Input vector: xi

后向传播算法 Output vector Output nodes Hidden nodes wij Input nodes Input vector: xi

Example 设学习率为 0. 9。训练样本X = {1, 0, 1} n x 1 x 2 x

Example 设学习率为 0. 9。训练样本X = {1, 0, 1} n x 1 x 2 x 3 w 14 w 15 w 24 w 25 1 0. 2 -0. 3 0. 4 0. 1 W 34 -0. 5 w 35 w 46 w 56 4 5 6 0. 2 -0. 3 -0. 2 -0. 4 0. 2 0. 1 单元j 净输入Ij 输出Oj 4 0. 2+0 -0. 5 -0. 4 = -0. 7 1+(1+e 0. 7) = 0. 332 5 -0. 3+0+0. 2 = 0. 1 1+(1+e-0. 1) = 0. 525 6 (-0. 3)(0. 332)-(0. 2)(0. 525)+0. 1 = -0. 105 1+(1+e-0. 105) = 0. 474 单元j Errj 6 (0. 474)(1 -0. 474) = 0. 1311 5 (0. 525)(1 -0. 525)(0. 1311)(-0. 2) = -0. 0065 4 (0. 332)(1 -0. 332)(0. 1311)(-0. 3) = -0. 02087 权或偏差 新值 w 46 -0. 3 + (0. 9)(0. 1311)(0. 332) = -0. 261 w 56 -0. 2 + (0. 9)(0. 1311)(0. 525) = -0. 138 w 14 0. 2 + (0. 9)(-0. 0087)(1) = 0. 192 w 15 -0. 3 + (0. 9)(0. 0065)(1) = -0. 306 w 24 0. 4 + (0. 9)(-0. 0087)(0) = 0. 4 w 25 0. 1+ (0. 9)(-0. 0065)(0) = 0. 1 w 34 -0. 5 + (0. 9)(-0. 0087)(1) = -0. 508 w 35 0. 2+ (0. 9)(-0. 0065)(1) = 0. 194 6 5 4 0. 1+(0. 9)(0. 1311) = 0. 218 09 九月 2021 类标号为 1 0. 2+(0. 9)(-0. 0065) = 0. 194 -0. 4+(0. 9)(-0. 0087) = -0. 408 44

What Is Prediction? n n n Prediction is similar to classification n First, construct

What Is Prediction? n n n Prediction is similar to classification n First, construct a model n Second, use model to predict unknown value Major method for prediction: regression n Linear and multiple regression n Non-linear regression Prediction is different from classification n n Classification refers to predict categorical class label Prediction models continuous-valued functions 46

n 有一些软件包解决回归问题。例如: n SAS(http: //www. sas. com) n SPSS(http: //www. spss. com) n S-Plus(http:

n 有一些软件包解决回归问题。例如: n SAS(http: //www. sas. com) n SPSS(http: //www. spss. com) n S-Plus(http: //www. mathsoft. com)。 47