50 #define wagon_error(WMESS) (std::cerr << WMESS << std::endl,exit(-1)) 54 #define WGN_HUGE_VAL 1.0e20 86 void load_description(
const EST_String& descfname,LISP ignores);
87 void ignore_non_numbers();
89 int ftype(
const int &i)
const {
return p_type(i);}
90 int ignore(
int i)
const {
return p_ignore(i); }
91 void set_ignore(
int i,
int value) { p_ignore[i] = value; }
94 int width(
void)
const {
return dlength;}
114 this->feature_pos = 0;}
116 { feature_pos=s.feature_pos;
117 op=s.op; yes=s.yes; no=s.no; operand1=s.operand1;
118 operandl = s.operandl; score=s.score;}
121 { feature_pos=
fp; op=o; operand1=
a; }
129 int get_fp(
void)
const {
return feature_pos;}
135 int ask(
const WVector &w)
const;
150 float cluster_impurity();
151 float cluster_member_mean(
int i);
152 float vector_impurity();
153 float trajectory_impurity();
154 float ols_impurity();
178 for (j=0; j<width; j++)
186 double samples(
void);
188 void cumulate(
const float pv,
double count=1.0);
191 float cluster_distance(
int i);
192 int in_cluster(
int i);
193 float cluster_ranking(
int i);
216 { p_token = t; p_freq = freq; p_samples = samples;}
217 float score()
const {
return p_score;}
232 void print_out(ostream &s,
int margin);
233 int leaf(
void)
const {
return ((left == 0) || (right == 0)); }
238 if (right != 0) {
delete right; right=0;} }
244 void held_out_prune(
void);
285 #define wgn_ques_feature(X) (get_c_string(car(X))) 286 #define wgn_ques_oper_str(X) (get_c_string(car(cdr(X)))) 287 #define wgn_ques_operand(X) (car(cdr(cdr(X))))
const WVectorVector * data
EST_String wgn_vertex_output
float wgn_score_question(WQuestion &q, WVectorVector &ds)
EST_TList< WVector * > WVectorList
void wgn_load_datadescription(EST_String fname, LISP ignores)
void set_fp(const int &fp)
WQuestion(int fp, wn_oper o, EST_Val a)
void set_ignore(int i, int value)
A vector class for floating point numbers. EST_FVector x should be used instead of float *x wherever ...
WImpurity & get_impurity(void)
STATIC void left(STATUS Change)
void wgn_find_split(WQuestion &q, WVectorVector &ds, WVectorVector &y, WVectorVector &n)
void set_question(const WQuestion &q)
STATIC void right(STATUS Change)
int ols_test(const EST_FMatrix &real, const EST_FMatrix &predicted, float &correlation, float &rmse)
wn_oper get_op(void) const
INLINE const float & a_no_check(ssize_t n) const
read-only const access operator: without bounds checking
friend std::ostream & operator<<(std::ostream &st, const EST_TVector< float > &m)
print out vector.
EST_SuffStats ** trajectory
EST_TVector< WVector * > WVectorVector
const float & a_check(ssize_t n) const
read-only const access operator: with bounds checking
const float & a(ssize_t n) const
WQuestion & get_question(void)
int robust_ols(const EST_FMatrix &X, const EST_FMatrix &Y, EST_IVector &included, EST_FMatrix &coeffs)
const EST_String & token(void) const
void set_subnodes(WNode *l, WNode *r)
void copy(const WImpurity &s)
void set_flt_val(int n, float f)
void set_operand1(const EST_Val &a)
INLINE ssize_t length() const
number of items in vector.
void set_no(const int &n)
WNode * wagon_stepwise(float limit)
void set_yes(const int &y)
WNode * wgn_build_dlist(float &score, ostream *output)
const EST_String & feat_name(const int &i) const
const WQuestion & question() const
void set_impurity(const WImpurity &imp)
EST_TVector< T > & copy(EST_TVector< T > a, const EST_TList< T > &in)
EST_String wgn_count_field_name
EST_TSimpleVector & operator=(const EST_TSimpleVector< float > &s)
assignment operator
EST_FMatrix wgn_DistMatrix
WDlist * add_to_dlist(WDlist *l, WDlist *a)
void set_score(const float &f)
EST_String wgn_predictee_name
float correlation(EST_Track &a, EST_Track &b, ssize_t channel)
void reset(void)
reset internal values
EST_Track wgn_VertexTrack
const EST_IList & get_operandl(void) const
const EST_Val get_operand1(void) const
WVectorVector & get_data(void)
void set_question(const WQuestion &q)
float summary_results(WNode &tree, ostream *output)
float get_score(void) const
int wagon_ask_question(LISP question, LISP value)
int stepwise_ols(const EST_FMatrix &X, const EST_FMatrix &Y, const EST_StrList &feat_names, float limit, EST_FMatrix &coeffs, const EST_FMatrix &Xtest, const EST_FMatrix &Ytest, EST_IVector &included, float &best_score)
EST_DiscreteProbDistribution & pd()
void wgn_load_dataset(WDataSet &ds, EST_String fname)
int get_int_val(int n) const
float get_flt_val(int n) const
void set_int_val(int n, int i)
float wgn_float_range_split
void set_oper(const wn_oper &o)
EST_Track wgn_VertexFeats
int ftype(const int &i) const
INLINE ssize_t n() const
number of items in vector.
void set_best(const EST_String &t, int freq, int samples)
WQuestion(const WQuestion &s)
WDataSet wgn_test_dataset
int ols_apply(const EST_FMatrix &samples, const EST_FMatrix &coeffs, EST_FMatrix &res)
WNode * wgn_build_tree(float &score)
wnim_type type(void) const