Re: [Scikit-learn-general] Data format

2013-03-08 Thread Philipp Singer
Why do you want to convert libsvm to another structure? I don't quite get it. If you want to use examples: scikit learn has included datasets that can be directly loaded. I think this section should help: http://scikit-learn.org/stable/datasets/index.html Am 08.03.2013 18:44, schrieb Mohamed

Re: [Scikit-learn-general] Data format

2013-03-08 Thread Mohamed Radhouane Aniba
Simply because I am new to both python and scikit (Coming from R world) The problem is that I tried using load_svmlight_file with in particular RBF parameters example http://scikit-learn.org/stable/auto_examples/svm/plot_rbf_parameters.html#example-svm-plot-rbf-parameters-py and I get a lot of

Re: [Scikit-learn-general] Data format

2013-03-08 Thread Ronnie Ghose
That uses the Boolean indexing function of numpy arrays iirc On Mar 8, 2013 1:28 PM, Mohamed Radhouane Aniba arad...@gmail.com wrote: Simply because I am new to both python and scikit (Coming from R world) The problem is that I tried using load_svmlight_file with in particular RBF parameters

Re: [Scikit-learn-general] Data format

2013-03-08 Thread Flavio Vinicius
Suppose you have x = np.array([1, 2, 3, 4]) Then x 2 = [False, False, True, True] Using boolean indexing x[x 2] = [3, 4] -- Flavio On Fri, Mar 8, 2013 at 4:41 PM, Ronnie Ghose ronnie.gh...@gmail.com wrote: That uses the Boolean indexing function of numpy arrays iirc On Mar 8, 2013 1:28

Re: [Scikit-learn-general] Data format

2013-03-08 Thread Mohamed Radhouane Aniba
Thank you guys it makes more sense now. I slightly changed the code to fit my data ( I have 6 features) I got then an error message saying : File plot_rbf_parameters.py, line 109, in module Z = clf.decision_function(np.c_[xx.ravel(), yy.ravel()]) File

Re: [Scikit-learn-general] Data format

2013-03-08 Thread Ronnie Ghose
X_2d = X[:, :6] if the data is formatted correctly. Its rows by cols and then slicing. The numpy docs should help On Mar 8, 2013 3:12 PM, Mohamed Radhouane Aniba arad...@gmail.com wrote: Thank you guys it makes more sense now. I slightly changed the code to fit my data ( I have 6 features) I

Re: [Scikit-learn-general] Data format

2013-03-08 Thread Mohamed Radhouane Aniba
Ronnie, This is exactly what I did and that's what shows in the error message saying X.shape[1] = 2 should be equal to 6, the number of features at training time The training was made successfully, best parameters sent to output successfully but then I think it is a bug when rendering the

Re: [Scikit-learn-general] Data format

2013-03-08 Thread Ronnie Ghose
could you by chance upload a part of your data if not all of it / a representation or the like? On Fri, Mar 8, 2013 at 3:21 PM, Mohamed Radhouane Aniba arad...@gmail.comwrote: Ronnie, This is exactly what I did and that's what shows in the error message saying X.shape[1] = 2 should be equal

Re: [Scikit-learn-general] Data format

2013-03-08 Thread Mohamed Radhouane Aniba
Sorry for the format but this is what it looks like -1 1:0.0256992 2:0.89 3:16.2094 4:3.17376 5:1.03704 6:0.161745 -1 1:0.0382503 2:7.159 3:44.5586 4:65.4716 5:24.0289 6:0.168695 1 1:0.0908366 2:10.2772 3:8.25109 4:31.2472 5:47.3532 6:0.163662 -1 1:0.0158669 2:1.87153 3:8.5248 4:2.775