Module epiclass.utils.extract_metrics
Extract metrics for other classifiers output files, or csv output of cometML for neural networks.
Functions
def extract_neural_network_metrics(file_path: str) ‑> pandas.core.frame.DataFrame
-
Extracts validation metrics for a Neural Network classifier from a CSV file (comet ML export)
This function reads a CSV file, extracts the split number and validation metrics, and stores these metrics in a DataFrame. The CSV file is expected to contain columns for different validation metrics and a column 'Name' that includes information about the split number.
Args
file_path
:str
- The path to the CSV file.
output_file_path
:str
- The path of the output file.
Returns
pd.DataFrame
- A DataFrame with one row for each metric of each split. The DataFrame contains the following columns: 'classifier', 'split', 'metric', and 'value'.
def extract_other_estimators_metrics(file_path: str) ‑> pandas.core.frame.DataFrame
-
Extracts validation metrics for multiple classifiers from a log file.
This function reads a log file, identifies lines that contain validation metrics, and stores these metrics in a DataFrame. The log file is expected to contain one or more sections for each classifier, each section containing lines for different splits and their associated validation metrics.
Args
file_path
:str
- The path to the log file.
Returns
pd.DataFrame
- A DataFrame with one row for each metric of each split of each classifier. The DataFrame contains the following columns: 'classifier', 'split', 'metric', and 'value'.
def main()
-
Main function
def parse_arguments() ‑> argparse.Namespace
-
Add an argument parser