예제 #1
0
    def find_best_algorithm(self):   
        '''Finds the top permorning algorithm on the data.  
        
        It loops through each objective function that is 
        provided in the array 'objectives' and passes it to the Hyperopt function fmin.  fmin 
        will intelligently search the search spaces for each algorithm and attempt to minimize (optimize) 
        the scoring function provided.
        '''
        self.start_time = time.time()

        #If use provides specific objective list use that. 
        if self.specific_algos:
            objectives = self.specific_algos
        #Otheriwse, retrieve all objective keys from corresponding space.    
        else:    
            objectives = self.get_obj_key_list()

        #Pass each objective function to Hyperopt.
        for obj in objectives:
            self._objective = self._get_objective(obj)
            space = obj  
            trials = Trials()
            fmin(
                fn = self._minimize_this,
                space = get_space(self, space),
                algo = tpe.suggest,
                max_evals = self.iterations,
                trials = trials,
            )    
예제 #2
0
 def test_get_space_classifiers(self):
     for key in classifiers().keys():
         self.assertIsNotNone(get_space(self.automator, key))
예제 #3
0
 def test_get_space_regressors(self):
     for key in regressors().keys():
         self.assertIsNotNone(get_space(self.automator, key))