biofefi.options package

Subpackages

Submodules

biofefi.options.enums module

class biofefi.options.enums.DataAnalysisStateKeys(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: StrEnum

Enum for app state keys relating to the Data Visualisation page.

CorrelationHeatmap = 'correlation_heatmap'
DescriptorCorrelation = 'descriptor_correlation'
DescriptorPairPlot = 'descriptor_pair_plot'
NBins = 'n_bins'
PairPlot = 'pair_plot'
Perplexity = 'perplexity'
SaveHeatmap = 'save_heatmap'
SavePairPlot = 'save_pair_plot'
SaveTSNEPlot = 'save_tsne_plot'
SaveTargetVarDistribution = 'save_target_var_distribution'
SelectAllDescriptorsCorrelation = 'select_all_descriptors_correlation'
SelectAllDescriptorsPairPlot = 'select_all_descriptors_pair_plot'
SelectNormTsne = 'select_norm_tsne'
ShowKDE = 'show_kde'
TSNEPlot = 'tsne_plot'
TargetVarDistribution = 'target_var_distribution'
class biofefi.options.enums.DataPreprocessingStateKeys(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: StrEnum

Enum for app state keys relating to the Data Preprocessing page.

CorrelationThreshold = 'correlation_threshold'
DependentNormalisation = 'dependent_normalisation'
IndependentNormalisation = 'independent_normalisation'
LassoFeatureSelection = 'lasso_feature_selection'
ProceedTransformation = 'proceed_transformation'
RegularisationTerm = 'regularisation_term'
ThresholdCorrelation = 'threshold_correlation'
ThresholdVariance = 'threshold_variance'
VarianceThreshold = 'variance_threshold'
class biofefi.options.enums.DataSplitMethods(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: StrEnum

Holdout = 'holdout'
KFold = 'k-fold'
NoSplit = 'none'
class biofefi.options.enums.ExecutionStateKeys(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: StrEnum

Enum for state keys related to the execution of experiments.

DataSplit = 'data_split'
DependentVariableName = 'dependent_variable_name'
ExperimentName = 'experiment_name'
Normalisation = 'normalisation'
NumberOfBootstraps = 'num_bootstraps'
ProblemType = 'problem_type'
RandomSeed = 'random_seed'
UploadedFileName = 'uploaded_file_name'
UseHyperParamSearch = 'use_hyperparam_search'
class biofefi.options.enums.FeatureImportanceStateKeys(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: StrEnum

Enum for the state keys related to feature importance.

EnsembleMethods = 'ensemble_methods'
ExplainAllModels = 'explain_all_models'
ExplainModels = 'explain_models'
FILogBox = 'fi_log_box'
GlobalFeatureImportanceMethods = 'global_feature_importance_methods'
LocalImportanceFeatures = 'local_importance_methods'
NumberOfImportantFeatures = 'num_important_features'
NumberOfRepetitions = 'num_repetitions'
SaveFeatureImportanceOptions = 'save_feature_importance_options'
SaveFeatureImportanceResults = 'save_feature_importance_results'
ScoringFunction = 'scoring_function'
ShapDataPercentage = 'shap_data_percentage'
class biofefi.options.enums.FuzzyStateKeys(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: StrEnum

Enum for the state keys related to fuzzy importance.

ClusterNames = 'cluster_names'
FuzzyFeatureSelection = 'fuzzy_feature_selection'
FuzzyLogBox = 'fuzzy_log_box'
GranularFeatures = 'granular_features'
NumberOfClusters = 'num_clusters'
NumberOfFuzzyFeatures = 'num_fuzzy_features'
NumberOfTopRules = 'num_top_rules'
RerunFI = 'rerun_fi'
class biofefi.options.enums.MachineLearningStateKeys(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: StrEnum

Enum for the state keys related to machine learning.

MLLogBox = 'ml_log_box'
ModelTypes = 'model_types'
RerunML = 'rerun_ml'
SaveModels = 'save_models'
class biofefi.options.enums.Metrics(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: StrEnum

Accuracy = 'accuracy'
F1Score = 'f1_score'
MAE = 'MAE'
Precision = 'precision_score'
R2 = 'R2'
RMSE = 'RMSE'
ROC_AUC = 'roc_auc_score'
Recall = 'recall_score'
class biofefi.options.enums.ModelNames(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: StrEnum

BRNNClassifier = 'bayesianRegularised nn classifier'
BRNNRegressor = 'bayesianRegularised nn regressor'
LinearModel = 'linear model'
RandomForest = 'random forest'
SVM = 'svm'
XGBoost = 'xgboost'
class biofefi.options.enums.Normalisations(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: StrEnum

MinMax = 'minmax'
NoNormalisation = 'none'
Standardization = 'standardization'
class biofefi.options.enums.OptimiserTypes(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: StrEnum

Adam = 'adam'
RMSprop = 'rmsprop'
SGD = 'sgd'
class biofefi.options.enums.PlotOptionKeys(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: StrEnum

AxisFontSize = 'plot_axis_font_size'
AxisTickSize = 'plot_axis_tick_size'
ColourMap = 'plot_colour_map'
ColourScheme = 'plot_colour_scheme'
FontFamily = 'plot_font_family'
RotateXAxisLabels = 'angle_rotate_xaxis_labels'
RotateYAxisLabels = 'angle_rotate_yaxis_labels'
SavePlots = 'save_plots'
TitleFontSize = 'plot_title_font_size'
class biofefi.options.enums.ProblemTypes(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: StrEnum

Auto = 'auto'
BinaryClassification = 'binary_classification'
Classification = 'classification'
MultiClassification = 'multi_classification'
Regression = 'regression'
class biofefi.options.enums.SvmKernels(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: StrEnum

Linear = 'linear'
Poly = 'poly'
Precomputed = 'precomputed'
RBF = 'rbf'
Sigmoid = 'sigmoid'
class biofefi.options.enums.TransformationsY(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: StrEnum

Log = 'log'
MinMaxNormalisation = 'minmax'
NoTransformation = 'none'
Sqrt = 'square-root'
StandardisationNormalisation = 'standardization'
class biofefi.options.enums.ViewExperimentKeys(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: StrEnum

ExperimentName = 'view_experiment_name'

biofefi.options.execution module

class biofefi.options.execution.ExecutionOptions(data_path: str | None = None, data_split: dict | None = None, experiment_name: str = 'test', random_state: int = 1221, problem_type: biofefi.options.enums.ProblemTypes = <ProblemTypes.Classification: 'classification'>, dependent_variable: str | None = None, normalization: biofefi.options.enums.Normalisations = <Normalisations.NoNormalisation: 'none'>, n_bootstraps: int = 3, use_hyperparam_search: bool = True)

Bases: object

data_path: str | None = None
data_split: dict | None = None
dependent_variable: str | None = None
experiment_name: str = 'test'
n_bootstraps: int = 3
normalization: Normalisations = 'none'
problem_type: ProblemTypes = 'classification'
random_state: int = 1221

biofefi.options.fi module

class biofefi.options.fi.FeatureImportanceOptions(global_importance_methods: dict, feature_importance_ensemble: dict, local_importance_methods: dict, save_feature_importance_results: bool = True, save_feature_importance_options: bool = True, save_feature_importance_plots: bool = True, num_features_to_plot: int = 5, permutation_importance_scoring: str = 'neg_mean_absolute_error', permutation_importance_repeat: int = 10, shap_reduce_data: int = 50, fi_log_dir: str = 'fi')

Bases: object

feature_importance_ensemble: dict
fi_log_dir: str = 'fi'
global_importance_methods: dict
local_importance_methods: dict
num_features_to_plot: int = 5
permutation_importance_repeat: int = 10
permutation_importance_scoring: str = 'neg_mean_absolute_error'
save_feature_importance_options: bool = True
save_feature_importance_plots: bool = True
save_feature_importance_results: bool = True
shap_reduce_data: int = 50

biofefi.options.file_paths module

biofefi.options.file_paths.biofefi_experiments_base_dir() Path

Return the path the base directory of all BioFEFI experiments.

This will be /Users/<username>/BioFEFIExperiments on MacOS, /home/<username>/BioFEFIExperiments on Linux, and C:Users<username>BioFEFIExperiments on Windows.

Returns:

The path to the BioFEFI experiments base directory.

Return type:

Path

biofefi.options.file_paths.data_analysis_plots_dir(experiment_path: Path) Path

Create the full path to the directory to save Data Analysis plots.

Parameters:

experiment_path (Path) – The path of the experiment.

Returns:

The full path for the Data Analysis plot directory.

Return type:

Path

biofefi.options.file_paths.data_preprocessing_options_path(experiment_path: Path) Path

Return the path to an experiment’s data preprocessing options. The path will be to a json file called data_preprocessing_options.json

Parameters:

experiment_path (str) – The path of the experiment.

Returns:

The path to the experiment’s data preprocessing options.

Return type:

Path

Examples: `python experiment_name = "test" experiment_path = biofefi_experiments_base_dir() / experiment_name data_preprocessing_options_file = data_preprocessing_options_path(experiment_path) `

biofefi.options.file_paths.execution_options_path(experiment_path: Path) Path

Return the path to an experiment’s execution options. The path will be to a json file called execution_options.json

Parameters:

experiment_path (str) – The path of the experiment.

Returns:

The path to the experiment’s execution options.

Return type:

Path

Examples: `python experiment_name = "test" experiment_path = biofefi_experiments_base_dir() / experiment_name exec_options_file = execution_options_path(experiment_path) `

biofefi.options.file_paths.fi_options_dir(experiment_path: Path) Path

Create the full path to the directory to save Feature Importance options.

Parameters:

experiment_path (Path) – The path of the experiment.

Returns:

The full path for the Feature Importance options directory.

Return type:

Path

biofefi.options.file_paths.fi_options_path(experiment_path: Path) Path

Return the path to an experiment’s FI options. The path will be to a json file called fi_options.json

Parameters:

experiment_path (str) – The path of the experiment.

Returns:

The path to the experiment’s FI options.

Return type:

Path

Examples: `python experiment_name = "test" experiment_path = biofefi_experiments_base_dir() / experiment_name fi_options_file = fi_options_path(experiment_path) `

biofefi.options.file_paths.fi_plot_dir(experiment_path: Path) Path

Create the full path to the directory to save Feature Importance plots.

Parameters:

experiment_path (Path) – The path of the experiment.

Returns:

The full path for the Feature Importance plot directory.

Return type:

Path

biofefi.options.file_paths.fi_result_dir(experiment_path: Path) Path

Create the full path to the directory to save Feature Importance results.

Parameters:

experiment_path (Path) – The path of the experiment.

Returns:

The full path for the Feature Importance result directory.

Return type:

Path

biofefi.options.file_paths.fuzzy_options_path(experiment_path: Path) Path

Return the path to an experiment’s Fuzzy options. The path will be to a json file called fuzzy_options.json

Parameters:

experiment_path (str) – The path of the experiment.

Returns:

The path to the experiment’s Fuzzy options.

Return type:

Path

Examples: `python experiment_name = "test" experiment_path = biofefi_experiments_base_dir() / experiment_name fuzzy_options_file = fuzzy_options_path(experiment_path) `

biofefi.options.file_paths.fuzzy_plot_dir(experiment_path: Path) Path

Create the full path to the directory to save Fuzzy plots.

Parameters:

experiment_path (Path) – The path of the experiment.

Returns:

The full path for the Fuzzy plot directory.

Return type:

Path

biofefi.options.file_paths.fuzzy_result_dir(experiment_path: Path) Path

Create the full path to the directory to save Fuzzy results.

Parameters:

experiment_path (Path) – The path of the experiment.

Returns:

The full path for the Fuzzy result directory.

Return type:

Path

biofefi.options.file_paths.log_dir(experiment_path: Path) Path

Create the full upload path for experiment log files.

Parameters:

experiment_path (str) – The path of the experiment.

Returns:

The full path for the log directory.

Return type:

Path

biofefi.options.file_paths.ml_metrics_path(experiment_path: Path) Path

Create the full path to the directory to save ML models metrics results.

Parameters:

experiment_path (Path) – The path of the experiment.

Returns:

The full path for the ml models metrics file.

Return type:

Path

biofefi.options.file_paths.ml_model_dir(experiment_path: Path) Path

Create the full path to the directory to save Machine Learning models.

Parameters:

experiment_path (Path) – The path of the experiment.

Returns:

The full path for the Machine Learning model directory.

Return type:

Path

biofefi.options.file_paths.ml_options_path(experiment_path: Path) Path

Return the path to an experiment’s ML options. The path will be to a json file called ml_options.json

Parameters:

experiment_path (str) – The path of the experiment.

Returns:

The path to the experiment’s ML options.

Return type:

Path

Examples: `python experiment_name = "test" experiment_path = biofefi_experiments_base_dir() / experiment_name ml_options_file = ml_options_path(experiment_path) `

biofefi.options.file_paths.ml_plot_dir(experiment_path: Path) Path

Create the full path to the directory to save Machine Learning plots.

Parameters:

experiment_path (Path) – The path of the experiment.

Returns:

The full path for the Machine Learning plot directory.

Return type:

Path

biofefi.options.file_paths.plot_options_path(experiment_path: Path) Path

Return the path to an experiment’s plot options. The path will be to a json file called plot_options.json

Parameters:

experiment_path (str) – The path of the experiment.

Returns:

The path to the experiment’s plot options.

Return type:

Path

Examples: `python experiment_name = "test" experiment_path = biofefi_experiments_base_dir() / experiment_name plot_options_file = plot_options_path(experiment_path) `

biofefi.options.file_paths.preprocessed_data_path(file_name: str, experiment_path: Path) Path

Create the full path to the directory to save raw data.

Parameters:
  • file_name (str) – The name of the file.

  • experiment_path (Path) – The path of the experiment.

Returns:

The full path for the raw data directory.

Return type:

Path

biofefi.options.file_paths.uploaded_file_path(file_name: str, experiment_path: Path) Path

Create the full upload path for data file uploads.

Parameters:
  • file_name (str) – The name of the file.

  • experiment_path (Path) – The path of the experiment.

Returns:

The full upload path for the file.

Return type:

Path

biofefi.options.fuzzy module

class biofefi.options.fuzzy.FuzzyOptions(cluster_names: list, fuzzy_feature_selection: bool = True, number_fuzzy_features: int = 10, granular_features: bool = True, number_clusters: int = 5, number_rules: int = 5, save_fuzzy_set_plots: bool = True, fuzzy_log_dir: str = 'fuzzy')

Bases: object

cluster_names: list
fuzzy_feature_selection: bool = True
fuzzy_log_dir: str = 'fuzzy'
granular_features: bool = True
number_clusters: int = 5
number_fuzzy_features: int = 10
number_rules: int = 5
save_fuzzy_set_plots: bool = True

biofefi.options.ml module

class biofefi.options.ml.BrnnOptions(batch_size: int = 32, epochs: int = 10, hidden_dim: int = 64, output_dim: int = 1, lr: float = 0.0003, prior_mu: int = 0, prior_sigma: int = 1, lambda_reg: float = 0.01, classification_cutoff: float = 0.5)

Bases: object

This class contains the parameters as an options for the Bayesian Regularised Neural Network.

batch_size: int = 32
classification_cutoff: float = 0.5
epochs: int = 10
hidden_dim: int = 64
lambda_reg: float = 0.01
lr: float = 0.0003
output_dim: int = 1
prior_mu: int = 0
prior_sigma: int = 1
class biofefi.options.ml.MachineLearningOptions(model_types: dict, save_actual_pred_plots: bool = True, ml_log_dir: str = 'ml', save_models: bool = True, ml_plot_dir: str = 'ml')

Bases: object

ml_log_dir: str = 'ml'
ml_plot_dir: str = 'ml'
model_types: dict
save_actual_pred_plots: bool = True
save_models: bool = True

biofefi.options.plotting module

class biofefi.options.plotting.PlottingOptions(plot_axis_font_size: int, plot_axis_tick_size: int, plot_colour_scheme: str, angle_rotate_xaxis_labels: int, angle_rotate_yaxis_labels: int, save_plots: bool, plot_title_font_size: int, plot_font_family: str, plot_colour_map: str = 'viridis')

Bases: object

angle_rotate_xaxis_labels: int
angle_rotate_yaxis_labels: int
plot_axis_font_size: int
plot_axis_tick_size: int
plot_colour_map: str = 'viridis'
plot_colour_scheme: str
plot_font_family: str
plot_title_font_size: int
save_plots: bool

biofefi.options.preprocessing module

class biofefi.options.preprocessing.PreprocessingOptions(feature_selection_methods: dict, variance_threshold: float, correlation_threshold: float, lasso_regularisation_term: float, independent_variable_normalisation: str = 'none', dependent_variable_transformation: str = 'none', data_is_preprocessed: bool = False)

Bases: object

correlation_threshold: float
data_is_preprocessed: bool = False
dependent_variable_transformation: str = 'none'
feature_selection_methods: dict
independent_variable_normalisation: str = 'none'
lasso_regularisation_term: float
variance_threshold: float

biofefi.options.search_grids module

Module contents