Exemple #1
0
 def predict(self, tree_input):
     # get tree_feature and input to LR, output LR score.
     # input format:
     #   [(idx, value), ..]
     tf = map(lambda x:(x + self.__feature_offset, 1), PyFly.tree_features(self.__gbdt, tree_input))
     total_feature = tree_input + tf
     return PyFly.predict(self.__lr, total_feature)
Exemple #2
0
 def predict(self, tree_input):
     # get tree_feature and input to LR, output LR score.
     # input format:
     #   [(idx, value), ..]
     tf = map(lambda x: (x + self.__feature_offset, 1),
              PyFly.tree_features(self.__gbdt, tree_input))
     total_feature = tree_input + tf
     return PyFly.predict(self.__lr, total_feature)
Exemple #3
0
 def __init__(self, tree_model_file, lr_model_file, tree_feature_offset):
     self.__gbdt = PyFly.load_gbdt(tree_model_file)
     self.__lr = PyFly.load_lr(lr_model_file)
     self.__feature_offset = tree_feature_offset
Exemple #4
0
 def __init__(self, tree_model_file, lr_model_file, tree_feature_offset):
     self.__gbdt = PyFly.load_gbdt(tree_model_file)
     self.__lr = PyFly.load_lr(lr_model_file)
     self.__feature_offset = tree_feature_offset