init
Browse files- filtering_purify.py +5 -3
filtering_purify.py
CHANGED
@@ -105,12 +105,14 @@ if __name__ == '__main__':
|
|
105 |
df_size = pd.DataFrame([{"min entity": mef, "max predicate": mpf, "freq": x} for x, (mef, mpf) in zip(data_size_full, candidates)])
|
106 |
df_size = df_size.pivot(index="min entity", columns="max predicate", values="freq")
|
107 |
df_size.index.name = "min entity / max predicate"
|
|
|
|
|
108 |
df_size_p = pd.DataFrame(
|
109 |
[{"min entity": mef, "max predicate": mpf, "freq": len(x)} for x, (mef, mpf) in zip(p_dist_full, candidates)])
|
110 |
df_size_p = df_size_p.pivot(index="max predicate", columns="min entity", values="freq")
|
111 |
-
|
112 |
-
|
113 |
-
print(
|
114 |
|
115 |
# plot predicate distribution
|
116 |
df_p = pd.DataFrame([dict(enumerate(sorted(p.values(), reverse=True))) for p in p_dist_full]).T
|
|
|
105 |
df_size = pd.DataFrame([{"min entity": mef, "max predicate": mpf, "freq": x} for x, (mef, mpf) in zip(data_size_full, candidates)])
|
106 |
df_size = df_size.pivot(index="min entity", columns="max predicate", values="freq")
|
107 |
df_size.index.name = "min entity / max predicate"
|
108 |
+
df_size.to_csv("data/stats.data_size.csv")
|
109 |
+
print(df_size.to_markdown())
|
110 |
df_size_p = pd.DataFrame(
|
111 |
[{"min entity": mef, "max predicate": mpf, "freq": len(x)} for x, (mef, mpf) in zip(p_dist_full, candidates)])
|
112 |
df_size_p = df_size_p.pivot(index="max predicate", columns="min entity", values="freq")
|
113 |
+
df_size_p = df_size_p.loc[10]
|
114 |
+
df_size_p.to_csv("data/stats.predicate_size.csv")
|
115 |
+
print(df_size_p.to_markdown())
|
116 |
|
117 |
# plot predicate distribution
|
118 |
df_p = pd.DataFrame([dict(enumerate(sorted(p.values(), reverse=True))) for p in p_dist_full]).T
|