Changeset 10675:d820ffbd6b17 in orange


Ignore:
Timestamp:
03/28/12 14:50:56 (2 years ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

Convert the instance domain prior to prediction.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/orange/liblinear_interface.cpp

    r9409 r10675  
    371371 
    372372PDistribution TLinearClassifier::classDistribution(const TExample &example){ 
     373    TExample new_example(domain, example); 
    373374    int numClass = get_nr_class(linmodel); 
    374375    map<int, int> indexMap; 
    375     feature_node *x = feature_nodeFromExample(example, indexMap, false); 
     376    feature_node *x = feature_nodeFromExample(new_example, indexMap, false); 
    376377 
    377378    int *labels = new int [numClass]; 
     
    392393 
    393394TValue TLinearClassifier::operator () (const TExample &example){ 
     395    TExample new_example(domain, example); 
    394396    int numClass = get_nr_class(linmodel); 
    395397    map<int, int> indexMap; 
    396     feature_node *x = feature_nodeFromExample(example, indexMap, false); 
    397  
    398     int predict_label = predict(linmodel ,x); 
     398    feature_node *x = feature_nodeFromExample(new_example, indexMap, false); 
     399 
     400    int predict_label = predict(linmodel, x); 
    399401    delete[] x; 
    400402    return TValue(predict_label); 
Note: See TracChangeset for help on using the changeset viewer.