You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
It seems that PHATE supports minkowski metric for both mds and knn computations. So, I would like to use this metric with p= 0.3 for running experiments. The code does not recognize the use of 'p= 0.3' when calling phate.PHATE
Expected behavior
The initialization of phate object should take 'p= 0.3' as part of the parameters to initialize phate object
Actual behavior
Traceback (most recent call last):
File "test_phenograph_clustering.py", line 94, in
projected_data= embedding.fit_transform(X= input_data)
File "C:\Temp\Python\Python3.6.5\lib\site-packages\phate\phate.py", line 961, in fit_transform
self.fit(X)
File "C:\Temp\Python\Python3.6.5\lib\site-packages\phate\phate.py", line 853, in fit
**(self.kwargs)
File "C:\Temp\Python\Python3.6.5\lib\site-packages\graphtools\api.py", line 288, in Graph
return Graph(**params)
File "C:\Temp\Python\Python3.6.5\lib\site-packages\graphtools\graphs.py", line 132, in init
super().init(data, n_pca=n_pca, **kwargs)
File "C:\Temp\Python\Python3.6.5\lib\site-packages\graphtools\graphs.py", line 524, in init
super().init(data, **kwargs)
File "C:\Temp\Python\Python3.6.5\lib\site-packages\graphtools\base.py", line 1019, in init
super().init(data, **kwargs)
File "C:\Temp\Python\Python3.6.5\lib\site-packages\graphtools\base.py", line 135, in init
super().init(**kwargs)
File "C:\Temp\Python\Python3.6.5\lib\site-packages\graphtools\base.py", line 505, in init
super().init(**kwargs)
TypeError: init() got an unexpected keyword argument 'p'
System information:
Output of phate.__version__:
Please run phate.__version__ and paste the results here.
You can do this with `python -c 'import phate; print(phate.__version__)'`
phate-1.0.7
PHATE doesn't currently offer this functionality, though the new maintainers may choose to add it. In the meantime, you should be able to achieve you desired outcome with a custom metric function as follows:
import phate
from functools import partial
from scipy.spatial.distance import minkowski
dist_fn = partial(minkowski, p=0.3)
phate_op = phate.PHATE(knn_dist=dist_fn, mds_dist=dist_fn)
I'm leaving this issue open as a feature request but please let me know if the proposed alternative doesn't work and we can open up a bug report separately.
Describe the bug
It seems that PHATE supports minkowski metric for both mds and knn computations. So, I would like to use this metric with p= 0.3 for running experiments. The code does not recognize the use of 'p= 0.3' when calling phate.PHATE
Thanks for your help,
Ivan
To Reproduce
embedding= phate.PHATE(n_components= intrinsic_dim, knn= 5, decay= None, n_landmark= 2000, t= 'auto',
gamma= 1.0, n_pca= input_data.shape[1], mds_solver= 'smacof',
knn_dist= 'minkowski', mds_dist= 'minkowski', mds= 'classic', random_state= 1969,
n_jobs= cpu_count, verbose= False, p= 0.3)
Expected behavior
The initialization of phate object should take 'p= 0.3' as part of the parameters to initialize phate object
Actual behavior
Traceback (most recent call last):
File "test_phenograph_clustering.py", line 94, in
projected_data= embedding.fit_transform(X= input_data)
File "C:\Temp\Python\Python3.6.5\lib\site-packages\phate\phate.py", line 961, in fit_transform
self.fit(X)
File "C:\Temp\Python\Python3.6.5\lib\site-packages\phate\phate.py", line 853, in fit
**(self.kwargs)
File "C:\Temp\Python\Python3.6.5\lib\site-packages\graphtools\api.py", line 288, in Graph
return Graph(**params)
File "C:\Temp\Python\Python3.6.5\lib\site-packages\graphtools\graphs.py", line 132, in init
super().init(data, n_pca=n_pca, **kwargs)
File "C:\Temp\Python\Python3.6.5\lib\site-packages\graphtools\graphs.py", line 524, in init
super().init(data, **kwargs)
File "C:\Temp\Python\Python3.6.5\lib\site-packages\graphtools\base.py", line 1019, in init
super().init(data, **kwargs)
File "C:\Temp\Python\Python3.6.5\lib\site-packages\graphtools\base.py", line 135, in init
super().init(**kwargs)
File "C:\Temp\Python\Python3.6.5\lib\site-packages\graphtools\base.py", line 505, in init
super().init(**kwargs)
TypeError: init() got an unexpected keyword argument 'p'
System information:
Output of
phate.__version__
:Output of
pd.show_versions()
:Additional context
Python 3.6.5 with Deprecated-1.2.12 graphtools-1.5.2 phate-1.0.7 pygsp-0.5.1 s-gd2-1.8 scprep-1.1.0 tasklogger-1.1.0
The text was updated successfully, but these errors were encountered: