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

TypeError: __init__() takes from 1 to 2 positional arguments but 4 were given #4

Closed
ernohanninen opened this issue Jun 14, 2022 · 2 comments

Comments

@ernohanninen
Copy link

Hello,

When running this code:

num_trajs = 4
flavor = "k-means"
num_metacells = 300

adata = anndata.read_h5ad("/media/ernohanninen/TOSHIBA/cycletree.h5ad")

cellpath_obj = cp.CellPath(adata = adata, preprocess = True)
cellpath_obj.all_in_one(flavor = flavor, num_metacells = num_metacells, n_neighs = 13, num_trajs = num_trajs, prop_insert = 0.0, seed = 0, mode = "exact")

I get the following error:

Traceback (most recent call last):
File "run_CellPath.py", line 19, in
cellpath_obj.all_in_one(flavor = flavor, num_metacells = num_metacells, n_neighs = 13, num_trajs = num_trajs, prop_insert = 0.0, seed = 0, mode = "exact")
File "/home/ernohanninen/miniconda3/envs/TRAenv/lib/python3.8/site-packages/cellpath/cellpath.py", line 349, in all_in_one
self.meta_cell_construction(flavor = flavor, n_clusters = num_metacells, resolution = resolution, **kwargs)
File "/home/ernohanninen/miniconda3/envs/TRAenv/lib/python3.8/site-packages/cellpath/cellpath.py", line 121, in meta_cell_construction
self.X_clust, self.velo_clust = clust.meta_cells(self.adata, kernel = _kwargs["kernel"],
File "/home/ernohanninen/miniconda3/envs/TRAenv/lib/python3.8/site-packages/cellpath/clustering.py", line 136, in meta_cells
k = KernelRidge(alpha, kernel, gamma)
TypeError: init() takes from 1 to 2 positional arguments but 4 were given

@PeterZZQ
Copy link
Owner

Hi,

It was a bug due to the update of the sklearn package. I have updated the code on GitHub and also on Pypi. The bug should be fixed now. You can update your cellpath package with pip or directly pull the GitHub repo down to directly install from the source code.

@ernohanninen
Copy link
Author

The code is running. Thank you!

@PeterZZQ PeterZZQ closed this as completed Jul 7, 2024
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

2 participants