Changeset 3637:5fe1976a5597 in orange


Ignore:
Timestamp:
05/09/07 11:03:16 (7 years ago)
Author:
ales_erjavec <ales.erjavec@…>
Branch:
default
Convert:
f257bfe857d0580903e81cc90d3056a0bbba7edf
Message:

SVM pickling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/orange/svm.cpp

    r3635 r3637  
    36593659    int *labels=(int *) malloc(nr_class*sizeof(int)); 
    36603660    double *prob_estimates=NULL; 
    3661     svm_node *x=Malloc(svm_node, exlen+1); 
     3661    svm_node *x=Malloc(svm_node, (exlen+1>2)? exlen+1 : 2); 
    36623662    svm_get_labels(model,labels); 
    36633663    prob_estimates = (double *) malloc(nr_class*sizeof(double)); 
    3664     example_to_svm(example, x, -1.0);//, (model->param.kernel_type==CUSTOM)? 2:0); 
     3664    example_to_svm(example, x, -1.0, (model->param.kernel_type==CUSTOM)? 1:0); 
    36653665    svm_predict_probability(model,x,prob_estimates); 
    36663666    currentExample=NULL; 
     
    37083708    int svm_type=svm_get_svm_type(model); 
    37093709    int nr_class=svm_get_nr_class(model); 
    3710     svm_node *x=Malloc(svm_node, exlen+1); 
    3711     example_to_svm(example, x, -1.0);//, (model->param.kernel_type==CUSTOM)? 2:0); 
     3710    svm_node *x=Malloc(svm_node, (exlen+1>2)? exlen+1 : 2); 
     3711    example_to_svm(example, x, -1.0, (model->param.kernel_type==CUSTOM)? 1:0); 
    37123712    int nDecValues=nr_class*(nr_class-1)/2; 
    37133713    double *dec= (double*) malloc(sizeof(double)*nDecValues); 
Note: See TracChangeset for help on using the changeset viewer.