Pages: [1]
  Print  
Author Topic: Using SVM with features from external tool  (Read 1463 times)
svm_friend
Newbie
*
Posts: 3


« on: October 15, 2008, 04:09:38 PM »

I wrote some code that generates my feature vectors I want to use for training an SVM.

So far I have been using LibSVM and my feature format is like this:

<class> .=. +1 | -1 | 0
<feature> .=. integer
<value> .=. real
<line> .=. <class> <feature>:<value> <feature>:<value> ... <feature>:<value>

Example:
1 1:0.11764705882352941 2:0.25
1 1:0.11764705882352941 2:0.25

What I want to do is:

Load my feature file
Do some cross validation by generating different models and evaluate on the remaining data and finally create some ROC and Prec/Recall-Charts..

Is that possible? Does RM recognize the format?
Logged
Sebastian Land
Administrator
Hero Member
*****
Posts: 2426


« Reply #1 on: October 15, 2008, 11:15:49 PM »

Hi,
usually the data format just contains all values blank seperated, one example per line.
But since RapidMiner uses regular expressions to split the values, we could use the regular expression "\s+[0-9]*:" to use the blank, feature names and the : as seperator.
This is only possible, if your formate is not sparse, does not leave out some features or rearrangs in different lines them!
Use this as regular expression in the ExampleSource ConfigurationWizard.

For the rest of the processes, take a look on the samples shipped with rapidMiner.

Greetings,
  Sebastian
Logged
svm_friend
Newbie
*
Posts: 3


« Reply #2 on: October 16, 2008, 02:54:12 PM »

Unfortunately I do sparse features like

1 6:0.0 7:0.875
1 4:1.0 6:0.8333333333333334 7:0.6956521739130435
1 4:1.0 6:0.625 7:0.7368421052631579
1 4:1.0 6:0.3333333333333333 7:0.11764705882352941
1 6:0.6 7:0.875
1 6:0.0 7:0.8333333333333334
1 2:0.9166666666666666 4:0.0 6:0.5 7:0.6666666666666666

Is it possible to store those values in a csv file and pass that to the Rapidminer like

#Class;   F1;   F2;   F3;   F4;
1;   1;   ;   2;   ;
1;   1;   1;   ;   1;4

I would just leave the space blank between the seperators?
Logged
Tobias Malbrecht
Global Moderator
Sr. Member
*****
Posts: 293



WWW
« Reply #3 on: October 16, 2008, 05:11:51 PM »

Hi,

yes, it is possible to have missing values in csv files when you load them into RapidMiner.

Regards,
Tobias
Logged

Tobias Malbrecht
Director of Product Marketing
RapidMiner
Pages: [1]
  Print  
 
Jump to: