Ejemplo n.º 1
0
 def test_save_prediction(self):
     model = RandomForestClassifier()
     model.id = get_model_id(model)
     model.fit(self.iris.data, self.iris.target)
     indexes = np.fromfunction(lambda x: x, (self.iris.data.shape[0], ), dtype=np.int32)
     saving_predict_proba(model, self.iris.data, indexes)
     os.remove('RandomForestClassifier_r0_N__m5_0p0__m4_2__m1_auto__m0_N__m3_1__m2_N__n0_10__b0_1__c1_gini__c0_N_0_149.csv')
Ejemplo n.º 2
0
 def test_save_prediction(self):
     model = RandomForestClassifier()
     model.id = get_model_id(model)
     model.fit(self.iris.data, self.iris.target)
     indexes = np.fromfunction(lambda x: x, (self.iris.data.shape[0], ), dtype=np.int32)
     saving_predict_proba(model, self.iris.data, indexes)
     os.remove('RandomForestClassifier_r0_N__m5_0p0__m4_2__m1_auto__m0_N__m3_1__m2_N__n0_10__b0_1__c1_gini__c0_N_190.csv')
Ejemplo n.º 3
0
 def test_save_prediction(self):
     model = RandomForestClassifier()
     model.id = get_model_id(model)
     model.fit(self.iris.data, self.iris.target)
     indexes = np.fromfunction(lambda x: x, (self.iris.data.shape[0], ), dtype=np.int32)
     saving_predict_proba(model, self.iris.data, indexes)
     any_file_removed = False
     for filename in os.listdir('.'):
         if filename.startswith('RandomForestClassifier'):
             os.remove(filename)
             any_file_removed = True
     self.assertTrue(any_file_removed)