Changeset 4612:caf037ed2b1f in orange


Ignore:
Timestamp:
04/28/08 10:14:54 (6 years ago)
Author:
ales_erjavec <ales.erjavec@…>
Branch:
default
Convert:
fe3d0b58d4cb645ba496d866b7deefcb05379ceb
Message:

-fixed categorical attribute handling
-commented some printf statements

Location:
source/orange
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • source/orange/linear.cpp

    r4597 r4612  
    13171317            delta = max(delta, min(alpha*snorm, sigma3*delta)); 
    13181318 
    1319         printf("iter %2d act %5.3e pre %5.3e delta %5.3e f %5.3e |g| %5.3e CG %3d\n", iter, actred, prered, delta, f, gnorm, cg_iter); 
     1319        //printf("iter %2d act %5.3e pre %5.3e delta %5.3e f %5.3e |g| %5.3e CG %3d\n", iter, actred, prered, delta, f, gnorm, cg_iter); 
    13201320 
    13211321        if (actred > eta0*prered) 
     
    13841384        if (dnrm2_(&n, s, &inc) > delta) 
    13851385        { 
    1386             printf("cg reaches trust region boundary\n"); 
     1386            //printf("cg reaches trust region boundary\n"); 
    13871387            alpha = -alpha; 
    13881388            daxpy_(&n, &alpha, d, &inc, s, &inc); 
     
    16161616        for (TExample::iterator i=ex.begin(); i!=ex.end(); i++){ 
    16171617            if ((i->varType==TValue::INTVAR || i->varType==TValue::FLOATVAR) && i->isRegular() && i!=&ex.getClass()){ 
    1618                 ptr->value = (float) *i; 
     1618                if (i->varType==TValue::INTVAR) 
     1619                    ptr->value = (int) *i; 
     1620                else 
     1621                    ptr->value = (float) *i; 
    16191622                ptr->index = index; 
    16201623                if (indexMap.find(index)==indexMap.end()){ 
  • source/orange/linear.hpp

    r4597 r4612  
    195195 
    196196    PFloatListList weights; //P Computed feature weights 
    197     PExampleTable examples; //P Examples used to train the classificator 
     197    PExampleTable examples; //P Examples used to train the classifier 
    198198 
    199199    model *getModel(){ return linmodel; } 
     
    202202    map<int, int> *indexMap; 
    203203}; 
    204  
     204/* 
     205class O_RANGE_API TLinearClassifierSparse : public TLinearClassifier{ 
     206public: 
     207    __R_EGISTER_CLASS 
     208    TLinearClassifierSparse() {}; 
     209    TLinearClassifier(const PVariable &var, PExampleTable examples, model *_model, map<int, int> *indexMap=NULL); 
     210    ~TLinearClassifier(); 
     211 
     212    PDistribution classDistribution(const TExample &); 
     213    TValue operator()(const TExample&); 
     214};*/ 
    205215WRAPPER(LinearLearner) 
    206216WRAPPER(LinearClassifier) 
Note: See TracChangeset for help on using the changeset viewer.