secretflow.ml.boost.sgb_v.core.pure_numpy_ops#
secretflow.ml.boost.sgb_v.core.pure_numpy_ops.boost#
Functions:
|
compute objective values of input buckets. |
|
|
|
compute weight values of tree leaf nodes. |
|
find the best split buckets and if gains > gamma |
- secretflow.ml.boost.sgb_v.core.pure_numpy_ops.boost.compute_obj(G: ndarray, H: ndarray, reg_lambda: float) ndarray [源代码]#
compute objective values of input buckets.
- 参数:
G/H – sum of first and second order gradient in each bucket.
reg_lambda – L2 regularization term
- 返回:
objective values.
- secretflow.ml.boost.sgb_v.core.pure_numpy_ops.boost.compute_weight_from_node_select(node_select: ndarray, g: ndarray, h: ndarray, reg_lambda: float, learning_rate: float) ndarray [源代码]#
- secretflow.ml.boost.sgb_v.core.pure_numpy_ops.boost.compute_weight(G: float, H: float, reg_lambda: float, learning_rate: float) ndarray [源代码]#
compute weight values of tree leaf nodes.
- 参数:
G/H – sum of first and second order gradient in each node.
reg_lambda – L2 regularization term
learning_rate – Step size shrinkage used in update to prevents overfitting.
- 返回:
weight values.
secretflow.ml.boost.sgb_v.core.pure_numpy_ops.bucket_sum#
Functions:
|
|
|
|
|
|
|
- secretflow.ml.boost.sgb_v.core.pure_numpy_ops.bucket_sum.build_bin_indices_list(node_selects, order_map, bucket_num)[源代码]#
- secretflow.ml.boost.sgb_v.core.pure_numpy_ops.bucket_sum.batch_select_sum(arr, children_nodes_selects, order_map, bucket_num)[源代码]#
secretflow.ml.boost.sgb_v.core.pure_numpy_ops.grad#
Functions:
|
|
|
|
|
- secretflow.ml.boost.sgb_v.core.pure_numpy_ops.grad.compute_gh_linear(y: ndarray, pred: ndarray)[源代码]#
secretflow.ml.boost.sgb_v.core.pure_numpy_ops.node_select#
Functions:
|
|
|
compute the next level's sample select indices, and node indices |
- secretflow.ml.boost.sgb_v.core.pure_numpy_ops.node_select.root_select(samples: int) List[ndarray] [源代码]#
- secretflow.ml.boost.sgb_v.core.pure_numpy_ops.node_select.get_child_select(nodes_s: List[ndarray], lchilds_ss: List[ndarray], gain_is_cost_effective: List[bool], split_node_indices: List[int]) Tuple[List[ndarray], List[int], List[ndarray], List[int]] [源代码]#
compute the next level’s sample select indices, and node indices
- 参数:
nodes_s – sample select indices of each node from current level’s nodes.
lchilds_ss – left children’s sample selects idx for current level’s nodes (after pruning).
1 (A non-empty single sample select is a np.ndarray with the shape n_samples *) –
node. (and with entries being 0 and 1s. 1 indicates the sample remains in) –
gain_is_cost_effective – List[bool]. indicate whether node should be split.
split_node_indices – List[int]. node indices at the current level.
- 返回:
sample select indices for nodes in the next level. node indices for the next level sample select indices for pruned nodes node indices for th pruned nodes
secretflow.ml.boost.sgb_v.core.pure_numpy_ops.pred#
Functions:
|
|
|
|
|
get final pred for this tree. |
secretflow.ml.boost.sgb_v.core.pure_numpy_ops.random#
Functions: