From 2bcd4f9e3b80576096fd167afc0d69cac4c081b6 Mon Sep 17 00:00:00 2001 From: Abdulrahman Semrie Date: Sun, 14 Apr 2019 14:51:26 +0300 Subject: [PATCH] Transposed the features dataframe Request here: https://github.com/MOZI-AI/service-result/issues/7 --- crossval/moses_cross_val.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crossval/moses_cross_val.py b/crossval/moses_cross_val.py index 6600442..5a6a63a 100644 --- a/crossval/moses_cross_val.py +++ b/crossval/moses_cross_val.py @@ -81,7 +81,10 @@ def run_folds(self): ensemble_df.to_csv("ensemble.csv", index=False) feature_count_df = pd.DataFrame.from_dict(self.tree_transformer.fcount) - feature_count_df.to_csv("feature_count.csv") + feature_count_df = feature_count_df.T + feature_count_df.reset_index(level=0, inplace=True) + feature_count_df = feature_count_df.rename(columns={"index": "feature"}) + feature_count_df.to_csv("feature_count.csv", index=False) def split_dataset(self): """