pyml

How could I deal with the sparse feature with high dimension in an SVR task?

妖精的绣舞 提交于 2019-12-13 01:23:00
问题 I have a twitter-like(another micro blog) data set with 1.6 million datapoints and tried to predict the its retweet numbers based on its content. I extracted its keyword and use the keywords as the bag of words feature. Then I got 1.2 million dimension feature. The feature vector is very sparse,usually only ten dimension in one data point. And I use SVR to do the regression. Now it has taken 2 days. I think the training time might take quite a long time. I don't know if I do this task like

Get recall (sensitivity) and precision (PPV) values of a multi-class problem in PyML

你离开我真会死。 提交于 2019-12-06 13:55:55
问题 I am using PyML for SVM classification. However, I noticed that when I evaluate a multi-class classifier using LOO, the results object does not report the sensitivity and PPV values. Instead they are 0.0: from PyML import * from PyML.classifiers import multi mc = multi.OneAgainstRest(SVM()) data = VectorDataSet('iris.data', labelsColumn=-1) result = mc.loo(data) result.getSuccessRate() >>> 0.95333333333333337 result.getPPV() >>> 0.0 result.getSensitivity() >>> 0.0 I have looked at the code

Suppressing output of module calling outside library

若如初见. 提交于 2019-11-27 09:31:27
I have an annoying problem when using machine learning library PyML . PyML uses libsvm to train the SVM classifier. The problem is that libsvm outputs some text to standard output. But because that is outside of Python I cannot intercept it. I tried using methods described in problem Silence the stdout of a function in Python without trashing sys.stdout and restoring each function call but none of those help. Is there any way how to do this. Modifying PyML is not an option. Ignacio Vazquez-Abrams Open /dev/null for writing, use os.dup() to copy stdout, and use os.dup2() to copy your open /dev

Suppressing output of module calling outside library

寵の児 提交于 2019-11-26 14:46:43
问题 I have an annoying problem when using machine learning library PyML. PyML uses libsvm to train the SVM classifier. The problem is that libsvm outputs some text to standard output. But because that is outside of Python I cannot intercept it. I tried using methods described in problem Silence the stdout of a function in Python without trashing sys.stdout and restoring each function call but none of those help. Is there any way how to do this. Modifying PyML is not an option. 回答1: Open /dev/null