File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed
Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -30,20 +30,20 @@ def main():
3030 else :
3131 order_acc .append (precision )
3232 acc_df .append (pd .read_csv (file ))
33- order_mse = [( i , x ) for i , x in enumerate (order_mse )]
34- order_acc = [( i , x ) for i , x in enumerate (order_acc )]
33+ order_mse = list ( enumerate (order_mse ))
34+ order_acc = list ( enumerate (order_acc ))
3535 order_mse .sort (key = lambda x : x [1 ])
3636 order_acc .sort (key = lambda x : x [1 ])
3737
38- datasets = np .array ([ x for x in mse_df [0 ]['dataset' ]] )
38+ datasets = np .array (list ( mse_df [0 ]['dataset' ]) )
3939 index = [idx for idx , elem in enumerate (datasets ) if dataset in elem ][0 ]
4040
41- acc_algorithms = np .array ([[ x for x in df .iloc [index ][1 :]] for df in
41+ acc_algorithms = np .array ([list ( df .iloc [index ][1 :]) for df in
4242 acc_df ])
4343 acc_algorithms = np .array ([acc_algorithms [x ] for x , _ in order_acc ])
4444 acc_algorithms = acc_algorithms .astype (float )
4545
46- mse_algorithms = np .array ([[ x for x in df .iloc [index ][1 :]] for df in
46+ mse_algorithms = np .array ([list ( df .iloc [index ][1 :]) for df in
4747 mse_df ])
4848 mse_algorithms = np .array ([mse_algorithms [x ] for x , _ in order_mse ])
4949 mse_algorithms = mse_algorithms .astype (float )
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ def test_unlabeled(dataset):
3030 else :
3131 tree_mse_df = pd .read_csv (name )
3232
33- datasets = np .array ([ x for x in knn_acc_df ['dataset' ]] )
33+ datasets = np .array (list ( knn_acc_df ['dataset' ]) )
3434 index = [idx for idx , elem in enumerate (datasets ) if dataset in elem ][0 ]
3535
3636 precision = np .array (knn_acc_df .keys ()[1 :])
Original file line number Diff line number Diff line change @@ -115,8 +115,8 @@ def arff2sk_dataset(dataset_path):
115115 tar_names = np .array (dataset ['attributes' ][- 1 ][1 ]).astype (int )
116116 tar = tt .astype (int )
117117 except ValueError :
118- tar_names = np .array ([ x for x in range (len (dataset ['attributes' ][- 1 ][
119- 1 ]))] )
118+ tar_names = np .array (list ( range (len (dataset ['attributes' ][- 1 ][
119+ 1 ]))) )
120120 relation = {}
121121 for index , target in enumerate (dataset ['attributes' ][- 1 ][1 ]):
122122 relation [target ] = index
You can’t perform that action at this time.
0 commit comments