ZJUEarthData / Geochemistrypi

an open-sourced highly automated machine learning Python framework for data-driven geochemistry discovery
https://geochemistrypi.readthedocs.io/en/latest/
MIT License
79 stars 29 forks source link
dash data-science fastapi flaml geochemistry mlflow nodejs ray reactjs scikit-learn typer


Online Documentation: https://geochemistrypi.readthedocs.io

Source Code: https://github.com/ZJUEarthData/geochemistrypi


Geochemistry π is an open-sourced highly automated machine learning Python framework dedicating to build up MLOps level 1 software product for data-driven geochemistry discovery on tabular data.

Core capabilities are:

Key features are:

Latest Update: follow up by clicking Starred and Watch on our GitHub repository, then get email notifications of the newest features automatically.

Note: Chatbot driven by multi-agent system is available in the right-bottom corner of Online Documentation with a blue button.

The following figure is the simplified overview of Geochemistry π:

Overview of workflow

The following figure is the frontend-backend separation architecture of Geochemistry:

Frontend-backend separation architecture of Geochemistry

If the software contributes to your research, cite the work as :

ZhangZhou J*, He Can*, Sun Jianhao, Zhao Jianming, Lyu Yang, Wang Shengxin, Zhao Wenyu, Li Anzhou, Ji Xiaohui. Geochemistry π: Automated machine learning python framework for tabular data (2024). Geochemistry, Geophysics, Geosystems, 25, e2023GC011324

Download link: https://agupubs.onlinelibrary.wiley.com/doi/10.1029/2023GC011324

Related report:

Geochemistry π was selected for featuring as an Editor’s Highlight in EOS magazine by American Geophysical Union (fewer than 2 percent of paper are selected) and quoted in Geochemical NEWS by Geochemical Society.

Eos Website: https://eos.org/editor-highlights/machine-learning-for-geochemists-who-dont-want-to-code.

Geochemistry pi news

Quick Installation

Our software is well tested on macOS and Windows system with Python 3.9. Other systems and Python version are not guranteed.

One instruction to download on command line, such as Terminal on macOS, Power Shell on Windows.

pip install geochemistrypi

Download the latest version to avoid some old version issues, such as dependency downloading.

pip install "geochemistrypi==0.6.1"

One instruction to download on Jupyter Notebook or Google Colab.

!pip install geochemistrypi

Download the latest version to avoid some old version issues, such as dependency downloading.

!pip install "geochemistrypi==0.6.1"

Check the downloaded version of our software:

geochemistrypi --version

Note: For more detail on installation, please refer to our online documentation in Installation Manual under the section of FOR USER. Over there, we highly recommend to use virtual environment (Conda) to avoid dependency version problems.

Quick Update

One instruction to update the software to the latest version on command line, such as Terminal on macOS, Power Shell on Windows.

pip install --upgrade geochemistrypi

One instruction to download on Jupyter Notebook or Google Colab.

!pip install --upgrade geochemistrypi

Check the updated version of our software:

geochemistrypi --version

Data Preparation

In order to utilize the functions provided by our software, your own data set should satisfy:

If you want to run classification algorithm, you data set should satisfy:

Column name specification:

The following are seven built-in data sets in our software stored on Google Drive and Tecent Docs, have a look on them. For the algorithm you intend to run, you can refer to the data format of the corresponding dataset.

Note: For more detail on data preparation, please refer to our online documentation in Model Example under the section of FOR USER.

Running Example

How to run: After successfully downloading, run this instruction on command line / Jupyter Notebook / Google Colab whatever directory it is.

Case 1: Run with built-in data set for testing

On command line:

geochemistrypi data-mining

On Jupyter Notebook / Google Colab:

!geochemistrypi data-mining

Note: There are four built-in data sets corresponding to four kinds of model pattern.

Case 2: Run with your own data set without model inference

On command line:

geochemistrypi data-mining --data your_own_data_set.xlsx

On Jupyter Notebook / Google Colab:

!geochemistrypi data-mining --data your_own_data_set.xlsx

Note: Currently, .xlsx and .csv files are supported. Please specify the path your data file exists. For Google Colab, don't forget to upload your dataset first.

Case 3: Implement model inference on application data

On command line:

geochemistrypi data-mining --training your_own_training_data.xlsx --application your_own_application_data.xlsx

On Jupyter Notebook / Google Colab:

!geochemistrypi data-mining --training your_own_training_data.xlsx --application your_own_application_data.xlsx

Note: Please make sure the column names (data schema) in both training data file and application data file are the same. Because the operations you perform via our software on the training data will be record automatically and subsequently applied to the application data in the same order.

