Quickly compare machine learning models across libraries and datasets.
Project description
MLCompare is a Python package for running model comparison pipelines, with the aim of being both simple and flexible. It supports multiple popular ML libraries, retrieval from multiple online dataset repositories, common data processing steps, and results visualization. Additionally, it allows for using your own models and datasets within the pipelines.
Libraries |
Datasets |
Data Processing |
---|---|---|
|
|
|
Installing
pip install mlcompare
Note that for MacOS, both XGBoost and LightGBM require libomp
. It can be installed with Homebrew:
brew install libomp
A Simple Example
Running a pipeline with multiple models and datasets is done by making list of dictionaries for each and providing them to a pipeline function.
The below example downloads a dataset from OpenML and Kaggle, one-hot encodes some of the columns in the Kaggle dataset, and trains and evaluates a Random Forest and XGBoost model on them.
import mlcompare
datasets = [
{
"type": "openml",
"id": 8,
"target": "drinks",
},
{
"type": "kaggle",
"user": "gorororororo23",
"dataset": "plant-growth-data-classification",
"file": "plant_growth_data.csv",
"target": "Growth_Milestone",
"onehotEncode": ["Soil_Type", "Water_Frequency", "Fertilizer_Type"],
}
]
models = [
{
"library": "sklearn",
"name": "RandomForestRegressor",
},
{
"library": "xgboost",
"name": "XGBRegressor",
"params": {"num_leaves": 40, "n_estimators": 200}
}
]
mlcompare.full_pipeline(datasets, models)
In the case of the XGBoost model we passed in our own parameter values rather than using the defaults.
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
Built Distribution
File details
Details for the file mlcompare-1.0.0.tar.gz
.
File metadata
- Download URL: mlcompare-1.0.0.tar.gz
- Upload date:
- Size: 29.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96e4e22f6bae5cb0136e146870f1f63d3e121f5b01599e3d732ece82fa9335ad |
|
MD5 | d8653cc7d8c55b0da84a144fd0904a1f |
|
BLAKE2b-256 | 7d1fd2d0c2954b69b716c9b24bac4a1b371e6fa346c2d51cc9941deb2ea7328e |
File details
Details for the file mlcompare-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: mlcompare-1.0.0-py3-none-any.whl
- Upload date:
- Size: 23.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 928f4babf267dd4cb00c421e60e7cafde08abed89790ea56796d8e19deff6f48 |
|
MD5 | 31491b00f81a8b71691ac64e0fd9d5ed |
|
BLAKE2b-256 | 193c6ec5b6f1bc604c9946fba091f3b45cb4affb262ad9fbde7c967627ebedb2 |