Using PCA before Bayes classificition

老子叫甜甜 提交于 2019-12-12 03:47:31

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/36491852/using-pca-before-bayes-classificition

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!