def evaluate(self, clustering):
        # Pca for each one of the clusters
        pca_mean_val = 0.;
        MAX_ELEMENTS = 1000
        for c in clustering.clusters:
            # Pick the coordinates (ensuring that we are copying them)
            element_indexes = c.all_elements
            ###################
            # Performance hack
            ###################
            # As it can be very slow for big clusters (i.e. > 3k elements) we'll compress this clusters 
            # before calculating PCA. It should increase variance but will allow calculations.
            # It should use the kmedoids compressor
            if len(c.all_elements) > MAX_ELEMENTS:
                element_indexes = c.get_random_sample(MAX_ELEMENTS)
                print "[PCA] Random sampling too big cluster to improve performance (%d elements -> %d elements)."%(len(c.all_elements),MAX_ELEMENTS)
            ###################
            
            fitting_coordinates_of_this_cluster = self.fitting_coordinates[element_indexes]
            
            calculator = RMSDCalculator(calculatorType = "QTRFIT_SERIAL_CALCULATOR",
                                        fittingCoordsets = fitting_coordinates_of_this_cluster)
            
            if self.calculation_coordinates is not None:
                calculation_coordinates_of_this_cluster = self.calculation_coordinates[element_indexes]
                calculator = RMSDCalculator(calculatorType = "QTRFIT_SERIAL_CALCULATOR",
                                            fittingCoordsets = fitting_coordinates_of_this_cluster,
                                            calculationCoordsets = calculation_coordinates_of_this_cluster)
            
            # Make an iterative superposition (to get the minimum RMSD of all with respect to a mean conformation)
            calculator.iterativeSuperposition()

            # Calculate the covariance matrix
            if self.calculation_coordinates is None:
                covariance_matrix = PCAMetric.create_covariance_matrix(fitting_coordinates_of_this_cluster)
            else:
                covariance_matrix = PCAMetric.create_covariance_matrix(calculation_coordinates_of_this_cluster)
            
            # And then the eigenvalue we are interested in
            pca_mean_val += PCAMetric.calculate_biggest_eigenvalue(covariance_matrix)
        print "PCA finished"
        return  pca_mean_val /clustering.total_number_of_elements
Calculates the value of the PCA metric, which is the mean of the largest eigenvalue obtained from the PCA (the one corresponding
dataset/ETHPy150Open victor-gil-sepulveda/pyProCT/pyproct/clustering/evaluation/metrics/pcaMetrics.py/PCAMetric.evaluate