56 static WDlist *wagon_decision_list();
64 dlist = wagon_decision_list();
86 for (p=dataset.
head(); p != 0; p=p->
next())
89 type = dataset.
ftype(0);
101 static WDlist *wagon_decision_list()
143 for (i=0,d=ds.
head(); d != 0; d=d->
next(),i++)
170 #if 0 // original two-case code 175 n->
set_score(fabs(log((0.0001+freqa)/(0.0001+freqb))));
176 n->set_freqs(freqa,freqb);
186 if (p_question.ask(d))
191 return next->predict(d);
203 for (lp=0,p=l; p != 0; lp=p,p=p->next)
205 if (a->
score() > p->score())
227 s << dlist.p_question;
230 s <<
" " << dlist.p_freq <<
" " << dlist.p_samples <<
231 " " << dlist.p_token <<
"))";
const EST_String & most_probable(double *prob=NULL) const
Return the most probable member of the distribution.
void set_fp(const int &fp)
double samples(void) const
Total number of example found.
ostream & operator<<(ostream &s, WDlist &dlist)
int ask(const WVector &w) const
EST_Val predict(const WVector &w)
void print_confusion(const EST_FMatrix &a, EST_StrStr_KVL &list, EST_StrList &lex)
double frequency(const EST_String &s) const
void cumulate(const float pv, double count=1.0)
void set_operand1(const EST_Val &a)
void item_freq(EST_Litem *idx, EST_String &s, double &freq) const
During iteration returns name and frequency given index.
void set_yes(const int &y)
EST_FMatrix confusion(EST_StrStr_KVL &list, EST_StrList &lex)
WNode * wgn_build_dlist(float &score, ostream *output)
WDlist * add_to_dlist(WDlist *l, WDlist *a)
void append(const T &item)
add item onto end of list
int add_item(const K &rkey, const V &rval, int no_search=0)
add key-val pair to list
void set_question(const WQuestion &q)
EST_DiscreteProbDistribution & pd()
void set_oper(const wn_oper &o)
int ftype(const int &i) const
void set_best(const EST_String &t, int freq, int samples)
WDataSet wgn_test_dataset