Skip to main content

A workflow designed for Physics-Enhanced Machine Learning in engineering applications.

Project description

phoenix_ml

A Physics and Hybrid Optimised ENgine for Interpretability and eXplainability for Machine Learning. Intended to make the full machine learning workflow experience easier, from dataset to report.

Overview

This package takes you through the entire machine learning workflow with all the tools you need in a single package. Dataset cleaning, preprocessing, model evaluation, interpretability, hyperparameter optimisation, postprocessing, uncertainty quantification, physics-based modelling, residual learning, and report generation are all included, with no additional imports required. The interface is designed to be easy to use and highly customisable at every step of the workflow.

The package is primarily aimed at regression problems in engineering and scientific applications, with built-in support for Physics-Enhanced Machine Learning (PEML) methods.

Features

This package contains the following:

  • Dataset Cleaning: Interactive column role assignment with automatic type detection. Sensor fault detection covering stuck values, clipping, and burst dropout. Configurable outlier detection (IQR, Z-score, or percentile-based) with multiple handling strategies, missing value imputation, and duplicate removal.
  • Physics modelling: Physics-Enhanced Machine Learning (PEML) methods including residual learning, safe input of first-principles expressions, script-based physics models, and automatic generation of residual datasets. Supports both expression mode and script mode.
  • Preprocessing: Customisable test/train split options (random, first-N, last-N). Scatter plots of features against target variables, highly detailed boxplots, and a distance correlation matrix with a toggleable dummy variable and optional Marchenko-Pastur denoising.
  • Model training and evaluation: Support for ten regression models with the ability to add, change, or remove them. Compatible with single and multi-target optimisation. Results summarised as tables with MSE, R², Adjusted R², and Q² metrics.
  • Interpretability: Partial Dependence Plots (PDPs) with Individual Conditional Expectations (ICE), SHAP summary plots, and SHAP dependence plots. Automatic selection of the preferred model for interpretability based on training performance.
  • Hyperparameter Optimisation (HPO): Random search (with Monte Carlo, Sobol, Halton, or Latin Hypercube sampling), Hyperopt (Tree-structured Parzen Estimator), and scikit-optimize (Gaussian Process Minimisation). Configurable number of iterations, CPU cores, and early stopping. Best model per target variable is selected by a user-defined metric (MSE, R², Adjusted R², or Q²).
  • Pareto front analysis: Performance vs. training-time trade-off charts with non-dominated solution filtering, automatic log-scaling, and a numbered model legend.
  • Postprocessing: Multiple cross-validation methods (K-Fold, Repeated K-Fold, LOO, LpO, Shuffle Split) with full argument and scoring metric customisation. Cook's Distance for influential point identification. Residual analysis including scatter, histogram, Q-Q plots, and automatic best-transform selection via the Anderson-Darling statistic.
  • Uncertainty Quantification (UQ): Bootstrap and conformal prediction intervals with a user-configurable confidence level. Ground truth overlaid on interval plots for direct visual comparison. Run before and/or after HPO to compare the effect of tuning.
  • Report generation: All findings compiled into a single PDF with full-resolution images also saved separately. Results tables, HPO CSV outputs, model pipelines saved as .pkl files, and a .json metadata file for full reproducibility.

Installation

From PyPI

Available on PyPI.

pip install phoenix-ml-workflow

Then launch the interface with:

phoenix-ml

From GitHub (to explore or modify the source)

git clone https://github.com/Ryan-907316/phoenix_ml.git
cd phoenix_ml
pip install .

Then run:

python app.py

The terminal will display your system information on startup. Press any key to open the graphical interface, where you can configure and run the full workflow without writing any code.

To generate the example DC motor dataset, run:

python examples/DC_Motors_Dataset_Generation.py

Programmatic use

The full workflow can also be called directly from Python, for example:

from phoenix_ml import run_workflow

results = run_workflow(
    dataset_path="examples/Original Datasets/DC_Motor_Dataset.csv",
    output_dir="Results/",
    selected_models=["XGBoost Regressor", "Random Forest Regressor"],
    targets=["Motor Speed", "Armature Current"],
)

Future Work

  • User documentation: Proper guides covering machine learning concepts (HPO, interpretability, UQ) and how to get the most out of each step of the workflow.
  • Extended PEML: Physics-Informed Neural Networks (PINNs) and other non-residual physics-enhanced methods.
  • Classification support: Extending the workflow beyond regression problems.
  • Ongoing bug fixes and quality-of-life improvements based on user feedback.

License

This project is licensed under the MIT License: see the LICENSE file for details.

Credits

Package created by Ryan Cheung.

Contact

University email: cheungkh@lancaster.ac.uk

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

phoenix_ml_workflow-1.1.0.tar.gz (365.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

phoenix_ml_workflow-1.1.0-py3-none-any.whl (105.1 kB view details)

Uploaded Python 3

File details

Details for the file phoenix_ml_workflow-1.1.0.tar.gz.

File metadata

  • Download URL: phoenix_ml_workflow-1.1.0.tar.gz
  • Upload date:
  • Size: 365.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for phoenix_ml_workflow-1.1.0.tar.gz
Algorithm Hash digest
SHA256 924ef73ed05aef858c1b2810e35850dfe225a3a85e06311a770799b96c70871d
MD5 c5f51830c5e086112205ecd37e330f3f
BLAKE2b-256 7e7f2b5f79a2bd13d1070522309df8df15310e7887b34e82165c20afcbca08ae

See more details on using hashes here.

File details

Details for the file phoenix_ml_workflow-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for phoenix_ml_workflow-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a11252f8a877fca1954d23d24c383482fd6557be989340eccfb3df167aba8950
MD5 75a66e73b045bb3af9eee7125148ce3a
BLAKE2b-256 72b0de57589a8eea2320646b5c5fe86fb94eb270d73975a5565251c99bbd6f73

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page