简体   繁体   English

使用回归而不是分类进行多 class 分类

[英]Using regression instead of classification for multi class classification

I have a multi class classification problem.我有一个多 class 分类问题。 I am using random forest classifier.我正在使用随机森林分类器。 My boss has asked if it is possible to also view our problem with regression.我的老板问是否可以通过回归来查看我们的问题。 I understand that for a classification task, it is of course better to use a classifier, but is it possible to implement a regression model.我知道对于分类任务,使用分类器当然更好,但是是否可以实现回归 model。

My data is as such:我的数据是这样的:

I have a dataset consisting of software requirements, these are rated as either 1, 2, 3, 4 or 5.我有一个由软件需求组成的数据集,它们被评为 1、2、3、4 或 5。

I am then creating a feature matrix to use for training the model to make predictions on the class, with 10 features such as: num_words, num_sentences, num_syllables, weak_words, flesh_idx etc然后,我创建一个特征矩阵用于训练 model 以对 class 进行预测,具有 10 个特征,例如:num_words、num_sentences、num_syllables、weak_words、flesh_idx 等

My model works quite well with 93% accuracy.我的 model 工作得很好,准确率为 93%。

Is there a way I can view this problem using regression?有没有办法可以使用回归来查看这个问题? Such that the model would make predictions such as 1.5 for example, where the prediction doesn't fall into the class 1 or 2 but somewhere in the middle?这样 model 会做出预测,例如 1.5,其中预测不属于 class 1 或 2,而是在中间的某个地方? Or maybe 2.2, 3.3 etc as opposed to 1, 2, 3, 4, or 5?或者可能是 2.2、3.3 等而不是 1、2、3、4 或 5?

I guess the reason is just to see if we can see the software requirement scores in a continuous way.我想原因只是为了看看我们是否可以连续看到软件需求分数。

try Softmax regression (or multinomial logistic regression) with mxnet or with tensorflow使用mxnettensorflow尝试 Softmax 回归(或多项逻辑回归)

The way you can use regression in classification problems is with Logistic Regressions.在分类问题中使用回归的方法是使用逻辑回归。 You can use this individually to classify 1 vs not 1, 2 vs not 2, and so on for each classification (don't do this), or use Softmax that in simple words, weights each class and returns a probability for each given class, then you just pick the one with the max probability and that will be your predicted class.您可以单独使用它来分类每个分类的 1 与非 1、2 与非 2 等等(不要这样做),或者使用 Softmax,简单地说,对每个 class 加权并返回每个给定 class 的概率,然后您只需选择概率max的那个,这将是您预测的 class。 There are a lot of neural networks that use softmax when working with mutli-class classification.在处理多类分类时,有很多使用softmax的神经网络。 Here is a great article from scikit-learn's documentation: https://scikit-learn.org/stable/modules/neural_networks_supervised.html这是scikit-learn's文章: https://scikit-learn.org/stable/modules/neural_networks_supervised.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM