Changeset 4652:f0660b036631 in orange


Ignore:
Timestamp:
05/16/08 20:27:08 (6 years ago)
Author:
janezd <janez.demsar@…>
Branch:
default
Convert:
b94a9fe40fa4704b591668e448ff76c5e52023b7
Message:
  • if a certain attribute value A did not appear in the data, Bayes learner assumed priors P(C|A) = 1/#classes. Now it assumes the priors from the data (technically, it just ignores the attribute during classification)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/orange/bayes.cpp

    r4618 r4652  
    186186      // If we have a contingency, that's great 
    187187      if (dciOK && *dci) { 
    188         *result *= (*dci)->p(*ei); 
     188        PDistribution cp = (*dci)->p(*ei); 
     189        if (cp->cases > 1e-6) { 
     190          *result *= cp; 
     191          *result /= *classDistDiv; 
     192        } 
    189193      } 
    190194 
     
    208212 
    209213          *result *= nd; 
     214          *result /= *classDistDiv; 
    210215        } 
    211216      } 
    212217 
    213       *result /= *classDistDiv; 
    214218      result->normalize(); 
    215219    } 
Note: See TracChangeset for help on using the changeset viewer.