アルゴリズム評価を行うためのフレームワークを構築しました。これらのメソッドに渡すデータに基づいて計算するメソッドを構築しています。RMSE@K、NDCG@K、MAE@Kなど
ndcg = []
rmse = []
mae = []
for i in xrange(11):
results = generate_metrics(data_file, i)
ndcg.append(np.mean(results['ndcg']))
rmse.append(np.mean(results['rmse']))
mae.append(np.mean(results['mae']))
plt.plot(ndcg)
plt.plot(rmse)
plt.plot(mae)
plt.plot()
plt.show()
これを 1 つのグラフにプロットするために、Python 内で ggplot を使用したいと考えています。
上記のリストを次のようなデータフレームに変換するにはどうすればよいですか:
at_k ndcg rmse mae
1 1 0.4880583 0.3438043 0.3400933
2 2 0.4880583 0.3438043 0.3400933
3 3 0.4880583 0.3438043 0.3400933
4 4 0.4880583 0.3438043 0.3400933
5 5 0.4880583 0.3438043 0.3400933
6 6 0.4880583 0.3438043 0.3400933
7 7 0.4880583 0.3438043 0.3400933
8 8 0.4880583 0.3438043 0.3400933
9 9 0.4880583 0.3438043 0.3400933
10 10 0.4880583 0.3438043 0.3400933
ggplotを使用してプロットします