Re: mllib vector templates

2014-05-16 Thread Xiangrui Meng
3) It is not designed for dense feature vectors. On Thu, May 15, 2014 at 8:33 PM, Xiangrui Meng wrote: > I submitted a PR for standardizing the text format for vectors and > labeled data: https://github.com/apache/spark/pull/685 > > Once it gets merged, saveAsTextFile and loading should be consis

Re: mllib vector templates

2014-05-16 Thread Xiangrui Meng
I submitted a PR for standardizing the text format for vectors and labeled data: https://github.com/apache/spark/pull/685 Once it gets merged, saveAsTextFile and loading should be consistent. I didn't choose LibSVM as the default format because two reasons: 1) It doesn't contain feature dimension

Re: mllib vector templates

2014-05-12 Thread Debasish Das
Hi, I see ALS is still using Array[Int] but for other mllib algorithm we moved to Vector[Double] so that it can support either dense and sparse formats... I know ALS can stay in Array[Int] due to the Netflix format for input datasets which is well defined but it helps if we move ALS to Vector[Dou

Re: mllib vector templates

2014-05-11 Thread Debasish Das
Hi, I see ALS is still using Array[Int] but for other mllib algorithm we moved to Vector[Double] so that it can support either dense and sparse formats... ALS can stay in Array[Int] due to the Netflix format for input datasets which is well defined but it helps if we move ALS to Vector[Double] as

Re: mllib vector templates

2014-05-05 Thread David Hall
On Mon, May 5, 2014 at 3:40 PM, DB Tsai wrote: > David, > > Could we use Int, Long, Float as the data feature spaces, and Double for > optimizer? > Yes. Breeze doesn't allow operations on mixed types, so you'd need to convert the double vectors to Floats if you wanted, e.g. dot product with the

Re: mllib vector templates

2014-05-05 Thread Xiangrui Meng
I fixed index type and value type to make things simple, especially when we need to provide Java and Python APIs. For raw features and feature transmations, we should allow generic types. -Xiangrui On Mon, May 5, 2014 at 3:40 PM, DB Tsai wrote: > David, > > Could we use Int, Long, Float as the da

Re: mllib vector templates

2014-05-05 Thread DB Tsai
David, Could we use Int, Long, Float as the data feature spaces, and Double for optimizer? Sincerely, DB Tsai --- My Blog: https://www.dbtsai.com LinkedIn: https://www.linkedin.com/in/dbtsai On Mon, May 5, 2014 at 3:06 PM, David Hall wrote:

Re: mllib vector templates

2014-05-05 Thread David Hall
I should mention it shouldn't be too hard to change, but it is a current limitation. On May 5, 2014 3:12 PM, "Debasish Das" wrote: > Is any one facing issues due to this ? If not then I guess doubles are > fine... > > For me it's not a big deal as there is enough memory available... > > > On Mon,

Re: mllib vector templates

2014-05-05 Thread Debasish Das
Is any one facing issues due to this ? If not then I guess doubles are fine... For me it's not a big deal as there is enough memory available... On Mon, May 5, 2014 at 3:06 PM, David Hall wrote: > Lbfgs and other optimizers would not work immediately, as they require > vector spaces over doubl

Re: mllib vector templates

2014-05-05 Thread David Hall
Lbfgs and other optimizers would not work immediately, as they require vector spaces over double. Otherwise it should work. On May 5, 2014 3:03 PM, "DB Tsai" wrote: > Breeze could take any type (Int, Long, Double, and Float) in the matrix > template. > > > Sincerely, > > DB Tsai > ---

Re: mllib vector templates

2014-05-05 Thread DB Tsai
Breeze could take any type (Int, Long, Double, and Float) in the matrix template. Sincerely, DB Tsai --- My Blog: https://www.dbtsai.com LinkedIn: https://www.linkedin.com/in/dbtsai On Mon, May 5, 2014 at 2:56 PM, Debasish Das wrote: > Is th

Re: mllib vector templates

2014-05-05 Thread Debasish Das
Is this a breeze issue or breeze can take templates on float / double ? If breeze can take templates then it is a minor fix for Vectors.scala right ? Thanks. Deb On Mon, May 5, 2014 at 2:45 PM, DB Tsai wrote: > +1 Would be nice that we can use different type in Vector. > > > Sincerely, > > D

Re: mllib vector templates

2014-05-05 Thread DB Tsai
+1 Would be nice that we can use different type in Vector. Sincerely, DB Tsai --- My Blog: https://www.dbtsai.com LinkedIn: https://www.linkedin.com/in/dbtsai On Mon, May 5, 2014 at 2:41 PM, Debasish Das wrote: > Hi, > > Why mllib vector is

mllib vector templates

2014-05-05 Thread Debasish Das
Hi, Why mllib vector is using double as default ? /** * Represents a numeric vector, whose index type is Int and value type is Double. */ trait Vector extends Serializable { /** * Size of the vector. */ def size: Int /** * Converts the instance to a double array. *