예제 #1
0
 def fit(self, data_matrix, data_matrix_neg, random_state=None):
     if random_state is not None:
         random.seed(random_state)
     # use eden to fitoooOoO
     self.estimator = eden_fit_estimator(self.classifier, positive_data_matrix=data_matrix,
                                         negative_data_matrix=data_matrix_neg,
                                         cv=self.cv,
                                         n_jobs=self.n_jobs,
                                         n_iter_search=10,
                                         random_state=random_state)
     self.cal_estimator = self.estimator
     self.status = 'trained'
     return self
예제 #2
0
 def fit_estimator(self, data_matrix, n_jobs=-1, cv=2, random_state=42):
     '''
     create self.estimator...
     by inversing the data_matrix set to get a negative set
     and then using edens fit_estimator
     '''
     # make negative set
     data_matrix_neg = data_matrix.multiply(-1)
     return eden_fit_estimator(self.classifier,
                               positive_data_matrix=data_matrix,
                               negative_data_matrix=data_matrix_neg,
                               cv=cv,
                               n_jobs=n_jobs,
                               n_iter_search=10,
                               random_state=random_state)
예제 #3
0
 def fit_estimator(self, data_matrix, n_jobs=-1, cv=2, random_state=42):
     '''
     create self.estimator...
     by inversing the data_matrix set to get a negative set
     and then using edens fit_estimator
     '''
     # create negative set:
     data_matrix_neg = data_matrix.multiply(-1)
     # i hope loss is log.. not 100% sure..
     # probably calibration will fix this#
     return eden_fit_estimator(SGDClassifier(loss='log'), positive_data_matrix=data_matrix,
                               negative_data_matrix=data_matrix_neg,
                               cv=cv,
                               n_jobs=n_jobs,
                               n_iter_search=10,
                               random_state=random_state)
예제 #4
0
def make_estimator(pos,neg):
    pos = vectorizer.transform( pos )
    neg = vectorizer.transform( neg )
    esti = eden_fit_estimator(SGDClassifier(), positive_data_matrix=pos,
                                        negative_data_matrix=neg)
    return esti
예제 #5
0
파일: BFG1.py 프로젝트: smautner/GraphLearn
def make_estimator(pos,neg):
    pos = vectorizer.transform( pos )
    neg = vectorizer.transform( neg )
    esti = eden_fit_estimator(SGDClassifier(), positive_data_matrix=pos,
                                        negative_data_matrix=neg)
    return esti
예제 #6
0
파일: BFG2.py 프로젝트: smautner/GraphLearn
def get_estimator(it_pos, it_neg):
    pos = vect.transform(it_pos)
    neg = vect.transform(it_neg)
    return eden_fit_estimator(SGDClassifier(), pos, neg)
예제 #7
0
def get_estimator(it_pos, it_neg):
    pos= vect.transform(it_pos)
    neg = vect.transform(it_neg)
    return eden_fit_estimator(SGDClassifier(),pos,neg)