def __init__(self,
                 leaf_model=LinearSVC(),
                 split_classifier=LinearSVC(),
                 num_features_per_node=None,
                 max_depth=3,
                 min_leaf_size=50,
                 randomize_split_params={},
                 randomize_leaf_params={},
                 verbose=False):

        # check everyone's types -- I can't give up the OCaml instincts
        # also, if running this code remotely it's nice to know when something
        # goes wrong before we send an object over to AWS
        check_estimator(leaf_model)
        check_estimator(split_classifier)
        check_int(max_depth)
        check_int(min_leaf_size)
        check_dict(randomize_split_params)
        check_dict(randomize_leaf_params)
        check_bool(verbose)

        self.leaf_model = leaf_model
        self.split_classifier = split_classifier
        self.max_depth = max_depth
        self.min_leaf_size = min_leaf_size
        self.num_features_per_node = num_features_per_node

        self.randomize_split_params = randomize_split_params
        self.randomize_leaf_params = randomize_leaf_params
        self.verbose = verbose

        self.root = None
        self.classes = None
Exemple #2
0
 def __init__(self, 
         leaf_model = LinearSVC(), 
         split_classifier = LinearSVC(), 
         num_features_per_node = None, 
         max_depth=3, 
         min_leaf_size=50, 
         randomize_split_params={}, 
         randomize_leaf_params={}, 
         verbose = False):
             
     # check everyone's types -- I can't give up the OCaml instincts 
     # also, if running this code remotely it's nice to know when something
     # goes wrong before we send an object over to AWS 
     check_estimator(leaf_model)
     check_estimator(split_classifier)
     check_int(max_depth)
     check_int(min_leaf_size)
     check_dict(randomize_split_params)
     check_dict(randomize_leaf_params)
     check_bool(verbose)
     
     self.leaf_model = leaf_model 
     self.split_classifier = split_classifier 
     self.max_depth = max_depth 
     self.min_leaf_size = min_leaf_size 
     self.num_features_per_node = num_features_per_node 
     
     self.randomize_split_params = randomize_split_params
     self.randomize_leaf_params = randomize_leaf_params 
     self.verbose = verbose 
     
     self.root = None
     self.classes = None
Exemple #3
0
 def __init__(self, 
         base_model, 
         num_models, 
         bagging_percent,
         bagging_replacement,
         feature_subset_percent, 
         stacking_model, 
         randomize_params, 
         additive, 
         verbose):
     check_estimator(base_model)
     check_int(num_models)
     
     self.base_model = base_model
     self.num_models = num_models
     self.bagging_percent = bagging_percent 
     self.bagging_replacement = bagging_replacement 
     self.feature_subset_percent = feature_subset_percent 
     self.stacking_model = stacking_model 
     self.randomize_params = randomize_params 
     self.additive = additive 
     self.verbose = verbose
     self.need_to_fit = True
     self.models = None
     self.weights = None 
Exemple #4
0
 def __init__(self, k, base_model, verbose=False): 
     check_int(k)
     check_estimator(base_model)
     check_bool(verbose) 
     
     self.k = k
     self.base_model = base_model 
     self.verbose = verbose 
     self.clusters = MiniBatchKMeans(k)
     self.models = None