在贝叶斯分类之前使用 PCA [英] Using PCA before Bayes classificition

查看:38
本文介绍了在贝叶斯分类之前使用 PCA的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在贝叶斯分类之前使用 PCA,但它说 Native Bayes 需要非负特征值,使用的训练数据是非负的,但使用 PCA 变成负值,我该如何解决,感谢回答我的问题

I'm trying using PCA before bayes classification ,but it says Native Bayes requires nonnegative features values, the training data used is nonnegative, but it turns to negative using PCA, how do I fix it ,Thanks to answer my question

推荐答案

如果您想减少输入的维度,可以改用非负矩阵分解.在Spark中,此方法在mllib.recommendation.ALS中,然后将非负参数设置为True.

If you want to reduce the dimension of your inputs, you can use nonnegative matrix factorization instead. In Spark, this method is in mllib.recommendation.ALS and then set the nonnegative parameter as True.

这篇关于在贝叶斯分类之前使用 PCA的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