1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4360],{35645:(e,n,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/docs/classes/AgglomerativeClustering",function(){return s(22314)}])},22314:(e,n,s)=>{"use strict";s.r(n),s.d(n,{default:()=>c,useTOC:()=>l});var r=s(86106),i=s(30138),t=s(32126),d=s(69912);function l(e){return[{value:"Constructors",id:"constructors",depth:2},{value:"new AgglomerativeClustering()",id:"new-agglomerativeclustering",depth:3},{value:"Properties",id:"properties",depth:2},{value:"Accessors",id:"accessors",depth:2},{value:"children_",id:"children_",depth:3},{value:"distances_",id:"distances_",depth:3},{value:"feature_names_in_",id:"feature_names_in_",depth:3},{value:"labels_",id:"labels_",depth:3},{value:"n_clusters_",id:"n_clusters_",depth:3},{value:"n_connected_components_",id:"n_connected_components_",depth:3},{value:"n_features_in_",id:"n_features_in_",depth:3},{value:"n_leaves_",id:"n_leaves_",depth:3},{value:"py",id:"py",depth:3},{value:"Methods",id:"methods",depth:2},{value:"dispose()",id:"dispose",depth:3},{value:"fit()",id:"fit",depth:3},{value:"fit_predict()",id:"fit_predict",depth:3},{value:"get_metadata_routing()",id:"get_metadata_routing",depth:3},{value:"init()",id:"init",depth:3}]}let c=(0,i.e)(function(e){let{toc:n=l(e)}=e,s={a:"a",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,d.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.h1,{children:"Class: AgglomerativeClustering"}),"\n",(0,r.jsx)(s.p,{children:"Agglomerative Clustering."}),"\n",(0,r.jsx)(s.p,{children:"Recursively merges pair of clusters of sample data; uses linkage distance."}),"\n",(0,r.jsxs)(s.p,{children:["Read more in the ",(0,r.jsx)(s.a,{href:"https://scikit-learn.org/stable/modules/generated/../clustering.html#hierarchical-clustering",children:"User Guide"}),"."]}),"\n",(0,r.jsx)(s.p,{children:(0,r.jsx)(s.a,{href:"https://scikit-learn.org/stable/modules/generated/sklearn.cluster.AgglomerativeClustering.html",children:"Python Reference"})}),"\n",(0,r.jsx)(s.h2,{id:n[0].id,children:n[0].value}),"\n",(0,r.jsx)(s.h3,{id:n[1].id,children:n[1].value}),"\n",(0,r.jsxs)(s.blockquote,{children:["\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"new AgglomerativeClustering"}),"(",(0,r.jsx)(s.code,{children:"opts"}),"?): ",(0,r.jsx)(s.a,{href:"AgglomerativeClustering",children:(0,r.jsx)(s.code,{children:"AgglomerativeClustering"})})]}),"\n"]}),"\n",(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Parameters"})}),"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",(0,r.jsxs)(s.table,{children:[(0,r.jsx)(s.thead,{children:(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.th,{children:"Parameter"}),(0,r.jsx)(s.th,{children:"Type"}),(0,r.jsx)(s.th,{children:"Description"})]})}),(0,r.jsxs)(s.tbody,{children:[(0,r.jsxs)(s.tr,{children:[(0,r.jsxs)(s.td,{children:[(0,r.jsx)(s.code,{children:"opts"}),"?"]}),(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"object"})}),(0,r.jsx)(s.td,{children:"-"})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsxs)(s.td,{children:[(0,r.jsx)(s.code,{children:"opts.compute_distances"}),"?"]}),(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"boolean"})}),(0,r.jsxs)(s.td,{children:["Computes distances between clusters even if ",(0,r.jsx)(s.code,{children:"distance_threshold"})," is not used. This can be used to make dendrogram visualization, but introduces a computational and memory overhead."]})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsxs)(s.td,{children:[(0,r.jsx)(s.code,{children:"opts.compute_full_tree"}),"?"]}),(0,r.jsxs)(s.td,{children:[(0,r.jsx)(s.code,{children:"boolean"})," | ",(0,r.jsx)(s.code,{children:'"auto"'})]}),(0,r.jsxs)(s.td,{children:["Stop early the construction of the tree at ",(0,r.jsx)(s.code,{children:"n_clusters"}),". This is useful to decrease computation time if the number of clusters is not small compared to the number of samples. This option is useful only when specifying a connectivity matrix. Note also that when varying the number of cluster
1s and using caching, it may be advantageous to compute the full tree. It must be ",(0,r.jsx)(s.code,{children:"true"})," if ",(0,r.jsx)(s.code,{children:"distance_threshold"})," is not ",(0,r.jsx)(s.code,{children:"undefined"}),". By default ",(0,r.jsx)(s.code,{children:"compute_full_tree"})," is âautoâ, which is equivalent to ",(0,r.jsx)(s.code,{children:"true"})," when ",(0,r.jsx)(s.code,{children:"distance_threshold"})," is not ",(0,r.jsx)(s.code,{children:"undefined"})," or that ",(0,r.jsx)(s.code,{children:"n_clusters"})," is inferior to the maximum between 100 or ",(0,r.jsx)(s.code,{children:"0.02 \\* n_samples"}),". Otherwise, âautoâ is equivalent to ",(0,r.jsx)(s.code,{children:"false"}),"."]})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsxs)(s.td,{children:[(0,r.jsx)(s.code,{children:"opts.connectivity"}),"?"]}),(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"ArrayLike"})}),(0,r.jsxs)(s.td,{children:["Connectivity matrix. Defines for each sample the neighboring samples following a given structure of the data. This can be a connectivity matrix itself or a callable that transforms the data into a connectivity matrix, such as derived from ",(0,r.jsx)(s.code,{children:"kneighbors_graph"}),". Default is ",(0,r.jsx)(s.code,{children:"undefined"}),", i.e, the hierarchical clustering algorithm is unstructured. For an example of connectivity matrix using ",(0,r.jsx)(s.a,{href:"https://scikit-learn.org/stable/modules/generated/sklearn.neighbors.kneighbors_graph.html#sklearn.neighbors.kneighbors_graph",title:"sklearn.neighbors.kneighbors_graph",children:(0,r.jsx)(s.code,{children:"kneighbors_graph"})}),", see ",(0,r.jsx)(s.a,{href:"https://scikit-learn.org/stable/modules/generated/../../auto_examples/cluster/plot_agglomerative_clustering.html#sphx-glr-auto-examples-cluster-plot-agglomerative-clustering-py",children:"Agglomerative clustering with and without structure"}),"."]})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsxs)(s.td,{children:[(0,r.jsx)(s.code,{children:"opts.distance_threshold"}),"?"]}),(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"number"})}),(0,r.jsxs)(s.td,{children:["The linkage distance threshold at or above which clusters will not be merged. If not ",(0,r.jsx)(s.code,{children:"undefined"}),", ",(0,r.jsx)(s.code,{children:"n_clusters"})," must be ",(0,r.jsx)(s.code,{children:"undefined"})," and ",(0,r.jsx)(s.code,{children:"compute_full_tree"})," must be ",(0,r.jsx)(s.code,{children:"true"}),"."]})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsxs)(s.td,{children:[(0,r.jsx)(s.code,{children:"opts.linkage"}),"?"]}),(0,r.jsxs)(s.td,{children:[(0,r.jsx)(s.code,{children:'"ward"'})," | ",(0,r.jsx)(s.code,{children:'"complete"'})," | ",(0,r.jsx)(s.code,{children:'"average"'})," | ",(0,r.jsx)(s.code,{children:'"single"'})]}),(0,r.jsx)(s.td,{children:"Which linkage criterion to use. The linkage criterion determines which distance to use between sets of observation. The algorithm will merge the pairs of cluster that minimize this criterion."})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsxs)(s.td,{children:[(0,r.jsx)(s.code,{children:"opts.memory"}),"?"]}),(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"string"})}),(0,r.jsx)(s.td,{children:"Used to cache the output of the computation of the tree. By default, no caching is done. If a string is given, it is the path to the caching directory."})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsxs)(s.td,{children:[(0,r.jsx)(s.code,{children:"opts.metric"}),"?"]}),(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"string"})}),(0,r.jsx)(s.td,{children:"Metric used to compute the linkage. Can be âeuclideanâ, âl1â, âl2â, âmanhattanâ, âcosineâ, or âprecomputedâ. If linkage is âwardâ, only âeuclideanâ is accepted. If âprecomputedâ, a distance matrix is needed as input for the fit method."})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsxs)(s.td,{children:[(0,r.jsx)(s.code,{children:"opts.n_clusters"}),"?"]}),(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"number"})}),(0,r.jsxs)(s.td,{children:["The number of clusters to find. It must be ",(0,r.jsx)(s.code,{children:"undefined"})," if ",(0,r.jsx)(s.code,{children:"distance_threshold"})," is not ",(0,r.jsx)(s.code,{children:"undefined"}),"."]})]})]})]}),"\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"Returns"})," ",(0,r.jsx)(s.a,{href:"AgglomerativeClustering",children:(0,r.jsx)(s.code,{children:"AgglomerativeClustering"})})]}),"\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"Defined in"})," ",(0,r.jsx)(s.a,{href:"https://github.com/transitive-bullshit/scikit-learn-ts/blob/bab9a6d8b9738b16b8b9ba0b3f7cea1495d968d8/packages/sklearn/src/generated/cluster/AgglomerativeClustering.ts#L25",children:"generated/cluster/AgglomerativeClustering.ts:25"})]}),"\n",(0,r.jsx)(s.h2,{id:n[2].id,children:n[2].value}),"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",(0,r.jsxs)(s.table,{children:[(0,r.jsx)(s.thead,{children:(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.th,{children:"Property"}),(0,r.jsx)(s.th,{children:"Type"}),(0,r.jsx)(s.th,{children:"Default value"}),(0,r.jsx)(s.th,{children:"Defined in"})]})}),(0,r.jsxs)(s.tbody,{children:[(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"_isDisposed"})}),(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"boolean"})}),(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"false"})}),(0,r.jsx)(s.td,{children:(0,r.jsx)(s.a,{href:"https://github.com/transitive-bullshit/scikit-learn-ts/blob/bab9a6d8b9738b16b8b9ba0b3f7cea1495d968d8/packages/sklearn/src/generated/cluster/AgglomerativeClustering.ts#L23",children:"generated/cluster/AgglomerativeClustering.ts:23"})})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"_isInitialized"})}),(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"boolean"})}),(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"false"})}),(0,r.jsx)(s.td,{children:(0,r.jsx)(s.a,{href:"https://github.com/transitive-bullshit/scikit-learn-ts/blob/bab9a6d8b9738b16b8b9ba0b3f7cea1495d968d8/packages/sklearn/src/generated/cluster/AgglomerativeClustering.ts#L22",children:"generated/cluster/AgglomerativeClustering.ts:22"})})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"_py"})}),(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"PythonBridge"})}),(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"undefined"})}),(0,r.jsx)(s.td,{children:(0,r.jsx)(s.a,{href:"https://github.com/transitive-bullshit/scikit-learn-ts/blob/bab9a6d8b9738b16b8b9ba0b3f7cea1495d968d8/packages/sklearn/src/generated/cluster/AgglomerativeClustering.ts#L21",children:"generated/cluster/AgglomerativeClustering.ts:21"})})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"id"})}),(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"string"})}),(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"undefined"})}),(0,r.jsx)(s.td,{children:(0,r.jsx)(s.a,{href:"https://github.com/transitive-bullshit/scikit-learn-ts/blob/bab9a6d8b9738b16b8b9ba0b3f7cea1495d968d8/packages/sklearn/src/generated/cluster/AgglomerativeClustering.ts#L18",children:"generated/cluster/AgglomerativeClustering.ts:18"})})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"opts"})}),(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"any"})}),(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"undefined"})}),(0,r.jsx)(s.td,{children:(0,r.jsx)(s.a,{href:"https://github.com/transitive-bullshit/scikit-learn-ts/blob/bab9a6d8b9738b16b8b9ba0b3f7cea1495d968d8/packages/sklearn/src/generated/cluster/AgglomerativeClustering.ts#L19",children:"generated/cluster/AgglomerativeClustering.ts:19"})})]})]})]}),"\n",(0,r.jsx)(s.h2,{id:n[3].id,children:n[3].value}),"\n",(0,r.jsx)(s.h3,{id:n[4].id,children:n[4].value}),"\n",(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Get Signature"})}),"\n",(0,r.jsxs)(s.blockquote,{children:["\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"get"})," ",(0,r.jsx)(s.strong,{children:"children_"}),"(): ",(0,r.jsx)(s.code,{children:"Promise"}),"<",(0,r.jsx)(s.code,{children:"ArrayLike"}),"[]>"]}),"\n"]}),"\n",(0,r.jsxs)(s.p,{children:["The children of each non-leaf node. Values less than ",(0,r.jsx)(s.code,{children:"n_samples"})," correspond to leaves of the tree which are the original samples. A node ",(0,r.jsx)(s.code,{children:"i"})," greater than or equal to ",(0,r.jsx)(s.code,{children:"n_samples"}
1)," is a non-leaf node and has children ",(0,r.jsx)(s.code,{children:"children_\\[i \\- n_samples\\]"}),". Alternatively at the i-th iteration, children[i][0] and children[i][1] are merged to form node ",(0,r.jsx)(s.code,{children:"n_samples + i"}),"."]}),"\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"Returns"})," ",(0,r.jsx)(s.code,{children:"Promise"}),"<",(0,r.jsx)(s.code,{children:"ArrayLike"}),"[]>"]}),"\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"Defined in"})," ",(0,r.jsx)(s.a,{href:"https://github.com/transitive-bullshit/scikit-learn-ts/blob/bab9a6d8b9738b16b8b9ba0b3f7cea1495d968d8/packages/sklearn/src/generated/cluster/AgglomerativeClustering.ts#L437",children:"generated/cluster/AgglomerativeClustering.ts:437"})]}),"\n",(0,r.jsx)(s.hr,{}),"\n",(0,r.jsx)(s.h3,{id:n[5].id,children:n[5].value}),"\n",(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Get Signature"})}),"\n",(0,r.jsxs)(s.blockquote,{children:["\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"get"})," ",(0,r.jsx)(s.strong,{children:"distances_"}),"(): ",(0,r.jsx)(s.code,{children:"Promise"}),"<",(0,r.jsx)(s.code,{children:"ArrayLike"}),">"]}),"\n"]}),"\n",(0,r.jsxs)(s.p,{children:["Distances between nodes in the corresponding place in ",(0,r.jsx)(s.code,{children:"children_"}),". Only computed if ",(0,r.jsx)(s.code,{children:"distance_threshold"})," is used or ",(0,r.jsx)(s.code,{children:"compute_distances"})," is set to ",(0,r.jsx)(s.code,{children:"true"}),"."]}),"\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"Returns"})," ",(0,r.jsx)(s.code,{children:"Promise"}),"<",(0,r.jsx)(s.code,{children:"ArrayLike"}),">"]}),"\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"Defined in"})," ",(0,r.jsx)(s.a,{href:"https://github.com/transitive-bullshit/scikit-learn-ts/blob/bab9a6d8b9738b16b8b9ba0b3f7cea1495d968d8/packages/sklearn/src/generated/cluster/AgglomerativeClustering.ts#L464",children:"generated/cluster/AgglomerativeClustering.ts:464"})]}),"\n",(0,r.jsx)(s.hr,{}),"\n",(0,r.jsx)(s.h3,{id:n[6].id,children:n[6].value}),"\n",(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Get Signature"})}),"\n",(0,r.jsxs)(s.blockquote,{children:["\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"get"})," ",(0,r.jsx)(s.strong,{children:"feature_names_in_"}),"(): ",(0,r.jsx)(s.code,{children:"Promise"}),"<",(0,r.jsx)(s.code,{children:"ArrayLike"}),">"]}),"\n"]}),"\n",(0,r.jsxs)(s.p,{children:["Names of features seen during ",(0,r.jsx)(s.a,{href:"https://scikit-learn.org/stable/modules/generated/../../glossary.html#term-fit",children:"fit"}),". Defined only when ",(0,r.jsx)(s.code,{children:"X"})," has feature names that are all strings."]}),"\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"Returns"})," ",(0,r.jsx)(s.code,{children:"Promise"}),"<",(0,r.jsx)(s.code,{children:"ArrayLike"}),">"]}),"\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"Defined in"})," ",(0,r.jsx)(s.a,{href:"https://github.com/transitive-bullshit/scikit-learn-ts/blob/bab9a6d8b9738b16b8b9ba0b3f7cea1495d968d8/packages/sklearn/src/generated/cluster/AgglomerativeClustering.ts#L410",children:"generated/cluster/AgglomerativeClustering.ts:410"})]}),"\n",(0,r.jsx)(s.hr,{}),"\n",(0,r.jsx)(s.h3,{id:n[7].id,children:n[7].value}),"\n",(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Get Signature"})}),"\n",(0,r.jsxs)(s.blockquote,{children:["\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"get"})," ",(0,r.jsx)(s.strong,{children:"labels_"}),"(): ",(0,r.jsx)(s.code,{children:"Promise"}),"<",(0,r.jsx)(s.code,{children:"ArrayLike"}),">"]}),"\n"]}),"\n",(0,r.jsx)(s.p,{children:"Cluster labels for each point."}),"\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"Returns"})," ",(0,r.jsx)(s.code,{children:"Promise"}),"<",(0,r.jsx)(s.code,{children:"ArrayLike"}),">"]}),"\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"Defined in"})," ",(0,r.jsx)(s.a,{href:"https://github.com/transitive-bullshit/scikit-learn-ts/blob/bab9a6d8b9738b16b8b9ba0b3f7cea1495d968d8/packages/sklearn/src/generated/cluster/AgglomerativeClustering.ts#L302",children:"generated/cluster/AgglomerativeClustering.ts:302"})]}),"\n",(0,r.jsx)(s.hr,{}),"\n",(0,r.jsx)(s.h3,{id:n[8].id,children:n[8].value}),"\n",(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Get Signature"})}),"\n",(0,r.jsxs)(s.blockquote,{children:["\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"get"})," ",(0,r.jsx)(s.strong,{children:"n_clusters_"}),"(): ",(0,r.jsx)(s.code,{children:"Promise"}),"<",(0,r.jsx)(s.code,{children:"number"}),">"]}),"\n"]}
1),"\n",(0,r.jsxs)(s.p,{children:["The number of clusters found by the algorithm. If ",(0,r.jsx)(s.code,{children:"distance_threshold=None"}),", it will be equal to the given ",(0,r.jsx)(s.code,{children:"n_clusters"}),"."]}),"\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"Returns"})," ",(0,r.jsx)(s.code,{children:"Promise"}),"<",(0,r.jsx)(s.code,{children:"number"}),">"]}),"\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"Defined in"})," ",(0,r.jsx)(s.a,{href:"https://github.com/transitive-bullshit/scikit-learn-ts/blob/bab9a6d8b9738b16b8b9ba0b3f7cea1495d968d8/packages/sklearn/src/generated/cluster/AgglomerativeClustering.ts#L275",children:"generated/cluster/AgglomerativeClustering.ts:275"})]}),"\n",(0,r.jsx)(s.hr,{}),"\n",(0,r.jsx)(s.h3,{id:n[9].id,children:n[9].value}),"\n",(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Get Signature"})}),"\n",(0,r.jsxs)(s.blockquote,{children:["\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"get"})," ",(0,r.jsx)(s.strong,{children:"n_connected_components_"}),"(): ",(0,r.jsx)(s.code,{children:"Promise"}),"<",(0,r.jsx)(s.code,{children:"number"}),">"]}),"\n"]}),"\n",(0,r.jsx)(s.p,{children:"The estimated number of connected components in the graph."}),"\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"Returns"})," ",(0,r.jsx)(s.code,{children:"Promise"}),"<",(0,r.jsx)(s.code,{children:"number"}),">"]}),"\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"Defined in"})," ",(0,r.jsx)(s.a,{href:"https://github.com/transitive-bullshit/scikit-learn-ts/blob/bab9a6d8b9738b16b8b9ba0b3f7cea1495d968d8/packages/sklearn/src/generated/cluster/AgglomerativeClustering.ts#L356",children:"generated/cluster/AgglomerativeClustering.ts:356"})]}),"\n",(0,r.jsx)(s.hr,{}),"\n",(0,r.jsx)(s.h3,{id:n[10].id,children:n[10].value}),"\n",(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Get Signature"})}),"\n",(0,r.jsxs)(s.blockquote,{children:["\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"get"})," ",(0,r.jsx)(s.strong,{children:"n_features_in_"}),"(): ",(0,r.jsx)(s.code,{children:"Promise"}),"<",(0,r.jsx)(s.code,{children:"number"}),">"]}),"\n"]}),"\n",(0,r.jsxs)(s.p,{children:["Number of features seen during ",(0,r.jsx)(s.a,{href:"https://scikit-learn.org/stable/modules/generated/../../glossary.html#term-fit",children:"fit"}),"."]}),"\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"Returns"})," ",(0,r.jsx)(s.code,{children:"Promise"}),"<",(0,r.jsx)(s.code,{children:"number"}),">"]}),"\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"Defined in"})," ",(0,r.jsx)(s.a,{href:"https://github.com/transitive-bullshit/scikit-learn-ts/blob/bab9a6d8b9738b16b8b9ba0b3f7cea1495d968d8/packages/sklearn/src/generated/cluster/AgglomerativeClustering.ts#L383",children:"generated/cluster/AgglomerativeClustering.ts:383"})]}),"\n",(0,r.jsx)(s.hr,{}),"\n",(0,r.jsx)(s.h3,{id:n[11].id,children:n[11].value}),"\n",(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Get Signature"})}),"\n",(0,r.jsxs)(s.blockquote,{children:["\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"get"})," ",(0,r.jsx)(s.strong,{children:"n_leaves_"}),"(): ",(0,r.jsx)(s.code,{children:"Promise"}),"<",(0,r.jsx)(s.code,{children:"number"}),">"]}),"\n"]}),"\n",(0,r.jsx)(s.p,{children:"Number of leaves in the hierarchical tree."}),"\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"Returns"})," ",(0,r.jsx)(s.code,{children:"Promise"}),"<",(0,r.jsx)(s.code,{children:"number"}),">"]}),"\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"Defined in"})," ",(0,r.jsx)(s.a,{href:"https://github.com/transitive-bullshit/scikit-learn-ts/blob/bab9a6d8b9738b16b8b9ba0b3f7cea1495d968d8/packages/sklearn/src/generated/cluster/AgglomerativeClustering.ts#L329",children:"generated/cluster/AgglomerativeClustering.ts:329"})]}),"\n",(0,r.jsx)(s.hr,{}),"\n",(0,r.jsx)(s.h3,{id:n[12].id,children:n[12].value}),"\n",(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Get Signature"})}),"\n",(0,r.jsxs)(s.blockquote,{children:["\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"get"})," ",(0,r.jsx)(s.strong,{children:"py"}),"(): ",(0,r.jsx)(s.code,{children:"PythonBridge"})]}),"\n"]}),"\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"Returns"})," ",(0,r.jsx)(s.code,{children:"PythonBridge"})]}),"\n",(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Set Signature"})}),"\n",(0,r.jsxs)(s.blockquote,{children:["\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"set"})," ",(0,r.jsx)(s.strong,{children:"py"}),"(",(0,r.jsx)(s.code,{children:"pythonBridge"}),"): ",(0,r.jsx)(s.code,{children:"void"})]}),"\n"]}),"\n",(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Parameters"})}),"\n\n\n\n\n\n\n\n\n\n\n\n\n\n",(0,r.jsxs)(s.table,{children:[(0,r.jsx)(s.thead,{children:(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.th,{children:"Parameter"}),(0,r.jsx)(s.th,{children:"Type"})]})}),(0,r.jsx)(s.tbody,{children:(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"pythonBridge"})}),(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"PythonBridge"})})]})})]}),"\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"Returns"})," ",(0,r.jsx)(s.code,{children:"void"})]}),"\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"Defined in"})," ",(0,r.jsx)(s.a,{href:"https://github.com/transitive-bullshit/scikit-learn-ts/blob/bab9a6d8b9738b16b8b9ba0b3f7cea1495d968d8/packages/sklearn/src/generated/cluster/AgglomerativeClustering.ts#L82",children:"generated/cluster/AgglomerativeClustering.ts:82"})]}),"\n",(0,r.jsx)(s.h2,{id:n[13].id,children:n[13].value}),"\n",(0,r.jsx)(s.h3,{id:n[14].id,children:n[14].value}),"\n",(0,r.jsxs)(s.blockquote,{children:["\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"dispose"}),"(): ",(0,r.jsx)(s.code,{children:"Promise"}),"<",(0,r.jsx)(s.code,{children:"void"}),">"]}),"\n"]}),"\n",(0,r.jsx)(s.p,{children:"Disposes of the underlying Python resources."}),"\n",(0,r.jsxs)(s.p,{children:["Once ",(0,r.jsx)(s.code,{children:"dispose()"})," is called, the instance is no longer usable."]}),"\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"Returns"})," ",(0,r.jsx)(s.code,{children:"Promise"}),"<",(0,r.jsx)(s.code,{children:"void"}),">"]}),"\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"Defined in"})," ",(0,r.jsx)(s.a,{href:"https://github.com/transitive-bullshit/scikit-learn-ts/blob/bab9a6d8b9738b16b8b9ba0b3f7cea1495d968d8/packages/sklearn/src/generated/cluster/AgglomerativeClustering.ts#L138",children:"generated/cluster/AgglomerativeClustering.ts:138"})]}),"\n",(0,r.jsx)(s.hr,{}),"\n",(0,r.jsx)(s.h3,{id:n[15].id,children:n[15].value}),"\n",(0,r.jsxs)(s.blockquote,{children:["\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"fit"}),"(",(0,r.jsx)(s.code,{children:"opts"}),"): ",(0,r.jsx)(s.code,{children:"Promise"}),"<",(0,r.jsx)(s.code,{children:"any"}),">"]}),"\n"]}),"\n",(0,r.jsx)(s.p,{children:"Fit the hierarchical clustering from features, or distance matrix."}),"\n",(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Parameters"})}),"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",(0,r.jsxs)(s.table,{children:[(0,r.jsx)(s.thead,{children:(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.th,{children:"Parameter"}),(0,r.jsx)(s.th,{children:"Type"}),(0,r.jsx)(s.th,{children:"Description"})]})}),(0,r.jsxs)(s.tbody,{children:[(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"opts"})}),(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"object"})}),(0,r.jsx)(s.td,{children:"-"})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsxs)(s.td,{children:[(0,r.jsx)(s.code,{children:"opts.X"}),"?"]}),(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"ArrayLike"})}),(0,r.jsxs)(s.td,{children:["Training instances to cluster, or distances between instances if ",(0,r.jsx)(s.code,{children:"metric='precomputed'"}),"."]})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsxs)(s.td,{children:[(0,r.jsx)(s.code,{children:"opts.y"}),"?"]}),(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"any"})}),(0,r.jsx)(s.td,{children:"Not used, present here for API consistency by convention."})]})]})]}),"\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"Returns"})," ",(0,r.jsx)(s.code,{children:"Promise"}),"<",(0,r.jsx)(s.code,{children:"any"}),">"]}),"\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"Defined in"})," ",(0,r.jsx)(s.a,{href:"https://github.com/transitive-bullshit/scikit-learn-ts/blob/bab9a6d8b9738b16b8b9ba0b3f7cea1495d968d8/packages/sklearn/src/generated/cluster/AgglomerativeClustering.ts#L155",children:"generated/cluster/AgglomerativeClustering.ts:155"})]}),"\n",(0,r.jsx)(s.hr,{}),"\n",(0,r.jsx)(s.h3,{id:n[16].id,children:n[16].value}),"\n",(0,r.jsxs)(s.blockquote,{children:["\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"fit_predict"}),"(",(0,r.jsx)(s.code,{children:"opts"}),"): ",(0,r.jsx)(s.code,{children:"Promise"}),"<",(0,r.jsx)(s.code,{children:"ArrayLike"}),">"]}),"\n"]}),"\n",(0,r.jsx)(s.p,{children:"Fit and return the result of each sampleâs clustering assignment."}),"\n",(0,r.jsx)(s.p,{children:"In addition to fitting, this method also return the result of the clustering assignment for each sample in the training set."}),"\n",(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Parameters"})}),"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",(0,r.jsxs)(s.table,{children:[(0,r.jsx)(s.thead,{children:(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.th,{children:"Parameter"}),(0,r.jsx)(s.th,{children:"Type"}),(0,r.jsx)(s.th,{children:"Description"})]})}),(0,r.jsxs)(s.tbody,{children:[(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"opts"})}),(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"object"})}),(0,r.jsx)(s.td,{children:"-"})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsxs)(s.td,{children:[(0,r.jsx)(s.code,{children:"opts.X"}),"?"]}),(0,r.jsxs)(s.td,{children:[(0,r.jsx)(s.code,{children:"ArrayLike"}),"[]"]}),(0,r.jsxs)(s.td,{children:["Training instances to cluster, or distances between instances if ",(0,r.jsx)(s.code,{children:"affinity='precomputed'"}),"."]})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsxs)(s.td,{children:[(0,r.jsx)(s.code,{children:"opts.y"}),"?"]}),(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"any"})}),(0,r.jsx)(s.td,{children:"Not used, present here for API consistency by convention."})]})]})]}),"\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"Returns"})," ",(0,r.jsx)(s.code,{children:"Promise"}),"<",(0,r.jsx)(s.code,{children:"ArrayLike"}),">"]}),"\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"Defined in"})," ",(0,r.jsx)(s.a,{href:"https://github.com/transitive-bullshit/scikit-learn-ts/blob/bab9a6d8b9738b16b8b9ba0b3f7cea1495d968d8/packages/sklearn/src/generated/cluster/AgglomerativeClustering.ts#L196",children:"generated/cluster/AgglomerativeClustering.ts:196"})]}),"\n",(0,r.jsx)(s.hr,{}),"\n",(0,r.jsx)(s.h3,{id:n[17].id,children:n[17].value}),"\n",(0,r.jsxs)(s.blockquote,{children:["\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"get_metadata_routing"}),"(",(0,r.jsx)(s.code,{children:"opts"}),"): ",(0,r.jsx)(s.code,{children:"Promise"}),"<",(0,r.jsx)(s.code,{children:"any"}),">"]}),"\n"]}),"\n",(0,r.jsx)(s.p,{children:"Get metadata routing of this object."}),"\n",(0,r.jsxs)(s.p,{children:["Please check ",(0,r.jsx)(s.a,{href:"https://scikit-learn.org/stable/modules/generated/../../metadata_routing.html#metadata-routing",children:"User Guide"})," on how the routing mechanism works."]}),"\n",(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Parameters"})}),"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",(0,r.jsxs)(s.table,{children:[(0,r.jsx)(s.thead,{children:(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.th,{children:"Parameter"}),(0,r.jsx)(s.th,{children:"Type"}),(0,r.jsx)(s.th,{children:"Description"})]})}),(0,r.jsxs)(s.tbody,{children:[(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"opts"})}),(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"object"})}),(0,r.jsx)(s.td,{children:"-"})]}),(0,r.jsxs)(s.tr,{children:[(0,r.jsxs)(s.td,{children:[(0,r.jsx)(s.code,{children:"opts.routing"}),"?"]}),(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"any"})}),(0,r.jsxs)(s.td,{children:["A ",(0,r.jsx)(s.a,{href:"https://scikit-learn.org/stable/modules/generated/sklearn.utils.metadata_routing.MetadataRequest.html#sklearn.utils.metadata_routing.MetadataRequest",title:"sklearn.utils.metadata_routing.MetadataRequest",children:(0,r.jsx)(s.code,{children:"MetadataRequest"})})," encapsulating routing information."]})]})]})]}),"\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"Returns"})," ",(0,r.jsx)(s.code,{children:"Promise"}),"<",(0,r.jsx)(s.code,{children:"any"}),">"]}),"\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"Defined in"})," ",(0,r.jsx)(s.a,{href:"https://github.com/transitive-bullshit/scikit-learn-ts/blob/bab9a6d8b9738b16b8b9ba0b3f7cea1495d968d8/packages/sklearn/src/generated/cluster/AgglomerativeClustering.ts#L239",children:"generated/cluster/AgglomerativeClustering.ts:239"})]}),"\n",(0,r.jsx)(s.hr,{}),"\n",(0,r.jsx)(s.h3,{id:n[18].id,children:n[18].value}),"\n",(0,r.jsxs)(s.blockquote,{children:["\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"init"}),"(",(0,r.jsx)(s.code,{children:"py"}),"): ",(0,r.jsx)(s.code,{children:"Promise"}),"<",(0,r.jsx)(s.code,{children:"void"}),">"]}),"\n"]}),"\n",(0,r.jsx)(s.p,{children:"Initializes the underlying Python resources."}),"\n",(0,r.jsxs)(s.p,{children:["This instance is not usable until the ",(0,r.jsx)(s.code,{children:"Promise"})," returned by ",(0,r.jsx)(s.code,{children:"init()"})," resolves."]}),"\n",(0,r.jsx)(s.p,{children:(0,r.jsx)(s.strong,{children:"Parameters"})}),"\n\n\n\n\n\n\n\n\n\n\n\n\n\n",(0,r.jsxs)(s.table,{children:[(0,r.jsx)(s.thead,{children:(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.th,{children:"Parameter"}),(0,r.jsx)(s.th,{children:"Type"})]})}),(0,r.jsx)(s.tbody,{children:(0,r.jsxs)(s.tr,{children:[(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"py"})}),(0,r.jsx)(s.td,{children:(0,r.jsx)(s.code,{children:"PythonBridge"})})]})})]}),"\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"Returns"})," ",(0,r.jsx)(s.code,{children:"Promise"}),"<",(0,r.jsx)(s.code,{children:"void"}),">"]}),"\n",(0,r.jsxs)(s.p,{children:[(0,r.jsx)(s.strong,{children:"Defined in"})," ",(0,r.jsx)(s.a,{href:"https://github.com/transitive-bullshit/scikit-learn-ts/blob/bab9a6d8b9738b16b8b9ba0b3f7cea1495d968d8/packages/sklearn/src/generated/cluster/AgglomerativeClustering.ts#L95",children:"generated/cluster/AgglomerativeClustering.ts:95"})]})]})},"/docs/classes/AgglomerativeClustering",{filePath:"pages/docs/classes/AgglomerativeClustering.md",timestamp:1732212889e3,pageMap:t.O,frontMatter:{},title:"Class: AgglomerativeClustering"},"undefined"==typeof RemoteContent?l:RemoteContent.useTOC)}},e=>{var n=n=>e(e.s=n);
1e.O(0,[138,2126,636,6593,8792],()=>n(35645)),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.