def fit(self, X, y):
        self.vectorizer, self.corpus_matrix, _ = get_tfidf_model(X)

        param = {'objective': 'binary:logistic'}

        epochs = 100

        D_train = xgb.DMatrix(self.corpus_matrix, label=y)
        self.clf = xgb.train(param, D_train, epochs)
Exemple #2
0
    def fit(self, X, y):

        self.vectorizer, self.corpus_matrix, _ = get_tfidf_model(X)

        self.clf = SVC(kernel='rbf')
        self.clf.fit(self.corpus_matrix, y)
    def fit(self, X, y):

        self.vectorizer, self.corpus_matrix, _ = get_tfidf_model(X)

        self.clf = naive_bayes.MultinomialNB()
        self.clf.fit(self.corpus_matrix, y)
Exemple #4
0
    def fit(self, X, y):
        self.vectorizer, self.X_vectorized, _ = get_tfidf_model(X)

        self.clf = KNeighborsClassifier()
        self.clf.fit(self.X_vectorized, y)
    def fit(self, X, y):
        self.x0, self.y0, self.x1, self.y1 = split_binary_classes(X, y)

        self.vectorizer0, self.corpus_matrix0, _ = get_tfidf_model(self.x0)
        self.vectorizer1, self.corpus_matrix1, _ = get_tfidf_model(self.x1)
Exemple #6
0
    def fit(self, X, y):
        self.vectorizer, self.X_vectorized, _ = get_tfidf_model(X)

        self.clf = RandomForestClassifier()
        self.clf.fit(self.X_vectorized, y)