| Server IP : 54.37.205.81 / Your IP : 216.73.216.76 Web Server : nginx/1.22.1 System : Linux vps-249481fa 6.1.0-50-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.176-1 (2026-07-02) x86_64 User : debian ( 1000) PHP Version : 8.2.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /usr/lib/python3/dist-packages/nltk/cluster/__pycache__/ |
Upload File : |
�
T�cw � � � d dl Z n# e$ r Y nw xY wd dlmZmZmZ G d� de� � Zd� Zedk r e� � dS dS )� N)�
Dendrogram�VectorSpaceClusterer�cosine_distancec �N � e Zd ZdZdd�Zdd�Zdd�Zd � Zd
� Zd� Z d� Z
d
� Zd� ZdS )�GAAClustereraM
The Group Average Agglomerative starts with each of the N vectors as singleton
clusters. It then iteratively merges pairs of clusters which have the
closest centroids. This continues until there is only one cluster. The
order of merges gives rise to a dendrogram: a tree with the earlier merges
lower than later merges. The membership of a given number of clusters c, 1
<= c <= N, can be found by cutting the dendrogram at depth c.
This clusterer uses the cosine similarity metric only, which allows for
efficient speed-up in the clustering process.
� TNc �\ � t j | ||� � || _ d | _ d | _ d S �N)r �__init__�
_num_clusters�_dendrogram�_groups_values)�self�num_clusters� normalise�svd_dimensionss �3/usr/lib/python3/dist-packages/nltk/cluster/gaac.pyr zGAAClusterer.__init__ s5 � ��%�d�I�~�F�F�F�)������"����� Fc �l � t d� |D � � � � | _ t j | |||� � S )Nc �L � g | ]!}t j |t j � � ��"S � )�numpy�array�float64)�.0�vectors r �
<listcomp>z(GAAClusterer.cluster.<locals>.<listcomp>&