Ignore:
Timestamp:
08/22/13 20:23:29 (8 months ago)
Author:
Björn Esser <bjoern.esser@…>
Branch:
default
committer:
426ac3b6726e204573736572203c626a6f65726e2e657373657240676d61696c2e636f6d3e2031333737323834343333202d37323030
Message:

Updated the included LIBLINEAR to version 1.93.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/orange/liblinear_interface.cpp

    r11611 r11670  
    3838{ 
    3939    "L2R_LR", "L2R_L2LOSS_SVC_DUAL", "L2R_L2LOSS_SVC", "L2R_L1LOSS_SVC_DUAL", "MCSVM_CS", 
    40     "L1R_L2LOSS_SVC", "L1R_LR", "L2R_LR_DUAL", NULL 
     40    "L1R_L2LOSS_SVC", "L1R_LR", "L2R_LR_DUAL", 
     41 
     42    #ifndef WITH_API_LIBLINEAR18 
     43        "", "", "", 
     44        "L2R_L2LOSS_SVR", "L2R_L2LOSS_SVR_DUAL", "L2R_L1LOSS_SVR_DUAL", 
     45    #endif 
     46 
     47    NULL 
    4148}; 
    4249 
     
    280287 
    281288    prob->x = new feature_node* [prob->l]; 
    282     prob->y = new int [prob->l]; 
     289 
     290    #ifndef WITH_API_LIBLINEAR18 
     291        prob->y = new double [prob->l]; 
     292    #else 
     293        prob->y = new int [prob->l]; 
     294    #endif 
     295 
    283296    prob->bias = bias; 
    284297    feature_node **ptrX = prob->x; 
    285     int *ptrY = prob->y; 
     298 
     299    #ifndef WITH_API_LIBLINEAR18 
     300        double *ptrY = prob->y; 
     301    #else 
     302        int *ptrY = prob->y; 
     303    #endif 
     304 
    286305    PEITERATE(iter, examples){ 
    287306        *ptrX = feature_nodeFromExample(*iter, bias); 
    288         *ptrY = (int) (*iter).getClass(); 
     307 
     308        #ifndef WITH_API_LIBLINEAR18 
     309            *ptrY = (double) (*iter).getClass().intV; 
     310        #else 
     311            *ptrY = (int) (*iter).getClass(); 
     312        #endif 
     313 
    289314        ptrX++; 
    290315        ptrY++; 
     
    407432    param->weight = NULL; 
    408433 
     434    #ifndef WITH_API_LIBLINEAR18 
     435        param->p = NULL; 
     436    #endif 
     437 
    409438    // Shallow copy of examples. 
    410439    PExampleTable train_data = mlnew TExampleTable(examples, /* owns= */ false); 
     
    506535    feature_node *x = feature_nodeFromExample(new_example, bias); 
    507536 
    508     int predict_label = predict(linmodel, x); 
     537    #ifndef WITH_API_LIBLINEAR18 
     538        double predict_label = predict(linmodel, x); 
     539    #else 
     540        int predict_label = predict(linmodel, x); 
     541    #endif 
     542 
    509543    delete[] x; 
    510     return TValue(predict_label); 
    511 } 
     544 
     545    #ifndef WITH_API_LIBLINEAR18 
     546        return TValue((int) predict_label); 
     547    #else 
     548        return TValue(predict_label); 
     549    #endif 
     550} 
Note: See TracChangeset for help on using the changeset viewer.