hassonlab / 247-encoding

Contains python scripts for performing encoding on 247 data.
0 stars 9 forks source link

code improvement #34

Closed hvgazula closed 2 years ago

hvgazula commented 2 years ago

Replace this piece of code with

prod_train = prod_X, prod_Y, fold_cat_prod
comp_train = comp_X, comp_Y, fold_cat_comp

if args.model_mod == 'pc-flip':
    prod_test, comp_test = comp_train, prod_train
else:
    prod_test, comp_test = prod_train, comp_train

prod_results = run_regression(args, *prod_train, *prod_test, fold_num)
comp_results = run_regression(args, *comp_train, *comp_test, fold_num)
hvgazula commented 2 years ago

@zkokaja what do you think?

hvgazula commented 2 years ago

I guess you cannot have an unnamed argument after *args, either move fold_num to the beginning or add a default value.

zkokaja commented 2 years ago

Shouldn't fold_num be in args anyways? Then we can remove it from the function parameters

VeritasJoker commented 2 years ago

Ok, thanks Harsha and Zaid! I will modify those and create a new pull request.

zkokaja commented 2 years ago

Closed pull pull request #35