plots package

Submodules

plots.live_learning module

class plots.live_learning.PlotLearning(title, plot_save_as)[source]

Bases: Callback

Callback to plot the learning curves of the model during training.

on_epoch_end(epoch, logs={})[source]

Called at the end of an epoch.

Subclasses should override for any actions to run. This function should only be called during TRAIN mode.

Parameters:
  • epoch – Integer, index of epoch.

  • logs – Dict, metric results for this training epoch, and for the validation epoch if validation is performed. Validation result keys are prefixed with val_. For training epoch, the values of the Model’s metrics are returned. Example: {‘loss’: 0.2, ‘accuracy’: 0.7}.

on_train_begin(logs={})[source]

Called at the beginning of training.

Subclasses should override for any actions to run.

Parameters:

logs – Dict. Currently no data is passed to this argument for this method but that may change in the future.

on_train_end(logs={})[source]

Called at the end of training.

Subclasses should override for any actions to run.

Parameters:

logs – Dict. Currently the output of the last call to on_epoch_end() is passed to this argument for this method but that may change in the future.

plots.plots module

plots.plots.average_jaccard_similarity(rankings: List[List[str]]) Tuple[float, float][source]

Calculate the average Jaccard similarity and standard deviation for a list of rankings

Parameters:

rankings (List[List[str]]) – List of rankings, where each ranking is a list of features

Returns:

Average Jaccard similarity and standard deviation across all pairs of rankings

Return type:

Tuple[float, float]

plots.plots.create_stats_df(unique_features, index_positions)[source]
plots.plots.extract_values(file_path)[source]
plots.plots.feature_ranking_plot(top_features, index_positions, bins_to_names, save_path, auto_open)[source]
plots.plots.generate_plots(datasets_root, denoised_dataset_name, computations_root, dataset_name, auto_open=False)[source]
plots.plots.get_index_positions(data)[source]
plots.plots.jaccard_similarity(list1: List[str], list2: List[str]) float[source]

Calculate Jaccard Similarity between two lists.

The Jaccard similarity coefficient measures the size of the intersection divided by the size of the union of two sets. The resulting number is a scalar value representing the overall similarity (or stability) of the feature selection reflected by the different rankings. Note that the Jaccard similarity ranges from 0 to 1, where 1 signifies that the rankings are identical, and 0 signifies that the rankings do not share any features.

Parameters:
  • list1 (List[str]) – First list of features

  • list2 (List[str]) – Second list of features

Returns:

Jaccard similarity between the two lists

Return type:

float

plots.plots.load_csv_file(file_path)[source]
plots.plots.load_pickle_file(file_path)[source]
plots.plots.plot_ppm_with_selection(ds, pca_ds, top_features, bins_to_names, ppm_chart_title, save_path, auto_open, plot_median=False)[source]
plots.plots.plot_ppm_with_selection_paper_modified(ds, pca_ds, top_features, bins_to_names, ppm_chart_title, save_path, auto_open, plot_median=False)[source]
plots.plots.plot_pred_acc_and_sim_for_RFE(df, ordered_ranking, save_path, auto_open, metric_dict={'rfe_val_auc_shallow': 'AUC Accuracy'})[source]
plots.plots.plot_pred_acc_multimetric_RFE(df, ordered_ranking, save_path, auto_open, metric_dict={'rfe_val_auc_shallow': 'AUC Accuracy'})[source]
plots.plots.ranking_stats_to_txt(top_features, bins_to_names, save_path)[source]

Process a DataFrame: add binned metabolites, binned metabolite range, sort by mean, and rename columns.

Parameters: top_features (pandas.DataFrame): Input DataFrame. bins_to_names (dict): Dictionary for mapping bin numbers to feature names.

Returns: pandas.DataFrame: The processed DataFrame.

plots.plots.sort_paths_by_epoch(paths)[source]

plots.ppm_selected module

plots.ppm_selected.plot_ppm_with_selection(dataset_path, selected_feature_indicies, ppm_chart_title, SAVE_PATH, plot_median=False, bin=0.005, display_top_n_bin=20)[source]

Module contents