import matplotlib.pyplot as plt
import numpy as np
%pylab inline
content_perplexity = [10529.40, 1706.78, 1400.36, 1241.33, 1159.22, 1119.83, 1097.85, 1084.17]
usage_perplexity = [10983.10, 295.35, 217.96, 163.40, 159.51, 158.07, 157.08, 156.31]
multimodal_perplexity = [10880.03, 2286.57, 1865.53, 1601.30, 1462.46, 1394.55, 1356.40, 1332.72]
fig = plt.figure(figsize = (10, 7))
ax = fig.add_subplot(1,1,1)
plt.plot(np.arange(0, 8, 1), content_perplexity, 'r', linestyle='-', marker='o', label='Content-based')
plt.plot(np.arange(0, 8, 1), usage_perplexity, 'b', linestyle='-', marker='*', label='Usage-based')
plt.plot(np.arange(0, 8, 1), multimodal_perplexity, 'g', linestyle='-', marker='<', label='Multimodal')
plt.legend(fontsize=18)
plt.xlabel('Iteration number', fontsize=20)
plt.ylabel('Perplexity', fontsize=20)
xticklabels = getp(gca(), 'xticklabels')
yticklabels = getp(gca(), 'yticklabels')
setp(xticklabels, fontsize='large')
setp(yticklabels, fontsize='large')
major_ticks_x = np.arange(0, 7, 1)
minor_ticks_x = np.arange(0, 7, 0.1)
major_ticks_y = np.arange(0, 12000, 1000)
minor_ticks_y = np.arange(0, 12000, 100)
ax.set_xticks(major_ticks_x)
ax.set_xticks(minor_ticks_x, minor=True)
ax.set_yticks(major_ticks_y)
ax.set_yticks(minor_ticks_y, minor=True)
ax.grid(which='both')
ax.grid(which='minor', alpha=0.5)
ax.grid(which='major', alpha=1.0)
Populating the interactive namespace from numpy and matplotlib
content_theta_sparsity = [0.334, 0.683, 0.854, 0.859, 0.855, 0.851, 0.848, 0.846]
usage_theta_sparsity = [0.877, 0.971, 0.974, 0.973, 0.972, 0.971, 0.971, 0.970]
multimodal_theta_sparsity = [0.228, 0.463, 0.573, 0.791, 0.793, 0.790, 0.787, 0.785]
fig = plt.figure(figsize = (10, 7))
ax = fig.add_subplot(1,1,1)
plt.plot(np.arange(0, 8, 1), content_theta_sparsity, 'r', linestyle='-', marker='o', label='Content-based')
plt.plot(np.arange(0, 8, 1), usage_theta_sparsity, 'b', linestyle='-', marker='*', label='Usage-based')
plt.plot(np.arange(0, 8, 1), multimodal_theta_sparsity, 'g', linestyle='-', marker='<', label='Multimodal')
plt.legend(loc='lower right', fontsize=18)
plt.xlabel('Iteration number', fontsize=20)
plt.ylabel('Theta sparsity', fontsize=20)
xticklabels = getp(gca(), 'xticklabels')
yticklabels = getp(gca(), 'yticklabels')
setp(xticklabels, fontsize='large')
setp(yticklabels, fontsize='large')
major_ticks_x = np.arange(0, 7, 1)
minor_ticks_x = np.arange(0, 7, 0.1)
major_ticks_y = np.arange(0, 1, 0.1)
minor_ticks_y = np.arange(0, 1, 0.01)
ax.set_xticks(major_ticks_x)
ax.set_xticks(minor_ticks_x, minor=True)
ax.set_yticks(major_ticks_y)
ax.set_yticks(minor_ticks_y, minor=True)
ax.grid(which='both')
ax.grid(which='minor', alpha=0.5)
ax.grid(which='major', alpha=1.0)
content_phi_sparsity = [0.2361, 0.4589, 0.5617, 0.5982, 0.6184, 0.6308, 0.6390, 0.6448]
usage_phi_sparsity = [0.1209, 0.2127, 0.2152, 0.2156, 0.2159, 0.2161, 0.2163, 0.2165]
multimodal_phi_sparsity = [0.1777, 0.3904, 0.5780, 0.6143, 0.6381, 0.6596, 0.6840, 0.6943]
fig = plt.figure(figsize = (10, 7))
ax = fig.add_subplot(1,1,1)
plt.plot(np.arange(0, 8, 1), content_phi_sparsity, 'r', linestyle='-', marker='o', label='Content-based')
plt.plot(np.arange(0, 8, 1), usage_phi_sparsity, 'b', linestyle='-', marker='*', label='Usage-based')
plt.plot(np.arange(0, 8, 1), multimodal_phi_sparsity, 'g', linestyle='-', marker='<', label='Multimodal (sparsity for "words" modality)')
plt.legend(fontsize=18)
plt.xlabel('Iteration number', fontsize=20)
plt.ylabel('Phi sparsity', fontsize=20)
xticklabels = getp(gca(), 'xticklabels')
yticklabels = getp(gca(), 'yticklabels')
setp(xticklabels, fontsize='large')
setp(yticklabels, fontsize='large')
major_ticks_x = np.arange(0, 7, 1)
minor_ticks_x = np.arange(0, 7, 0.1)
major_ticks_y = np.arange(0, 1, 0.1)
minor_ticks_y = np.arange(0, 1, 0.01)
ax.set_xticks(major_ticks_x)
ax.set_xticks(minor_ticks_x, minor=True)
ax.set_yticks(major_ticks_y)
ax.set_yticks(minor_ticks_y, minor=True)
ax.grid(which='both')
ax.grid(which='minor', alpha=0.5)
ax.grid(which='major', alpha=1.0)
content_kernel_purity = [0.0013, 0.2466, 0.6891, 0.7974, 0.8377, 0.8608, 0.8763, 0.8871]
usage_kernel_purity = [0.0834, 0.9591, 0.9959, 0.9966, 0.9972, 0.9976, 0.9979, 0.9981]
multimodal_words_kernel_purity = [0.0006, 0.0631, 0.3783, 0.5493, 0.6286, 0.6756, 0.7082, 0.7315]
multimodal_author_kernel_purity = [0.9405, 0.8600, 0.8600, 0.8600, 0.8600, 0.8600, 0.8600, 0.8600]
multimodal_users_kernel_purity = [0.0023, 0.2336, 0.5956, 0.7052, 0.7566, 0.7883, 0.8102, 0.8262]
fig = plt.figure(figsize = (10, 7))
ax = fig.add_subplot(1,1,1)
plt.plot(np.arange(0, 8, 1), content_kernel_purity, 'r', linestyle='-', marker='o', label='Content-based')
plt.plot(np.arange(0, 8, 1), usage_kernel_purity, 'g', linestyle='-', marker='*', label='Usage-based')
plt.plot(np.arange(0, 8, 1), multimodal_words_kernel_purity, 'b', linestyle='-', marker='<', label='Multimodal ("words" modality)')
plt.plot(np.arange(0, 8, 1), multimodal_author_kernel_purity, 'orange', linestyle='-', marker='>', label='Multimodal ("author" modality)')
plt.plot(np.arange(0, 8, 1), multimodal_users_kernel_purity, 'black', linestyle='-', marker='^', label='Multimodal ("users" modality)')
plt.legend(loc='lower right', fontsize=18)
plt.xlabel('Iteration number', fontsize=20)
plt.ylabel('Kernel purity', fontsize=20)
xticklabels = getp(gca(), 'xticklabels')
yticklabels = getp(gca(), 'yticklabels')
setp(xticklabels, fontsize='large')
setp(yticklabels, fontsize='large')
major_ticks_x = np.arange(0, 7, 1)
minor_ticks_x = np.arange(0, 7, 0.1)
major_ticks_y = np.arange(0, 1, 0.1)
minor_ticks_y = np.arange(0, 1, 0.01)
ax.set_xticks(major_ticks_x)
ax.set_xticks(minor_ticks_x, minor=True)
ax.set_yticks(major_ticks_y)
ax.set_yticks(minor_ticks_y, minor=True)
ax.grid(which='both')
ax.grid(which='minor', alpha=0.5)
ax.grid(which='major', alpha=1.0)
content_kernel_contrast = [0.1609, 0.2304, 0.3304, 0.4047, 0.4480, 0.4767, 0.4969, 0.5127]
usage_kernel_contrast = [0.1608, 0.5522, 0.9518, 0.9625, 0.9672, 0.9703, 0.9725, 0.9740]
multimodal_words_kernel_contrast = [0.1325, 0.1827, 0.3543, 0.4253, 0.4764, 0.5185, 0.5550, 0.6282]
multimodal_author_kernel_contrast = [0.6901, 0.8600, 0.8600, 0.8600, 0.8600, 0.8600, 0.8600, 0.8600]
multimodal_users_kernel_contrast = [0.1895, 0.2133, 0.2838, 0.3294, 0.3577, 0.3773, 0.3906, 0.4013]
fig = plt.figure(figsize = (10, 7))
ax = fig.add_subplot(1,1,1)
plt.plot(np.arange(0, 8, 1), content_kernel_contrast, 'r', linestyle='-', marker='o', label='Content-based')
plt.plot(np.arange(0, 8, 1), usage_kernel_contrast, 'g', linestyle='-', marker='*', label='Usage-based')
plt.plot(np.arange(0, 8, 1), multimodal_words_kernel_contrast, 'b', linestyle='-', marker='<', label='Multimodal ("words" modality)')
plt.plot(np.arange(0, 8, 1), multimodal_author_kernel_contrast, 'orange', linestyle='-', marker='>', label='Multimodal ("author" modality)')
plt.plot(np.arange(0, 8, 1), multimodal_users_kernel_contrast, 'black', linestyle='-', marker='^', label='Multimodal ("users" modality)')
plt.legend(loc='lower right', fontsize=15)
plt.xlabel('Iteration number', fontsize=20)
plt.ylabel('Kernel contrast', fontsize=20)
xticklabels = getp(gca(), 'xticklabels')
yticklabels = getp(gca(), 'yticklabels')
setp(xticklabels, fontsize='large')
setp(yticklabels, fontsize='large')
major_ticks_x = np.arange(0, 7, 1)
minor_ticks_x = np.arange(0, 7, 0.1)
major_ticks_y = np.arange(0, 1, 0.1)
minor_ticks_y = np.arange(0, 1, 0.01)
ax.set_xticks(major_ticks_x)
ax.set_xticks(minor_ticks_x, minor=True)
ax.set_yticks(major_ticks_y)
ax.set_yticks(minor_ticks_y, minor=True)
ax.grid(which='both')
ax.grid(which='minor', alpha=0.5)
ax.grid(which='major', alpha=1.0)
content_recals = [0.82, 0.64, 0.62, 0.59]
usage_recals = [0.91, 0.79, 0.74, 0.75]
multimodal_recals = [0.98, 0.80, 0.74, 0.62]
fig = plt.figure(figsize = (10, 7))
ax = fig.add_subplot(1,1,1)
plt.plot(np.arange(5, 25, 5), content_recals, 'r', linestyle='-', marker='o', label='Content-based')
plt.plot(np.arange(5, 25, 5), usage_recals, 'g', linestyle='-', marker='*', label='Usage-based')
plt.plot(np.arange(5, 25, 5), multimodal_recals, 'b', linestyle='-', marker='<', label='Multimodal')
plt.legend(loc='upper right')
plt.xlabel('k', fontsize=14)
plt.ylabel('Recall at k', fontsize=14)
xticklabels = getp(gca(), 'xticklabels')
yticklabels = getp(gca(), 'yticklabels')
setp(xticklabels, fontsize='large')
setp(yticklabels, fontsize='large')
major_ticks_x = np.arange(5, 20, 5)
minor_ticks_x = np.arange(5, 20, 1)
major_ticks_y = np.arange(0.5, 1, 0.1)
minor_ticks_y = np.arange(0.5, 1, 0.01)
ax.set_xticks(major_ticks_x)
ax.set_xticks(minor_ticks_x, minor=True)
ax.set_yticks(major_ticks_y)
ax.set_yticks(minor_ticks_y, minor=True)
ax.grid(which='both')
ax.grid(which='minor', alpha=0.5)
ax.grid(which='major', alpha=1.0)
ten_topics = [11853.50, 2836.44, 2763.57, 2589.25, 2412.32, 2298.48, 2225.38, 2175.25]
hundred_topics = [11774.89, 2781.92, 2513.43, 2083.66, 1804.89, 1660.81, 1580.06, 1530.42]
thousand_topics = [11721.47, 2582.54, 2268.93, 1705.68, 1403.82, 1259.54, 1178.23, 1127.52]
fig = plt.figure(figsize = (10, 7))
ax = fig.add_subplot(1,1,1)
plt.plot(np.arange(0, 8, 1), ten_topics, 'r', linestyle='-', marker='o', label='10 topics')
plt.plot(np.arange(0, 8, 1), hundred_topics, 'g', linestyle='-', marker='*', label='100 topics')
plt.plot(np.arange(0, 8, 1), thousand_topics, 'b', linestyle='-', marker='<', label='500 topics')
plt.legend(loc='upper right', fontsize=18)
plt.xlabel('Iteration number', fontsize=20)
plt.ylabel('Perplexity', fontsize=20)
xticklabels = getp(gca(), 'xticklabels')
yticklabels = getp(gca(), 'yticklabels')
setp(xticklabels, fontsize=18)
setp(yticklabels, fontsize=18)
major_ticks_x = np.arange(0, 7, 1)
minor_ticks_x = np.arange(0, 7, 0.1)
major_ticks_y = np.arange(0, 12000, 1000)
minor_ticks_y = np.arange(0, 12000, 100)
ax.set_xticks(major_ticks_x)
ax.set_xticks(minor_ticks_x, minor=True)
ax.set_yticks(major_ticks_y)
ax.set_yticks(minor_ticks_y, minor=True)
ax.grid(which='both')
ax.grid(which='minor', alpha=0.5)
ax.grid(which='major', alpha=1.0)
ten_topics = [0.004, 0.007, 0.013, 0.038, 0.094, 0.142, 0.173, 0.193]
hundred_topics = [0.033, 0.065, 0.170, 0.389, 0.523, 0.585, 0.616, 0.632]
thousand_topics = [0.157, 0.322, 0.497, 0.724, 0.809, 0.841, 0.854, 0.861]
fig = plt.figure(figsize = (10, 7))
ax = fig.add_subplot(1,1,1)
plt.plot(np.arange(0, 8, 1), ten_topics, 'r', linestyle='-', marker='o', label='10 topics')
plt.plot(np.arange(0, 8, 1), hundred_topics, 'g', linestyle='-', marker='*', label='100 topics')
plt.plot(np.arange(0, 8, 1), thousand_topics, 'b', linestyle='-', marker='<', label='500 topics')
plt.legend(loc='upper left', fontsize=18)
plt.xlabel('Iteration number', fontsize=20)
plt.ylabel('Theta sparsity', fontsize=20)
xticklabels = getp(gca(), 'xticklabels')
yticklabels = getp(gca(), 'yticklabels')
setp(xticklabels, fontsize=18)
setp(yticklabels, fontsize=18)
major_ticks_x = np.arange(0, 7, 1)
minor_ticks_x = np.arange(0, 7, 0.1)
major_ticks_y = np.arange(0, 1, 0.1)
minor_ticks_y = np.arange(0, 1, 0.01)
ax.set_xticks(major_ticks_x)
ax.set_xticks(minor_ticks_x, minor=True)
ax.set_yticks(major_ticks_y)
ax.set_yticks(minor_ticks_y, minor=True)
ax.grid(which='both')
ax.grid(which='minor', alpha=0.5)
ax.grid(which='major', alpha=1.0)
ten_topics = [0.002538, 0.005440, 0.011307, 0.041281, 0.097660, 0.153133, 0.200389, 0.238596]
hundred_topics = [0.029082, 0.064232, 0.159482, 0.302464, 0.397614, 0.454345, 0.490604, 0.515560]
thousand_topics = [0.147221, 0.257221, 0.395843, 0.503731, 0.557831, 0.587030, 0.604972, 0.617160]
fig = plt.figure(figsize = (10, 7))
ax = fig.add_subplot(1,1,1)
plt.plot(np.arange(0, 8, 1), ten_topics, 'r', linestyle='-', marker='o', label='10 topics')
plt.plot(np.arange(0, 8, 1), hundred_topics, 'g', linestyle='-', marker='*', label='100 topics')
plt.plot(np.arange(0, 8, 1), thousand_topics, 'b', linestyle='-', marker='<', label='500 topics')
plt.legend(loc='upper right', fontsize=18)
plt.xlabel('Iteration number', fontsize=20)
plt.ylabel('Phi sparsity (words modality)', fontsize=20)
xticklabels = getp(gca(), 'xticklabels')
yticklabels = getp(gca(), 'yticklabels')
setp(xticklabels, fontsize=18)
setp(yticklabels, fontsize=18)
major_ticks_x = np.arange(0, 7, 1)
minor_ticks_x = np.arange(0, 7, 0.1)
major_ticks_y = np.arange(0, 1, 0.1)
minor_ticks_y = np.arange(0, 1, 0.01)
ax.set_xticks(major_ticks_x)
ax.set_xticks(minor_ticks_x, minor=True)
ax.set_yticks(major_ticks_y)
ax.set_yticks(minor_ticks_y, minor=True)
ax.grid(which='both')
ax.grid(which='minor', alpha=0.5)
ax.grid(which='major', alpha=1.0)
import matplotlib.pyplot as plt
import numpy as np
ten_topics = [0.0158, 0.1445, 0.1764, 0.2130, 0.2392, 0.2570, 0.2701, 0.2800]
hundred_topics = [0.0028, 0.0108, 0.1922, 0.2289, 0.2530, 0.2704, 0.2846, 0.2959]
thousand_topics = [0.1514, 0.1622, 0.1915, 0.2353, 0.2753, 0.3060, 0.3287, 0.3457]
fig = plt.figure(figsize = (10, 7))
ax = fig.add_subplot(1,1,1)
plt.plot(np.arange(0, 8, 1), ten_topics, 'r', linestyle='-', marker='o', label='10 topics')
plt.plot(np.arange(0, 8, 1), hundred_topics, 'g', linestyle='-', marker='*', label='100 topics')
plt.plot(np.arange(0, 8, 1), thousand_topics, 'b', linestyle='-', marker='<', label='500 topics')
plt.legend(loc='upper right', fontsize=18)
plt.xlabel('Iteration number', fontsize=20)
plt.ylabel('Kernel purity (words modality)', fontsize=20)
xticklabels = getp(gca(), 'xticklabels')
yticklabels = getp(gca(), 'yticklabels')
setp(xticklabels, fontsize=18)
setp(yticklabels, fontsize=18)
major_ticks_x = np.arange(0, 7, 1)
minor_ticks_x = np.arange(0, 7, 0.1)
major_ticks_y = np.arange(0, 0.5, 0.1)
minor_ticks_y = np.arange(0, 0.5, 0.01)
ax.set_xticks(major_ticks_x)
ax.set_xticks(minor_ticks_x, minor=True)
ax.set_yticks(major_ticks_y)
ax.set_yticks(minor_ticks_y, minor=True)
ax.grid(which='both')
ax.grid(which='minor', alpha=0.5)
ax.grid(which='major', alpha=1.0)