Classification methods 分类算法 (R)

写在前面

介绍了 6 种分类算法, 分别是 

Linear discriminant analysis (LDA),

Quadratic discriminant analysis (QDA),

Logistic regression (LR),

Support vector machines (SVM),

K-nearest neighbour (KNN).

为了介绍这五种算法是怎么操作的,我们会使用一个模拟数据的例子,先介绍算法的原理,再使用的R语言搭建模型,再判断模型的拟合程度,再对多个算法进行对比。

我写的初稿就是英文,所以这里就直接用英文了,也许后面会翻译一个中文版本。

Linear discriminant analysis (LDA)

Description of the method:

The LDA algorithm starts by finding directions that maximize the separation between classes, then use these directions to predict the class of individuals. These directions, called linear discriminants, are a linear combinations of predictor variables.

LDA assumes that predictors are normally distributed (Gaussian distribution) and that the different classes have class-specific means and equal variance/covariance.

Analysis and results:

Use function “lda()” in “MASS” to build the model based on trainSet, make prediction on testSet. The prediction provides “class”, which is the predicted classes of observation, use it to compute the confusion matrix.

We can find:

  1. This model gives an accuracy rate 0.71 on testSet, which is barely good;
  2. Sensitivity is 0.27 and Specificity is 0.89, Sensitivity is low;
  3. Confusion matrix, of the 59 actual Group0 points, the system predicted that 43 were Group1, most of the points were misallocated. This is another way of showing Sensitivity (1-4359=0.27 ). Of the 141 Group1 points, the system predicted that 15 were Group0, only a small part of points were misallocated. This is another way of showing Specificity (1-15141=0.89 ). Again we can say Specificity is good but Sensitivity is too low.
> model1 <- lda(Group ~ X1+X2, data = trainSet)
> prediction1 <- model1 %>% predict(testSet)
> confusionMatrix(as.factor(prediction1$class),as.factor(testSet$Group)) 
Confusion Matrix and Statistics

          Reference
Prediction   0   1
         0  16  15
         1  43 126
                                          
               Accuracy : 0.71            
                 95% CI : (0.6418, 0.7718)
    No Information Rate : 0.705           
    P-Value [Acc > NIR] : 0.4733208
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
水下声学数据分类是一项重要的研究领域,而深度学习方法在这个领域中的应用也是备受关注的。深度学习是一种基于人工神经网络的机器学习方法,具有处理大型数据集和自动学习特征表示的优势。 在水下声学数据分类中,有许多不同的深度学习方法被用于处理和分类数据。其中之一是卷积神经网络(CNN)。CNN可以自动识别和提取图像数据中的特征,适用于图像分类和物体检测。在声学数据中,将声波数据转换为图像数据的形式,然后利用CNN进行分类,可以有效地利用CNN的特征提取能力。 另一种常见的深度学习方法是循环神经网络(RNN)。RNN是一种能够处理序列数据的神经网络,适用于时间序列数据的分类和预测。在水下声学数据分类中,声波信号通常是时间序列数据,所以使用RNN可以更好地捕捉到数据中的时序特征。 除了CNN和RNN,还有一些其他的深度学习方法可以应用于水下声学数据分类,如深度信念网络(DBN)、深度玻尔兹曼机(DBM)等。这些方法在处理复杂的声学数据分类问题时表现出的性能优越性。 总结来说,水下声学数据分类方法的深度学习应用非常广泛。CNN、RNN等深度学习方法可以有效地处理数据的特征提取和分类任务,同时还有其他的深度学习方法可以进一步优化水下声学数据的分类效果。随着深度学习技术的不断发展,相信在未来将会有更多更先进的方法应用于水下声学数据的分类研究中。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Clark Kent 2000

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值