|
| Program ()=default |
|
| Program (const std::reference_wrapper< SearchSpace > s, const tree< Node > t) |
|
Program< PType > | copy () |
|
void | set_search_space (const std::reference_wrapper< SearchSpace > s) |
|
int | complexity () const |
| count the complexity of the program.
|
|
int | size (bool include_weight=true) const |
| count the tree size of the program, including the weights in weighted nodes.
|
|
int | size_at (Iter &top, bool include_weight=true) const |
| count the size of a given subtree, optionally including the weights in weighted nodes. This function is not exposed to the python wrapper.
|
|
int | depth () const |
| count the tree depth of the program. The depth is not influenced by weighted nodes.
|
|
int | depth_at (Iter &top) const |
| count the depth of a given subtree. The depth is not influenced by weighted nodes. This function is not exposed to the python wrapper.
|
|
int | depth_to_reach (Iter &top) const |
| count the depth until reaching the given subtree. The depth is not influenced by weighted nodes. This function is not exposed to the python wrapper.
|
|
Program< PType > & | fit (const Dataset &d) |
|
template<typename R , typename W > |
R | predict_with_weights (const Dataset &d, const W **weights) |
|
auto | predict_with_weights (const Dataset &d, const ArrayXf &weights) |
|
template<typename R = RetType>
requires (is_same_v<R, TreeType>) |
TreeType | predict (const Dataset &d) |
| the standard predict function. Returns the output of the Tree directly.
|
|
template<typename R = RetType>
requires (is_same_v<R, ArrayXb>) |
ArrayXb | predict (const Dataset &d) |
| Specialized predict function for binary classification.
|
|
template<typename R = RetType>
requires (is_same_v<R, ArrayXi>) |
ArrayXi | predict (const Dataset &d) |
| Specialized predict function for multiclass classification.
|
|
template<PT P = PType>
requires ((P == PT::BinaryClassifier) || (P == PT::MulticlassClassifier)) |
TreeType | predict_proba (const Dataset &d) |
|
Program< PType > & | fit (const Ref< const ArrayXXf > &X, const Ref< const ArrayXf > &y) |
| Convenience function to call fit directly from X,y data.
|
|
RetType | predict (const Ref< const ArrayXXf > &X) |
| Convenience function to call predict directly from X data.
|
|
template<PT P = PType>
requires ((P == PT::BinaryClassifier) || (P == PT::MulticlassClassifier)) |
TreeType | predict_proba (const Ref< const ArrayXXf > &X) |
| Predict probabilities from X.
|
|
void | update_weights (const Dataset &d) |
| Updates the program's weights using non-linear least squares.
|
|
int | get_n_weights () const |
| returns the number of weights in the program.
|
|
ArrayXf | get_weights () |
| Get the weights of the tree as an array.
|
|
void | set_weights (const ArrayXf &weights) |
| Set the weights in the tree from an array of weights.
|
|
string | get_model (string fmt="compact", bool pretty=false) const |
| Get the model as a string.
|
|
string | get_dot_model (string extras="") const |
| Get the model as a dot object.
|
|
vector< Node > | linearize () const |
| turns program tree into a linear program.
|
|
template<
PT PType>
struct Brush::Program< PType >
An individual program, a.k.a. model.
- Template Parameters
-
PType | one of the ProgramType enum values. |
Definition at line 49 of file program.h.