imbalanced_svr.ensemble.tree#

class imbalanced_spdf.ensemble.tree[source]#
__init__()[source]#

Methods

Compute_Impu(wy, w[, criterion])

Compute impurity of a node.

Compute_NodeImpu(wyleft, wleft, wy, w[, ...])

Compute impurity of a node after a partition.

Compute_SignImpu(wy, w, label[, criterion])

Compute signed impurity of a node.

Compute_SignNodeImpu(wyleft, wleft, wy, w, ...)

Compute signed impurity of a node after a partition.

Overlap_Rec(rec1, rec2)

VC(X)

__init__()

copy()

Copy the current tree represented by "self".

data_standardize(X)

A function of class tree which linearly transfers feature matrix to [0,1]^d.

fit_sv(X, Y, pen[, c0, weight, border, ...])

localpredict(X)

This recursive functions is called by function "predict" to complete its taks of predicting class labels.

predict(X)

This function return predict class labels for a new data using the tree "self".

print([init, print_weight, print_impu])

This function print a tree.

surface_funs(rec, label, reclst0, labellst0)

Returns all the necessary parameters to compute the change of surface of the whole tree once a new partition at rec is made.

sv_regular(surface, volume, d)

Compute surface-to-volume regularization.

vc(d)

static Compute_Impu(wy, w, criterion='gini')[source]#

Compute impurity of a node.

static Compute_NodeImpu(wyleft, wleft, wy, w, criterion='gini')[source]#

Compute impurity of a node after a partition.

static Compute_SignImpu(wy, w, label, criterion='gini')[source]#

Compute signed impurity of a node.

static Compute_SignNodeImpu(wyleft, wleft, wy, w, child_labels, criterion='gini')[source]#

Compute signed impurity of a node after a partition.

copy()[source]#

Copy the current tree represented by “self”.

data_standardize(X)[source]#

A function of class tree which linearly transfers feature matrix to [0,1]^d.

localpredict(X)[source]#

This recursive functions is called by function “predict” to complete its taks of predicting class labels.

predict(X)[source]#

This function return predict class labels for a new data using the tree “self”.

Parameters:

X (ndarray) – Feature matrix of new data. Must has the same number of features as the training data.

Returns:

var – One-dimensional array contains the predicted class labels of new data.

Return type:

ndarray

print(init=True, print_weight=False, print_impu=False)[source]#

This function print a tree.

Parameters:
  • init (boolean) – Whether the printing is started from root node. If not called by the the function “print” itself, it should always set to be True. Default value is True.

  • print_weight (boolean) – Whether to print the weight of training samples in each node. Default is False.

  • print_impu (boolean) – Whether to print the impurity of training samples in each node. Default is False.

Returns:

  • This function returns nothing.

  • Outputs

  • ——-

  • This function will print all the nodes of the tree in a depth-first order.

surface_funs(rec, label, reclst0, labellst0, epsilon=1e-12)[source]#

Returns all the necessary parameters to compute the change of surface of the whole tree once a new partition at rec is made. Currently only working for d>=3. This function concerns all surfaces bordering and inside rec.

static sv_regular(surface, volume, d)[source]#

Compute surface-to-volume regularization.