Module Expr Str Import alias ImportFrom alias alias ImportFrom alias FunctionDef arguments args NameParam defaults body If CompareEq Call NameLoad NameLoad Num body Return Num orelse Return Call AttributeLoad NameLoad attr NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Pass decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Expr Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad BinOpPow Call AttributeLoad NameLoad attr Num Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign NameStore BinOpDiv BinOpAdd NameLoad BinOpMult BinOpDiv Call NameLoad BinOpSub NameLoad NameLoad BinOpSub NameLoad Num NameLoad Call NameLoad BinOpSub NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Num For NameStore NameLoad body Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign NameStore Call NameLoad BinOpPow Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad Num AugAssignAdd NameStore BinOpMult BinOpSub NameLoad Num NameLoad Return BinOpMult NameLoad Num decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign NameStore BinOpAdd BinOpMult BinOpSub NameLoad Num NameLoad BinOpMult BinOpSub NameLoad NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Return BinOpMult NameLoad Num decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call NameLoad AttributeLoad NameLoad attr Return BinOpMult BinOpDiv Num BinOpSub NameLoad NameLoad Call AttributeLoad Call AttributeLoad NameLoad attr ListComp Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad comprehension NameStore AttributeLoad NameLoad attr attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr TryExcept body Assign NameStore Call NameLoad BinOpPow Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad Num handlers ExceptHandler type NameLoad body Assign NameStore Num Return BinOpMult BinOpSub NameLoad Num BinOpSub NameLoad NameLoad decorator_list NameLoad decorator_list
N/A N/A 
Created on 11/06/2013

:author: victor
 N/A numpy pyproct.clustering.evaluation.metrics.common update_medoids get_intra_cluster_distances pyproct.tools.exceptions SingularClusterException mean N/A N/A array N/A N/A N/A N/A N/A len array 0 N/A N/A 0.0 N/A N/A N/A N/A numpy mean array N/A CalinskiHarabaszCalculator N/A object N/A N/A 
    Implementation of the Calinski-Harabasz (VRC) index, as described in T. Calinski and J.Harabasz paper in
    'Communications in Statistics 3(1), 1-27 (1974)'.
    Contains the necessary functions to calculate the index in the two forms presented.
     __init__ N/A N/A self N/A N/A N/A N/A evaluate N/A N/A self clustering matrix N/A N/A N/A 
        Calculates the index value for a clustering.
        :param clustering: The clustering being checked.
        :param matrix: The condensed matrix containing all distances.
        :return: The calculated Calinski-Harabasz (VRC) index.
         N/A N/A update_medoids clustering matrix N/A D N/A mean N/A N/A N/A matrix get_data 2 N/A k N/A len N/A clustering clusters N/A n N/A matrix row_length N/A A_k N/A N/A CalinskiHarabaszCalculator A_k clustering D matrix N/A VRC N/A N/A D N/A N/A N/A float N/A n k N/A k 1 A_k N/A float N/A D A_k N/A VRC N/A WGSS N/A N/A cls clusters matrix N/A N/A N/A 
        C-H description of the "Within group sum of squares".
        :param clusters: An array with all clusters description (usually Clustering.clusters)
        :param matrix: The condensed matrix containing all distances.
        :return: The value of WGSS.
         N/A wgss 0 N/A c clusters N/A N/A n N/A len N/A c all_elements N/A d N/A mean N/A N/A N/A numpy array N/A get_intra_cluster_distances c matrix 2 N/A wgss N/A N/A n 1 d N/A N/A wgss 0.5 N/A classmethod BGSS N/A N/A cls clustering D matrix N/A N/A N/A 
        C-H description of the "Between group sum of squares".
        :param clustering: The clustering being checked.
        :param D: Mean distance of the sum of all squared distances present in the matrix.
        :param matrix: The condensed matrix containing all distances.
        :return: The value of BGSS.
         N/A n N/A clustering total_number_of_elements N/A k N/A len N/A clustering clusters N/A bgss N/A N/A N/A k 1 D N/A N/A n k N/A N/A cls A_k clustering D matrix N/A N/A bgss 0.5 N/A classmethod A_k N/A N/A cls clustering D matrix N/A N/A N/A 
        Calculates the A_k term.
        :param clustering: The clustering being checked.
        :param matrix: The condensed matrix containing all distances.
        :return: The A_k term value.
         N/A n N/A clustering total_number_of_elements N/A k N/A len N/A clustering clusters N/A N/A N/A 1.0 N/A n k N/A N/A N/A N/A numpy array N/A N/A N/A cls ch_cluster_term cluster D matrix N/A cluster N/A clustering clusters sum N/A classmethod ch_cluster_term N/A N/A cls cluster global_mean_distance matrix N/A N/A N/A 
        Calculates one of the formula terms (ng-1)(D-d_g)
        :param cluster: The cluster to use in calculation.
        :param global_mean_distance: 'D'. Is the mean of the n*(n-1)/2 distances of all the elements.
        :param matrix: The condensed matrix containing all distances.
        :return: Calculated term.
         N/A n N/A len N/A cluster all_elements N/A N/A N/A cluster_mean_distance N/A mean N/A N/A N/A numpy array N/A get_intra_cluster_distances cluster matrix 2 N/A N/A N/A SingularClusterException N/A N/A cluster_mean_distance 0 N/A N/A N/A n 1 N/A global_mean_distance cluster_mean_distance N/A classmethod N/A