Пример #1
0
 def __init__(self,
              max_leaf=1000,
              test_interval=100,
              algorithm="RGF",
              loss="Log",
              reg_depth=1.0,
              l2=0.1,
              sl2=None,
              normalize=False,
              min_samples_leaf=10,
              n_iter=None,
              n_tree_search=1,
              opt_interval=100,
              learning_rate=0.5,
              calc_prob="sigmoid",
              n_jobs=-1,
              memory_policy="generous",
              verbose=0,
              init_model=None):
     if not utils.Config().RGF_AVAILABLE:
         raise Exception('RGF estimators are unavailable for usage.')
     super(RGFClassifier, self).__init__()
     self.max_leaf = max_leaf
     self.test_interval = test_interval
     self.algorithm = algorithm
     self.loss = loss
     self.reg_depth = reg_depth
     self.l2 = l2
     self.sl2 = sl2
     self.normalize = normalize
     self.min_samples_leaf = min_samples_leaf
     self.n_iter = n_iter
     self.n_tree_search = n_tree_search
     self.opt_interval = opt_interval
     self.learning_rate = learning_rate
     self.calc_prob = calc_prob
     self.n_jobs = n_jobs
     self.memory_policy = memory_policy
     self.verbose = verbose
     self.init_model = init_model
Пример #2
0
 def __init__(self,
              n_estimators=500,
              max_depth=6,
              max_leaf=50,
              tree_gain_ratio=1.0,
              min_samples_leaf=5,
              loss="LS",
              l1=1.0,
              l2=1000.0,
              opt_algorithm="rgf",
              learning_rate=0.001,
              max_bin=None,
              min_child_weight=5.0,
              data_l2=2.0,
              sparse_max_features=80000,
              sparse_min_occurences=5,
              calc_prob="sigmoid",
              n_jobs=-1,
              verbose=0):
     if not utils.Config().FASTRGF_AVAILABLE:
         raise Exception('FastRGF estimators are unavailable for usage.')
     super(FastRGFClassifier, self).__init__()
     self.n_estimators = n_estimators
     self.max_depth = max_depth
     self.max_leaf = max_leaf
     self.tree_gain_ratio = tree_gain_ratio
     self.min_samples_leaf = min_samples_leaf
     self.loss = loss
     self.l1 = l1
     self.l2 = l2
     self.opt_algorithm = opt_algorithm
     self.learning_rate = learning_rate
     self.max_bin = max_bin
     self.min_child_weight = min_child_weight
     self.data_l2 = data_l2
     self.sparse_max_features = sparse_max_features
     self.sparse_min_occurences = sparse_min_occurences
     self.calc_prob = calc_prob
     self.n_jobs = n_jobs
     self.verbose = verbose