The training data in our pipeline will be divided into the train set and test set used for training the ML model and evaluating the model's performance. The score includes two types. The first type is the scores from the prediction on the test set while the second type is cv scores from the cross validation on the train set.

Case 4: Activate MLflow web interface

On command line:

geochemistrypi data-mining --mlflow

On Jupyter Notebook / Google Colab:

!geochemistrypi data-mining --mlflow

Note: Once you run our software, there are two folders (geopi_output and geopi_tracking) generated automatically. Make sure the directory where you execute using the above command should have the genereted file geopi_tracking.

Copy the URL shown on the console into any browser to open the MLflow web interface. The URL is normally like this http://127.0.0.1:5000. Search MLflow online to see more operations and usages.

For more details: Please refer to:

The following screenshot shows the downloads and launching of our software on macOS:

Downloads and Launching on macOS

Roadmap

First Phase

It works as a software application with a command-line interface (CLI) to automate data mining process with frequently-used machine learning algorithms and statistical analysis methods, which would further lower the threshold for the geochemists.

The highlight is that through choosing simple number options, the users are able to implement a full cycle of data mining without knowledge of SciPy, NumPy, Pandas, Scikit-learn, FLAML, Ray packages.

The following figure is the activity diagram of automated ML pipeline in Geochemistry π:

Its data section provides feature engineering based on arithmatic operation. It allows the users to have a statistic analysis on the data set as well as on the imputation result, which is supported by the combination of Monte Carlo simulation and hypothesis testing.

Its models section provides both supervised learning and unsupervised learning methods from Scikit-learn framework, including four types of algorithms, regression, classification, clustering, and dimensional reduction. Integrated with FLAML and Ray framework, it allows the users to run AutoML easily, fastly and cost-effectively on the built-in supervised learning algorithms in our framework.

The following figure is the hierarchical architecture of Geochemistry π:

Hierarchical Architecture

Second Phase

Currently, we are building three access ways to provide more user-friendly service, including web portal, CLI package and API. It allows the user to perform continuous training and model inference by automating the ML pipeline and machine learning lifecycle management by unique storage mechanism in different access layers.

The following figure is the system architecture diagram:

System Architecture Diagram

The following figure is the customized automated ML pipeline:

Customized automated ML pipeline

The following figure is the design pattern hierarchical architecture:

Design Pattern Workflow Object

The following figure is the storage mechanism:

Storage Mechanism

The whole package is under construction and the documentation is progressively evolving.

Geochemistry π Mind Map

→ Click here for more details

Geochemistry π.png

Team Info

Leaders:

Technical Group:

Product Group:

Join Us :)

The recruitment of research interns is ongoing !!!

Key Point: All things are done online, remote work (*^▽^*)

What can you learn?

What can you get?

Current Working Pattern:

Even if you are not familiar with topics above, but if you are interested in and have plenty of time to do it. That's enough. We have a full-developed training system to help you, as a newbie of data mining or Python developer, learn steps by steps with seniors until you can make a significant contribution to our project.

More details about the project? Please refer to: English Page: https://person.zju.edu.cn/en/zhangzhou Chinese Page: https://person.zju.edu.cn/zhangzhou#0

Do you want to contribute to this open-source program? Contact with your CV: sanyhew1097618435@163.com

In-house Materials

Materials are in both Chinese and English. Others unshown below are internal materials.

  1. Guideline Manual – Geochemistry π (International - Google drive)
  2. Guideline Manual – Geochemistry π (China - Tencent Docs)
  3. Learning Steps for Newbies – Geochemistry π (International - Google drive)
  4. Learning Steps for Newbies - Geochemistry π (China - Tencent Docs)
  5. Code Specification v2.1.2 - Geochemistry π (International - Google drive)
  6. Code Specification v2.1.2 - Geochemistry π (China - Tencent Docs)
  7. Cycle Report - Geochemistry π (International - Google drive)
  8. Cycle Report - Geochemistry π (China - Tencent Docs)

In-house Videos

Technical record videos are on Bilibili and Youtube synchronously while other meeting videos are internal materials. More Videos will be recorded soon.

  1. ZJU_Earth_Data Introduction (Geochemical Data, Python, Geochemistry π) - Prof. Zhang
  2. How to Collaborate and Provide Bug Report on Geochemistry π Through GitHub - Can He (Sany)
  3. Geochemistry π - Download and Run the Beta Version
  4. How to Create and Use Virtual Environment on Geochemistry π - Can He (Sany)
  5. How to use Github-Desktop in conflict resolution - Qiuhao Zhao (Brad)
  6. Virtual Environment & Packages On Windows - Jianming Zhao (Jamie)
  7. Git Workflow & Coordinating Synchronization - Jianming Zhao (Jamie)

Contributors