helix.options package¶
Subpackages¶
Submodules¶
helix.options.data module¶
- class helix.options.data.DataOptions(data_path: str | None = None, data_split: DataSplitOptions | None = None, normalisation: Normalisations = Normalisations.NoNormalisation)¶
Bases:
object
Options class specifying where data are saved, how to split them, and which normalisation technique to use.
- data_path: str | None = None¶
- data_split: DataSplitOptions | None = None¶
- normalisation: Normalisations = 'none'¶
- class helix.options.data.DataSplitOptions(method: DataSplitMethods, n_bootstraps: int | None = None, k_folds: int | None = None, test_size: float = 0.2)¶
Bases:
object
Options class specifying how to split data in bootstrapping or cross-validation, as well as the size of the test size.
- k_folds: int | None = None¶
- method: DataSplitMethods¶
- n_bootstraps: int | None = None¶
- test_size: float = 0.2¶
helix.options.enums module¶
- class helix.options.enums.ActivationFunctions(value)¶
Bases:
StrEnum
- Identity = 'identity'¶
- Logistic = 'logistic'¶
- ReLU = 'relu'¶
- Tanh = 'tanh'¶
- class helix.options.enums.DataAnalysisStateKeys(value)¶
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 helix.options.enums.DataPreprocessingStateKeys(value)¶
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 helix.options.enums.DataSplitMethods(value)¶
Bases:
StrEnum
- Holdout = 'holdout'¶
- KFold = 'k-fold'¶
- NoSplit = 'none'¶
- class helix.options.enums.ExecutionStateKeys(value)¶
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 helix.options.enums.FeatureImportanceStateKeys(value)¶
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'¶
- class helix.options.enums.FeatureImportanceTypes(value)¶
Bases:
StrEnum
- LIME = 'LIME'¶
- MajorityVote = 'Majority Vote'¶
- Mean = 'Mean'¶
- PermutationImportance = 'Permutation importance'¶
- SHAP = 'SHAP'¶
- class helix.options.enums.FuzzyStateKeys(value)¶
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 helix.options.enums.MachineLearningStateKeys(value)¶
Bases:
StrEnum
Enum for the state keys related to machine learning.
- MLLogBox = 'ml_log_box'¶
- ModelTypes = 'model_types'¶
- Predictions = 'predictions'¶
- RerunML = 'rerun_ml'¶
- SaveModels = 'save_models'¶
- class helix.options.enums.Metrics(value)¶
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 helix.options.enums.ModelNames(value)¶
Bases:
StrEnum
- BRNN = 'bayesian regularised neural network'¶
- LinearModel = 'linear model'¶
- MLREM = 'multiple linear regression with expectation maximisation'¶
- RandomForest = 'random forest'¶
- SVM = 'svm'¶
- XGBoost = 'xgboost'¶
- class helix.options.enums.Normalisations(value)¶
Bases:
StrEnum
- MinMax = 'minmax'¶
- NoNormalisation = 'none'¶
- Standardisation = 'standardisation'¶
- class helix.options.enums.OptimiserTypes(value)¶
Bases:
StrEnum
- Adam = 'adam'¶
- RMSprop = 'rmsprop'¶
- SGD = 'sgd'¶
- class helix.options.enums.PlotOptionKeys(value)¶
Bases:
StrEnum
- AxisFontSize = 'plot_axis_font_size'¶
- AxisTickSize = 'plot_axis_tick_size'¶
- ColourMap = 'plot_colour_map'¶
- ColourScheme = 'plot_colour_scheme'¶
- DPI = 'dpi'¶
- FontFamily = 'plot_font_family'¶
- Height = 'plot_height'¶
- RotateXAxisLabels = 'angle_rotate_xaxis_labels'¶
- RotateYAxisLabels = 'angle_rotate_yaxis_labels'¶
- SavePlots = 'save_plots'¶
- TitleFontSize = 'plot_title_font_size'¶
- Width = 'plot_width'¶
- class helix.options.enums.ProblemTypes(value)¶
Bases:
StrEnum
- Auto = 'auto'¶
- BinaryClassification = 'binary_classification'¶
- Classification = 'classification'¶
- MultiClassification = 'multi_classification'¶
- Regression = 'regression'¶
- class helix.options.enums.SvmKernels(value)¶
Bases:
StrEnum
- Linear = 'linear'¶
- Poly = 'poly'¶
- Precomputed = 'precomputed'¶
- RBF = 'rbf'¶
- Sigmoid = 'sigmoid'¶
helix.options.execution module¶
- class helix.options.execution.ExecutionOptions(experiment_name: str = 'test', random_state: int = 1221, problem_type: helix.options.enums.ProblemTypes = <ProblemTypes.Classification: 'classification'>, dependent_variable: str | None = None)¶
Bases:
object
- dependent_variable: str | None = None¶
- experiment_name: str = 'test'¶
- problem_type: ProblemTypes = 'classification'¶
- random_state: int = 1221¶
helix.options.fi module¶
- class helix.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, 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¶
helix.options.file_paths module¶
- helix.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
- helix.options.file_paths.data_options_path(experiment_path: Path) Path ¶
Return the path to an experiment’s data options. The path will be to a json file called data_options.json
- Parameters:
experiment_path (str) – The path of the experiment.
- Returns:
The path to the experiment’s data options.
- Return type:
Path
Examples:
`python experiment_name = "test" experiment_path = helix_experiments_base_dir() / experiment_name data_options_file = data_options_path(experiment_path) `
- helix.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 = helix_experiments_base_dir() / experiment_name data_preprocessing_options_file = data_preprocessing_options_path(experiment_path) `
- helix.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 = helix_experiments_base_dir() / experiment_name exec_options_file = execution_options_path(experiment_path) `
- helix.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
- helix.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 = helix_experiments_base_dir() / experiment_name fi_options_file = fi_options_path(experiment_path) `
- helix.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
- helix.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
- helix.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 = helix_experiments_base_dir() / experiment_name fuzzy_options_file = fuzzy_options_path(experiment_path) `
- helix.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
- helix.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
- helix.options.file_paths.helix_experiments_base_dir() Path ¶
Return the path the base directory of all Helix experiments.
This will be /Users/<username>/HelixExperiments on MacOS, /home/<username>/HelixExperiments on Linux, and C:Users<username>HelixExperiments on Windows.
- Returns:
The path to the Helix experiments base directory.
- Return type:
Path
- helix.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
- helix.options.file_paths.ml_metrics_full_path(experiment_path: Path) Path ¶
Create the full path to the file to save the full 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
- helix.options.file_paths.ml_metrics_mean_std_path(experiment_path: Path) Path ¶
Create the full path to the file to save the ML models’ metrics’cmean and standard deviations.
- Parameters:
experiment_path (Path) – The path of the experiment.
- Returns:
The full path for the ml models metrics file.
- Return type:
Path
- helix.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
- helix.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 = helix_experiments_base_dir() / experiment_name ml_options_file = ml_options_path(experiment_path) `
- helix.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
- helix.options.file_paths.ml_predictions_path(experiment_path: Path) Path ¶
Create the full path to the directory to save ML models predictions.
- Parameters:
experiment_path (Path) – The path of the experiment.
- Returns:
The full path for the ml models predictions file.
- Return type:
Path
- helix.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 = helix_experiments_base_dir() / experiment_name plot_options_file = plot_options_path(experiment_path) `
- helix.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
- helix.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
helix.options.fuzzy module¶
- class helix.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¶
helix.options.ml module¶
- class helix.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¶
- lambda_reg: float = 0.01¶
- lr: float = 0.0003¶
- output_dim: int = 1¶
- prior_mu: int = 0¶
- prior_sigma: int = 1¶
- class helix.options.ml.MLREMOptions(alpha: float = 0.0, beta: float = 1.0, weight_threshold: float = 0.001, max_iterations: int = 300, tolerance: float = 0.01)¶
Bases:
object
This class contains the parameters as options for the Maximum Likelihood Regularised EM model.
- alpha: float = 0.0¶
- beta: float = 1.0¶
- max_iterations: int = 300¶
- tolerance: float = 0.01¶
- weight_threshold: float = 0.001¶
- class helix.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', use_hyperparam_search: bool = True)¶
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¶
- use_hyperparam_search: bool = True¶
helix.options.plotting module¶
- class helix.options.plotting.PlottingOptions(plot_axis_font_size: int, plot_axis_tick_size: int, plot_colour_scheme: str, dpi: int, angle_rotate_xaxis_labels: int, angle_rotate_yaxis_labels: int, save_plots: bool, plot_title_font_size: int, plot_font_family: str, height: int | float, width: int | float, plot_colour_map: str = 'viridis')¶
Bases:
object
- angle_rotate_xaxis_labels: int¶
- angle_rotate_yaxis_labels: int¶
- dpi: int¶
- height: int | float¶
- 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¶
- width: int | float¶
helix.options.preprocessing module¶
- class helix.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¶