In [1]:
%matplotlib notebook

import itertools
import logging
from functools import partial

import gensim
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pnd
from sklearn.cluster import *
from sklearn.decomposition import PCA, RandomizedPCA
from sklearn.manifold import TSNE

from knub.thesis.util import *
#matplotlib.style.use('ggplot')

In [2]:
df = pnd.read_csv("/home/knub/Repositories/master-thesis/results/20_news.palmetto.tsv", sep="\t")

In [27]:
plt.figure()
colors = iter(["green", "red", "blue", "yellow"])
for model, df_group in df.groupby("model"):
    plt.plot(df_group["iteration"], df_group["mean_coherence"], color='white',
             label=model, marker='o', markerfacecolor=next(colors), markersize=12)

plt.xlabel("Iteration")
plt.ylabel("Topic Coherence")
plt.ylim((0.4, 0.5))
plt.legend(loc="best")
#plt.legend(bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0.)
#plt.legend(bbox_to_anchor=(0., 1.02, 1., .102), loc=3,
#           ncol=2, mode="expand", borderaxespad=0.)


Out[27]:
<matplotlib.legend.Legend at 0x7fd238f72f90>

In [ ]: