Test case of a Linear Regression and DecisionTreeRegressor model fitted to siulated UF data and converted to onnx to be used in Aveva Process Simulator (APS).
This code is provided as-is and without any guarantees and is for educational purposes.
- models/uf_LinearRegressor_1.onnx: Predicts flux based on inputs.
- models/uf_LinearRegressor_2.onnx: Predicts flux based on inputs with a different export.
- models/uf_onnx_model_rev3.simx: APS Hybrid UF model simulation.
- uf_fitting_onnx.ipynb: Fit and generate the onnx model
- /data/cuf_data.csv: Simulated data for fitting.
- Install MiniForge https://github.com/conda-forge/miniforge?tab=readme-ov-file
- install vscode https://code.visualstudio.com/ and extensions ms-python.vscode-pylance, ms-python.python, ms-toolsai.jupyter
- install gitbash https://git-scm.com/download/win
- Using the terminal clone the repo
git clone [email protected]:PriceTT/aps-onnx.git - Navigate to project folder and run the command below to the create conda environment which reads the environment.yml file.
- Conda manages the Python virtual environment, while Poetry handles package management. Here are the essential commands:
conda env create- Activate the virtual environment with
conda activate onnx-env - Install the packages using poetry (retry if it fails)
poetry install -vvv - To update the packages
poetry update - To remove the env
conda env remove --name onnx-env - The interpreter path can be found by tying
which python - Append the project's virtual env to the jupyter kernels
python -m ipykernel install --user --name aps-env --display-name "onnx-env"
- Activate the virtual environment with
