Re: [Scikit-learn-general] read libsvm format data

2012-05-31 Thread Olivier Grisel
2012/5/31 Lars Buitinck : > 2012/5/31, Mathieu Blondel : >> Sheila's question made me realize that we could have returned Bunch objects >> in load_svmlight_file(). Not sure if it's worth breaking the API just for >> that, though. > > Bunches are mostly useful when there are target names as well as

Re: [Scikit-learn-general] read libsvm format data

2012-05-31 Thread Lars Buitinck
2012/5/31, Mathieu Blondel : > Sheila's question made me realize that we could have returned Bunch objects > in load_svmlight_file(). Not sure if it's worth breaking the API just for > that, though. Bunches are mostly useful when there are target names as well as indices, for classifiers that don'

Re: [Scikit-learn-general] read libsvm format data

2012-05-31 Thread Mathieu Blondel
On Thu, May 31, 2012 at 7:58 PM, Sheila the angel wrote: > Thanks Peter, > it helps. But just wondering why load_svmlight_file() gives sparse matrix > (CSR format) and a numpy array!! > Is there any other way to use load_svmlight_file() return object directly > for analysis (without using X_train

Re: [Scikit-learn-general] read libsvm format data

2012-05-31 Thread Lars Buitinck
2012/5/31, Sheila the angel : > it helps. But just wondering why load_svmlight_file() gives sparse matrix > (CSR format) and a numpy array!! Because this format is commonly used to exchange sparse matrices that are too large to fit in NumPy arrays. > Is there any other way to use load_svmlight_fi

Re: [Scikit-learn-general] read libsvm format data

2012-05-31 Thread amueller
Hi Sheila. I think Peter got the right answer: load_svmlight_File yields a sparse Matrix that you need to convert to an Array First. Cheers, andy -- Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet. Sheila the angel schrieb: Hi Andreas, there is no difference bet

Re: [Scikit-learn-general] read libsvm format data

2012-05-31 Thread Sheila the angel
Thanks Peter, it helps. But just wondering why load_svmlight_file() gives sparse matrix (CSR format) and a numpy array!! Is there any other way to use load_svmlight_file() return object directly for analysis (without using X_train =X_train.toarray() ) On Wed, May 30, 2012 at 7:24 PM, Peter Pretten

Re: [Scikit-learn-general] read libsvm format data

2012-05-31 Thread Sheila the angel
Hi Andreas, there is no difference between two data sets (except scaling). But that is not a issue. Whenever I try to read data from libsvm format file using function load_svmlight_file("file_name") it gives me object which is different then default in tutorials. for example in tutorial- http://sci

Re: [Scikit-learn-general] read libsvm format data

2012-05-30 Thread Peter Prettenhofer
Sheila, ``load_svmlight_file`` gives you a sparse matrix (CSR format) and a numpy array. You can convert the CSR matrix to a numpy array using:: X_train = X_train.toarray() Please check if X_train.shape == iris.data.shape. Hope this helps! best, Peter 2012/5/30 Sheila the angel : > Hi all

Re: [Scikit-learn-general] read libsvm format data

2012-05-30 Thread Andreas Mueller
Hi Sheila. It would help if you could say what the difference between the two datasets is. Given the name "iris.scale" I would assume that it is somehow scaled, either using zero mean, unit variance, between 0 and 1 or l2 normalized. Have you tried using Scaler on the data to see what you get?