You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by Sameer Tilak <ss...@live.com> on 2014/10/30 05:20:57 UTC

MLLib: libsvm - default value initialization

Hi All,I have my sparse data in libsvm format. 

val examples: RDD[LabeledPoint] = MLUtils.loadLibSVMFile(sc, "mllib/data/sample_libsvm_data.txt")
I am running Linear regression. Let us say that my data has following entry:1 1:0  4:1
I think it will assume 0 for indices 2 and 3, right? I would like to make default values to be 0.5  instead of 0. Is it possible? If not, I will have to switch to dense data and it will significantly increase the data size for me.  		 	   		  

Re: MLLib: libsvm - default value initialization

Posted by Xiangrui Meng <me...@gmail.com>.
You can remove 0.5 from all non-zeros. -Xiangrui

On Wed, Oct 29, 2014 at 9:20 PM, Sameer Tilak <ss...@live.com> wrote:
> Hi All,
> I have my sparse data in libsvm format.
>
> val examples: RDD[LabeledPoint] = MLUtils.loadLibSVMFile(sc,
> "mllib/data/sample_libsvm_data.txt")
>
> I am running Linear regression. Let us say that my data has following entry:
> 1 1:0  4:1
>
> I think it will assume 0 for indices 2 and 3, right? I would like to make
> default values to be 0.5  instead of 0. Is it possible? If not, I will have
> to switch to dense data and it will significantly increase the data size for
> me.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@spark.apache.org
For additional commands, e-mail: user-help@spark.apache.org