Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cross validation with cox TypeError #3

Open
DBeZ opened this issue Dec 7, 2020 · 0 comments
Open

cross validation with cox TypeError #3

DBeZ opened this issue Dec 7, 2020 · 0 comments

Comments

@DBeZ
Copy link

DBeZ commented Dec 7, 2020

coxnet_model = glmnet_py.cvglmnet(x=x.copy(), y=y.copy(), family='cox', parallel=True)

Warning: Cox model has no intercept!
Warning: Cox model has no intercept!
Warning: Cox model has no intercept!
Traceback (most recent call last):
File "/home/username/.pycharm_helpers/pydev/pydevd.py", line 1448, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "/home/username/.pycharm_helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/home/username/directories/filname.py", line 530, in
filname()
File "/home/username/directories/python/functions/filname.py", line 280, in partner_selection_train_model
cox_train = train_coxnet(genomic_matrix_training, survival_time_training, survival_status_training)
File "/home/username/directories/python/functions/filname.py", line 199, in train_coxnet
coxnet_model = glmnet_py.cvglmnet(x=x.copy(), y=y.copy(), family='cox', parallel=True) #TypeError: 'numpy.float64' object cannot be interpreted as an integer
File "/home/username/miniconda3/envs/envname/lib/python3.7/site-packages/glmnet_py/cvglmnet.py", line 260, in cvglmnet
ma = scipy.tile(scipy.arange(nfolds), [1, scipy.floor(nobs/nfolds)])
File "/home/username/miniconda3/envs/envname/lib/python3.7/site-packages/scipy/_lib/deprecation.py", line 20, in call
return fun(*args, **kwargs)
File "<array_function internals>", line 6, in tile
File "/home/username/miniconda3/envs/envname/lib/python3.7/site-packages/numpy/lib/shape_base.py", line 1260, in tile
return c.reshape(shape_out)
TypeError: 'numpy.float64' object cannot be interpreted as an integer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant