Re: Problem in running MLlib SVM

2015-12-01 Thread Joseph Bradley
Oh, sorry about that. I forgot that's the behavior when the threshold is not set. My guess would be that you need more iterations, or that the regParam needs to be tuned. I'd recommend testing on some of the LibSVM datasets. They have a lot, and you can find existing examples (and results) for

Re: Problem in running MLlib SVM

2015-12-01 Thread Robert Dodier
range of outputs -- something like -6*10^6 to -400, with a mean of about -3. If you look into it, let us know what you find, I would be interested to hear about it. best, Robert Dodier -- View this message in context: http://apache-spark-developers-list.1001551.n3.nabble.com/Problem-in-r

Re: Problem in running MLlib SVM

2015-11-30 Thread Fazlan Nazeem
You should never use the training data to measure your prediction accuracy. Always use a fresh dataset (test data) for this purpose. On Sun, Nov 29, 2015 at 8:36 AM, Jeff Zhang wrote: > I think this should represent the label of LabledPoint (0 means negative 1 > means

Re: Problem in running MLlib SVM

2015-11-30 Thread Joseph Bradley
model.predict should return a 0/1 predicted label. The example code is misleading when it calls the prediction a "score." On Mon, Nov 30, 2015 at 9:13 AM, Fazlan Nazeem wrote: > You should never use the training data to measure your prediction > accuracy. Always use a fresh

Re: Problem in running MLlib SVM

2015-11-28 Thread Jeff Zhang
if((score >=0 && label == 1) || (score <0 && label == 0)) { return 1; //correct classiciation } else return 0; I suspect score is always between 0 and 1 On Sat, Nov 28, 2015 at 10:39 AM, Tarek Elgamal

Re: Problem in running MLlib SVM

2015-11-28 Thread Jeff Zhang
I think this should represent the label of LabledPoint (0 means negative 1 means positive) http://spark.apache.org/docs/latest/mllib-data-types.html#labeled-point The document you mention is for the mathematical formula, not the implementation. On Sun, Nov 29, 2015 at 9:13 AM, Tarek Elgamal

Re: Problem in running MLlib SVM

2015-11-28 Thread Tarek Elgamal
According to the documentation , by default, if wTx≥0 then the outcome is positive, and negative otherwise. I suppose that wTx is the "score" in my case. If score is more than 0 and the label is positive, then I return 1 which is

Problem in running MLlib SVM

2015-11-27 Thread Tarek Elgamal
Hi, I am trying to run the straightforward example of SVm but I am getting low accuracy (around 50%) when I predict using the same data I used for training. I am probably doing the prediction in a wrong way. My code is below. I would appreciate any help. import java.util.List; import