Skip to content

Error trying to define distance_threshold whilst using AgglomerativeClustering #9

@SitrucL

Description

@SitrucL
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,
	});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions