jianhao2016 / SimiC

this is the github repo for simicLASSO
5 stars 1 forks source link

TypeError: main_fn() got an unexpected keyword argument 'p2AUC' at wAUC in SimiC_example.R #2

Closed ggruenhagen3 closed 3 years ago

ggruenhagen3 commented 3 years ago

Hi,

At the end of the SimiC_example.R script, I get an error for an invalid argument to main_fn() in wAUC. I noticed that in weighted_AUC_mat.py script, the arguments to main_fn() are

p2df, p2res, p2saved_file, percent_of_target = 1, sort_by = 'expression', adj_r2_threshold = 0.7, select_top_k_targets = None, debug = False

but the arguments provided to the main_fn() in the example script are: p2df, p2saved_file, and p2AUC. So is this error due to the wrong arguments supplied to main_fn() in wAUC in the example R file?

More detailed output from my error (sorry for a few formatting issues):

Done loading, shape of X =
(500, 15090)
------ Begin the regression part...
df in regression shape =
(500, 15090)
df test =
(100, 15090)
test data assignment set: {0, 1, 2}
df train =
(400, 15090)
train data assignment set: {0, 1, 2}
-------
-------
.... generating train set
 cell type
0
TF size: (174, 51)
Target size: (174, 100)
cell type
1
TF size: (111, 51)
Target size: (111, 100)
cell type
2
TF size: (115, 51)
Target size: (115, 100)
-------
.... generating test set
cell type
0
TF size: (47, 51)
 Target size: (47, 100)
cell type
1
TF size: (24, 51)
 Target size: (24, 100)
cell type
2
TF size: (29, 51)
 Target size: (29, 100)
-------
-------
final train error w.o. reg = 3.2954+/-0.0000
test error w.o. reg = 4.2760+/-0.0000
 -------
R squared of test set(before): -10.9570
R squared of train set(after): 0.9366+/-0.0000
R squared of test set(after): 0.8686+/-0.0000
 dumping the dictionary to disk in pickle...
Done dumping!
 Error in py_call_impl(callable, dots$args, dots$keywords) :
 TypeError: main_fn() got an unexpected keyword argument 'p2AUC'
 Calls: wAUC -> py_call_impl
Execution halted
ggruenhagen3 commented 3 years ago

I flipped some of the arguments around and it worked. Here's what I changed: wAUC(p2df = p2df, p2res = p2saved_file, p2saved_file = p2AUC) And here's the output from the relevant section:

label 0 done in 7.6s
label 1 done in 7.5s
label 2 done in 7.3s

I noticed that in python example the same (incorrect?) arguments are used at line 43 and then again in the full pipeline notebook in step 3.

jianhao2016 commented 3 years ago

I flipped some of the arguments around and it worked. Here's what I changed: wAUC(p2df = p2df, p2res = p2saved_file, p2saved_file = p2AUC) And here's the output from the relevant section:

label 0 done in 7.6s
label 1 done in 7.5s
label 2 done in 7.3s

I noticed that in python example the same (incorrect?) arguments are used at line 43 and then again in the full pipeline notebook in step 3.

Thank you for pointing out these issues with the examples. We updated the main functions a couple times and examples for them are still with the old naming scheme. What you did here is correct, I will fixed the examples in the next commit.