Skip to content

Error trying to define distance_threshold whilst using AgglomerativeClustering #9

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

Open
SitrucL opened this issue Mar 31, 2024 · 0 comments

Comments

@SitrucL
Copy link

SitrucL commented Mar 31, 2024

ValueError: Exactly one of n_clusters and distance_threshold has to be set, and the other needs to be None.

    at ChildProcess.onMessage (/Users/curtis/Code/Personal/open-source-embeddings/node_modules/@fisch0920/python-bridge/index.js:44:32)
    at Object.onceWrapper (node:events:628:26)
    at ChildProcess.emit (node:events:513:28)
    at ChildProcess.emit (node:domain:489:12)
    at emit (node:internal/child_process:937:14)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  error: undefined,
  exception: {
    type: { name: 'ValueError', module: 'builtins' },
    message: 'Exactly one of n_clusters and distance_threshold has to be set, and the other needs to be None.',
    args: [
      'Exactly one of n_clusters and distance_threshold has to be set, and the other needs to be None.'
    ],
    format: [
      'ValueError: Exactly one of n_clusters and distance_threshold has to be set, and the other needs to be None.\n'
    ]
  },

implementation:

const model = new sklearn.AgglomerativeClustering({
		metric: "cosine",
		linkage: "average",
		// n_clusters: null as unknown as undefined,
		compute_full_tree: true,
		distance_threshold: 1.5,
	});

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