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

TSNE layout does not work anymore #9

Open
ObT1337 opened this issue Mar 5, 2024 · 0 comments
Open

TSNE layout does not work anymore #9

ObT1337 opened this issue Mar 5, 2024 · 0 comments

Comments

@ObT1337
Copy link

ObT1337 commented Mar 5, 2024

Problem:

In the embed_tsne_2D function within cartoGRAPHs.py, there's an unexpected error occurring. Specifically, it's triggered by an unexpected keyword argument square_distances in the TSNE initialization.

Error Traceback:

  File ".../lib/python3.9/site-packages/cartoGRAPHs/func_embed_plot.py", line 77, in embed_tsne_3D
    tsne3d = TSNE(n_components=3, random_state=0, perplexity=prplxty, square_distances=True)
TypeError: __init__() got an unexpected keyword argument 'square_distances'

Reference:
The unexpected keyword argument square_distances is detailed in the TSNE documentation as deprecated since version 1.1 of scikit-learn:


square_distances=True, default='deprecated'
This parameter has no effect since distance values are always squared since 1.1.

Deprecated since version 1.1: square_distances has no effect from 1.1 and will be removed in 1.3. scikit-learn==1.3.2

Suggested Fix:

To resolve this issue, I suggest adjusting the package requirements to ensure compatibility with scikit-learn versions where the square_distances argument is still supported, although without any effect.

Proposed Solution:

  1. Set requirements to scikit-learn==1.2 or lower, where the argument square_distances is still supported but has no impact on functionality.
  2. Update to the newest version and remove the suqare_distance argument as it as not effect anymore and is no more supported.

This adjustment should resolve the unexpected keyword argument issue and ensure compatibility across different scikit-learn versions.

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