51#include "EST_FMatrix.h"
52#include "EST_multistats.h"
54static WDlist *wagon_decision_list();
62 dlist = wagon_decision_list();
66 if (wgn_test_dataset.width() > 0)
67 do_dlist_summary(
dlist,wgn_test_dataset);
69 do_dlist_summary(
dlist,wgn_dataset);
84 for (p=
dataset.head(); p != 0; p=p->next())
88 real = wgn_discretes[type].name(
dataset(p)->get_int_val(0));
89 pairs.add_item(real,predict,1);
91 for (i=0; i<wgn_discretes[
dataset.ftype(0)].length(); i++)
92 lex.append(wgn_discretes[
dataset.ftype(0)].name(i));
99static WDlist *wagon_decision_list()
111 for (i=1;i < wgn_dataset.width(); i++)
113 if (wgn_dataset.ftype(i) == wndt_ignore)
115 else if (wgn_dataset.ftype(i) >= wndt_class)
118 ques.set_oper(wnop_is);
119 for (
cl=0;
cl < wgn_discretes[wgn_dataset.ftype(i)].length();
cl++)
122 d = dlist_score_question(
ques,wgn_dataset);
141 for (i=0,d=
ds.head(); d != 0; d=d->next(),i++)
144 if (
q.ask(*
wv) == TRUE)
145 y.cumulate((*
wv)[0]);
148 if (
y.samples() > wgn_min_cluster_size)
150 q.set_yes((
int)
y.samples());
166 n->set_best(t,(
int)f,(
int)pd.
samples());
184 if (p_question.ask(d))
189 return next->predict(d);
201 for (
lp=0,p=l; p != 0;
lp=p,p=p->next)
203 if (a->score() > p->score())
225 s <<
dlist.p_question;
228 s <<
" " <<
dlist.p_freq <<
" " <<
dlist.p_samples <<
229 " " <<
dlist.p_token <<
"))";
void item_freq(EST_Litem *idx, EST_String &s, double &freq) const
During iteration returns name and frequency given index
const EST_String & most_probable(double *prob=NULL) const
Return the most probable member of the distribution.
double samples(void) const
Total number of example found.