Snode
- class stree.Splitter.Snode(clf: SVC, X: ndarray, y: ndarray, features: array, impurity: float, title: str, weight: ndarray = None, scaler: StandardScaler = None)[source]
Bases:
objectNodes of the tree that keeps the svm classifier and if testing the dataset assigned to it
Parameters
- clfSVC
Classifier used
- Xnp.ndarray
input dataset in train time (only in testing)
- ynp.ndarray
input labes in train time
- featuresnp.array
features used to compute hyperplane
- impurityfloat
impurity of the node
- titlestr
label describing the route to the node
- weightnp.ndarray, optional
weights applied to input dataset in train time, by default None
- scalerStandardScaler, optional
scaler used if any, by default None
- classmethod copy(node: Snode) Snode[source]
- get_classifier() SVC[source]
- get_down() Snode[source]
- get_features() array[source]
- get_impurity() float[source]
- get_partition_column() int[source]
- get_title() str[source]
- get_up() Snode[source]
- graph()[source]
Return a string representing the node in graphviz format
- is_leaf() bool[source]
- make_predictor(num_classes: int) None[source]
Compute the class of the predictor and its belief based on the subdataset of the node only if it is a leaf
- set_classifier(clf)[source]
- set_down(son)[source]
- set_features(features)[source]
- set_impurity(impurity)[source]
- set_partition_column(col: int)[source]
- set_title(title)[source]
- set_up(son)[source]