Example #1
0
 def get_model_param(self):
     model_param = DecisionTreeModelParam()
     for node in self.tree_node:
         model_param.tree_.add(id=node.id,
                               sitename=self.role,
                               fid=node.fid,
                               bid=node.bid,
                               weight=node.weight,
                               is_leaf=node.is_leaf,
                               left_nodeid=node.left_nodeid,
                               right_nodeid=node.right_nodeid,
                               missing_dir=node.missing_dir)
     model_param.leaf_count.update(self.leaf_count)
     return model_param
    def get_model_param(self):
        model_param = DecisionTreeModelParam()
        for node in self.tree_node:
            model_param.tree_.add(id=node.id,
                                  sitename=self.role,
                                  fid=node.fid,
                                  bid=node.bid,
                                  weight=node.weight,
                                  is_leaf=node.is_leaf,
                                  left_nodeid=node.left_nodeid,
                                  right_nodeid=node.right_nodeid,
                                  missing_dir=node.missing_dir)

        LOGGER.debug('output tree: epoch_idx:{} tree_idx:{}'.format(self.epoch_idx, self.tree_idx))
        return model_param
Example #3
0
    def get_model_param(self):
        model_param = DecisionTreeModelParam()
        for node in self.tree_:
            model_param.tree_.add(id=node.id,
                                  sitename=node.sitename,
                                  fid=node.fid,
                                  bid=node.bid,
                                  weight=node.weight,
                                  is_leaf=node.is_leaf,
                                  left_nodeid=node.left_nodeid,
                                  right_nodeid=node.right_nodeid,
                                  missing_dir=node.missing_dir)

        model_param.split_maskdict.update(self.split_maskdict)
        model_param.missing_dir_maskdict.update(self.missing_dir_maskdict)

        return model_param
    def get_model_param(self):

        model_param = DecisionTreeModelParam()
        for node in self.tree_node:
            weight, mo_weight = self.mo_weight_extract(node)
            model_param.tree_.add(id=node.id,
                                  sitename=node.sitename,
                                  fid=node.fid,
                                  bid=node.bid,
                                  weight=weight,
                                  is_leaf=node.is_leaf,
                                  left_nodeid=node.left_nodeid,
                                  right_nodeid=node.right_nodeid,
                                  missing_dir=node.missing_dir,
                                  mo_weight=mo_weight)
        model_param.split_maskdict.update(self.split_maskdict)
        model_param.missing_dir_maskdict.update(self.missing_dir_maskdict)
        model_param.leaf_count.update(self.leaf_count)
        return model_param
Example #5
0
guest_old = [10000]
guest_new = [1919]

param = BoostingTreeModelParam()

fp0 = FeatureImportanceInfo()
fp0.fullname = 'host_10000_0'
fp0.sitename = 'host:10000'

fp1 = FeatureImportanceInfo()
fp1.sitename = 'host:9999'
fp1.fullname = 'host_9999_1'

fp2 = FeatureImportanceInfo(fullname='x0')
fp2.sitename = 'guest:10000'

feature_importance = [fp0, fp1, fp2]
param.feature_importances.extend(feature_importance)

tree_0 = DecisionTreeModelParam(tree_=[NodeParam(sitename='guest:10000'), NodeParam(sitename='guest:10000'),
                                       NodeParam(sitename='guest:10000')])
tree_1 = DecisionTreeModelParam(tree_=[NodeParam(sitename='host:10000'), NodeParam(sitename='host:9999'),
                                       NodeParam(sitename='host:10000')])
tree_2 = DecisionTreeModelParam(tree_=[NodeParam(sitename='host:9999'), NodeParam(sitename='guest:10000'),
                                       NodeParam(sitename='host:9999')])
tree_3 = DecisionTreeModelParam()

param.trees_.extend([tree_0, tree_1, tree_2, tree_3])
rs = model_migration({'HelloParam': param, 'HelloMeta': {}}, 'HeteroSecureBoost', old_guest_list=guest_old,
                     new_guest_list=guest_new, old_host_list=host_old, new_host_list=host_new, )