secretflow.ml.boost.sgb_v.factory.components.node_selector#

Classes:

NodeSelector()

class secretflow.ml.boost.sgb_v.factory.components.node_selector.NodeSelector[源代码]#

基类:Component

Methods:

__init__()

show_params()

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.

__init__() None[源代码]#
show_params()[源代码]#
set_params(_: dict)[源代码]#
get_params(_: dict)[源代码]#
set_devices(devices: Devices)[源代码]#
root_select(sample_num)[源代码]#
is_list_empty(any_list: Union[PYUObject, List]) PYUObject[源代码]#
pick_children_node_ss(node_select_list: PYUObject) Tuple[List[PYUObject], List[bool], int][源代码]#
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:

NodeSelector()

Functions:

pick_children_node_ss(node_select_list)

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[源代码]#

基类:Component

Methods:

__init__()

show_params()

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.

__init__() None[源代码]#
show_params()[源代码]#
set_params(_: dict)[源代码]#
get_params(_: dict)[源代码]#
set_devices(devices: Devices)[源代码]#
root_select(sample_num)[源代码]#
is_list_empty(any_list: Union[PYUObject, List]) PYUObject[源代码]#
pick_children_node_ss(node_select_list: PYUObject) Tuple[List[PYUObject], List[bool], int][源代码]#
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