phishbench.evaluation

The evaluation module evaluates classifiers against a test set.

phishbench.evaluation.evaluate_classifiers(classifiers, x_test, y_test, verbose=1)

Evaluates a set of classifiers

Parameters
  • classifiers (A list of BaseClassifier objects) – The classifiers to evaluate

  • x_test (array-like of shape (n_samples, n_features)) – The feature vectors of the test set.

  • y_test (array-like of shape (n_samples)) – The labels of the test set with 0 being legitimate and 1 being phishing

  • verbose (bool) –

    Whether or not to print progress to stdout.

    • 0 prints nothing.

    • 1 prints the classifiers being trained

Returns

The metrics of the classifiers.

Return type

A pandas DataFrame

phishbench.evaluation.evaluate_classifier(classifier, x_test, y_test)

Evaluates a single classifier

Parameters
  • classifier (A BaseClassifier object) – The classifier to evaluate.

  • x_test (array-like of shape (n_samples, n_features)) – The test features to evaluate with

  • y_test (array-like of shape (n_samples)) – The test labels to evaluate with

Returns

A dictionary mapping name of the metric to the corresponding score.

Return type

Dict[str, float]