cli/streamingphish/streamingphish/cli.py
def _metrics_summary(self, available_classifiers):
        """
        Provides key metrics from all trained classifiers in the database, i.e.
        true positive rates, precision, recall, AUC score, etc.

        Args:
            available_classifiers (list): Trained classifiers in database.
        """
        # Fetch all the classifiers from the DB which contain accuracy metrics.
        classifiers = []
        for classifier_name in available_classifiers:
            classifier = self._phish_db.fetch_classifier(classifier_name)
            classifiers.append({classifier_name: classifier[classifier_name]['metrics']})

        # Create a list of dictionaries for each metric you want to capture and display to user.
        results = {}
        results['Training Set Size'] = {}
        results['Training Set Accuracy'] = {}
        results['Feature Vector Size'] = {}
        results['Test Set Accuracy'] = {}
        results['True Positive Rate [50%]'] = {}
        results['False Positive Rate [50%]'] = {}
        results['Precision [50%]'] = {}
        results['Recall [50%]'] = {}
        results['AUC [50%]'] = {}

        for classifier in classifiers:
            for name, values in classifier.items():
                results['Training Set Size'][name] = \
                        sum(values['info']['training_samples'].values())
                results['Feature Vector Size'][name] = values['info']['feature_vector_size']
                results['Training Set Accuracy'][name] = \
                        values['accuracy']['training_set_accuracy']
                results['Test Set Accuracy'][name] = values['accuracy']['test_set_accuracy']
                results['True Positive Rate [50%]'][name] = \
                        values['accuracy']['true_positive_rate']
                results['False Positive Rate [50%]'][name] = \
                        values['accuracy']['false_positive_rate']
                results['Precision [50%]'][name] = values['accuracy']['precision']
                results['Recall [50%]'][name] = values['accuracy']['recall']
                results['AUC [50%]'][name] = values['accuracy']['auc_score']

        tqdm.tqdm.write("[+] Summary of classifier accuracy metrics:")
        for chart_name, chart_values in results.items():
            tqdm.tqdm.write("\n[--- {} ---]".format(chart_name))
            for clf, score in sorted(chart_values.items(), key=lambda x: x[1], reverse=True):
                tqdm.tqdm.write("{}\t{}".format(score, clf))
        tqdm.tqdm.write("\n[+] Completed.")

        Provides key metrics from all trained classifiers in the database, i.e.
        true positive rates, precision, recall, AUC score, etc.

        Args:
            available_classifiers (list): Trained classifiers in database.
        
Provides key metrics from all trained classifiers in the database, i.e.
true positive rates, precision, recall, AUC score, etc.
Provides key metrics from all trained classifiers in the database i . e . true positive rates precision recall AUC score etc .
def _metrics_summary(self, available_classifiers):
        classifiers = []
        for classifier_name in available_classifiers:
            classifier = self._phish_db.fetch_classifier(classifier_name)
            classifiers.append({classifier_name: classifier[classifier_name]['metrics']})
        results = {}
        results['Training Set Size'] = {}
        results['Training Set Accuracy'] = {}
        results['Feature Vector Size'] = {}
        results['Test Set Accuracy'] = {}
        results['True Positive Rate [50%]'] = {}
        results['False Positive Rate [50%]'] = {}
        results['Precision [50%]'] = {}
        results['Recall [50%]'] = {}
        results['AUC [50%]'] = {}
        for classifier in classifiers:
            for name, values in classifier.items():
                results['Training Set Size'][name] = \
                        sum(values['info']['training_samples'].values())
                results['Feature Vector Size'][name] = values['info']['feature_vector_size']
                results['Training Set Accuracy'][name] = \
                        values['accuracy']['training_set_accuracy']
                results['Test Set Accuracy'][name] = values['accuracy']['test_set_accuracy']
                results['True Positive Rate [50%]'][name] = \
                        values['accuracy']['true_positive_rate']
                results['False Positive Rate [50%]'][name] = \
                        values['accuracy']['false_positive_rate']
                results['Precision [50%]'][name] = values['accuracy']['precision']
                results['Recall [50%]'][name] = values['accuracy']['recall']
                results['AUC [50%]'][name] = values['accuracy']['auc_score']
        tqdm.tqdm.write("[+] Summary of classifier accuracy metrics:")
        for chart_name, chart_values in results.items():
            tqdm.tqdm.write("\n[--- {} ---]".format(chart_name))
            for clf, score in sorted(chart_values.items(), key=lambda x: x[1], reverse=True):
                tqdm.tqdm.write("{}\t{}".format(score, clf))
        tqdm.tqdm.write("\n[+] Completed.")
def _metrics_summary ( self , available_classifiers ) : classifiers = [ ] for classifier_name in available_classifiers : classifier = self . _phish_db . fetch_classifier ( classifier_name ) classifiers . append ( { classifier_name : classifier [ classifier_name ] [ 'metrics' ] } ) results = { } results [ 'Training Set Size' ] = { } results [ 'Training Set Accuracy' ] = { } results [ 'Feature Vector Size' ] = { } results [ 'Test Set Accuracy' ] = { } results [ 'True Positive Rate [50%]' ] = { } results [ 'False Positive Rate [50%]' ] = { } results [ 'Precision [50%]' ] = { } results [ 'Recall [50%]' ] = { } results [ 'AUC [50%]' ] = { } for classifier in classifiers : for name , values in classifier . items ( ) : results [ 'Training Set Size' ] [ name ] = sum ( values [ 'info' ] [ 'training_samples' ] . values ( ) ) results [ 'Feature Vector Size' ] [ name ] = values [ 'info' ] [ 'feature_vector_size' ] results [ 'Training Set Accuracy' ] [ name ] = values [ 'accuracy' ] [ 'training_set_accuracy' ] results [ 'Test Set Accuracy' ] [ name ] = values [ 'accuracy' ] [ 'test_set_accuracy' ] results [ 'True Positive Rate [50%]' ] [ name ] = values [ 'accuracy' ] [ 'true_positive_rate' ] results [ 'False Positive Rate [50%]' ] [ name ] = values [ 'accuracy' ] [ 'false_positive_rate' ] results [ 'Precision [50%]' ] [ name ] = values [ 'accuracy' ] [ 'precision' ] results [ 'Recall [50%]' ] [ name ] = values [ 'accuracy' ] [ 'recall' ] results [ 'AUC [50%]' ] [ name ] = values [ 'accuracy' ] [ 'auc_score' ] tqdm . tqdm . write ( "[+] Summary of classifier accuracy metrics:" ) for chart_name , chart_values in results . items ( ) : tqdm . tqdm . write ( "\n[--- {} ---]" . format ( chart_name ) ) for clf , score in sorted ( chart_values . items ( ) , key = lambda x : x [ 1 ] , reverse = True ) : tqdm . tqdm . write ( "{}\t{}" . format ( score , clf ) ) tqdm . tqdm . write ( "\n[+] Completed." )
Provides key metrics from all trained classifiers in the database, i.e.
Provides key metrics from all trained classifiers in the database i . e .
"""
        Provides key metrics from all trained classifiers in the database, i.e.
        true positive rates, precision, recall, AUC score, etc.

        Args:
            available_classifiers (list): Trained classifiers in database.
        """ # Fetch all the classifiers from the DB which contain accuracy metrics. # Create a list of dictionaries for each metric you want to capture and display to user.
self
available_classifiers
Trained classifiers in database.
Trained classifiers in database .