secretflow.ml.boost.sgb_v.factory.components.node_selector#
Classes:
- class secretflow.ml.boost.sgb_v.factory.components.node_selector.NodeSelector[源代码]#
 基类:
ComponentMethods:
__init__()set_params(_)get_params(_)set_devices(devices)root_select(sample_num)is_list_empty(any_list)pick_children_node_ss(node_select_list)get_child_select(nodes_s, lchild_ss, ...)compute the next level's sample select indices.
- get_child_select(nodes_s: List[ndarray], lchild_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.
- 参数:
 nodes_s – List[np.ndarray]. sample select indices of each node from current level’s nodes.
lchilds_ss – List[np.ndarray]. left children’s sample selects idx for current level’s nodes. A non-empty single sample select is a np.ndarray with the shape n_samples * 1 and with entries being 0 and 1s. 1 indicates the sample remains in node.
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 next tree level. node indices for the next level sample_selects for pruned nodes node_indices for pruned nodes
secretflow.ml.boost.sgb_v.factory.components.node_selector.node_selector#
Classes:
Functions:
  | 
pick left/right children based on number of samples at each node.  | 
- class secretflow.ml.boost.sgb_v.factory.components.node_selector.node_selector.NodeSelector[源代码]#
 基类:
ComponentMethods:
__init__()set_params(_)get_params(_)set_devices(devices)root_select(sample_num)is_list_empty(any_list)pick_children_node_ss(node_select_list)get_child_select(nodes_s, lchild_ss, ...)compute the next level's sample select indices.
- get_child_select(nodes_s: List[ndarray], lchild_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.
- 参数:
 nodes_s – List[np.ndarray]. sample select indices of each node from current level’s nodes.
lchilds_ss – List[np.ndarray]. left children’s sample selects idx for current level’s nodes. A non-empty single sample select is a np.ndarray with the shape n_samples * 1 and with entries being 0 and 1s. 1 indicates the sample remains in node.
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 next tree level. node indices for the next level sample_selects for pruned nodes node_indices for pruned nodes
- secretflow.ml.boost.sgb_v.factory.components.node_selector.node_selector.pick_children_node_ss(node_select_list: PYUObject) Tuple[List[PYUObject], List[bool], int][源代码]#
 pick left/right children based on number of samples at each node. :param node_select_list: PYUObject. List[np.ndarray] at label holder.
- 返回:
 List[PYUObject]. List[np.ndarray] at label holder. is_lefts: List[bool]. node_num: int. len of node_select_list.
- 返回类型:
 children_node_select_list