Skip to content

Instantly share code, notes, and snippets.

@FeryET
Last active August 26, 2020 12:02
Show Gist options
  • Save FeryET/d3c8dd898061bc45f5797f19d5175ac5 to your computer and use it in GitHub Desktop.
Save FeryET/d3c8dd898061bc45f5797f19d5175ac5 to your computer and use it in GitHub Desktop.
folds = RepeatedStratifiedKFold(n_splits=10, n_repeats=10)
vectorizer = TomotopyLDAVectorizer(num_of_topics=15, workers=workers, min_df=min_df,
rm_top=rm_top)
clf = SVC()
pca = PCA(n_components=0.95)
pipe = Pipeline([("vectorizer", vectorizer), ("scalar", StandardScaler()),
("classifier", clf)])
results = cross_val_score(pipe, docs, y_true, cv=folds, n_jobs=2, verbose=1,
scoring="accuracy")
print("Accuracy -> mean: {}\t std: {}".format(results.mean(), results.std()))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment