Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def measures_scores(embs, cats):
- test_sizes = [0.99, 0.95, 0.9, 0.8, 0.7]
- scores_results = []
- for test_size in test_sizes:
- X_train, X_val, y_train, y_val = train_test_split(embs, cats, test_size=test_size)
- gb_clf = GradientBoostingClassifier()
- gb_clf.fit(X_train, y_train)
- score = f1_score(y_val, gb_clf.predict(X_val), average='micro')
- scores_results.append(score)
- return scores_results
- def embeddings_score_evaluate(_graph):
- graph = _graph.copy()
- laplacian_emb, svd_emb, deep_walk_emb, walklets_emb = xy_embeddings(graph)
- results = []
- results.append(measures_scores(laplacian_emb, category_id))
- results.append(measures_scores(svd_emb, category_id))
- results.append(measures_scores(deep_walk_emb, category_id))
- results.append(measures_scores(walklets_emb, category_id))
- return results
- scores = embeddings_score_evaluate(gcc_cora)
- def embeddings_score(gcc_cora):
- return scores
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement