Generative AutoML for Tabular Data
Project description
SapientML
Getting Started
Installation
pip install sapientml
Generate Code in a notebook
Please download housing-prices.csv to execute the following code.
import pandas as pd
from sapientml import SapientML
from sklearn.model_selection import train_test_split
train_data = pd.read_csv("housing-prices.csv")
train_data, test_data = train_test_split(train_data, train_size=0.9)
y_test = test_data["SalePrice"].reset_index(drop=True)
test_data.drop(["SalePrice"], axis=1)
sml = SapientML(["SalePrice"])
sml.fit(train_data)
y_pred = sml.predict(test_data)
print(pd.concat([y_pred["SalePrice"].rename("SalePrice_pred"), y_test], axis=1))
[2023-08-22 17:02:26] INFO:Loading dataset...
[2023-08-22 17:02:26] WARNING:Metric is not specified. Use 'r2' by default.
[2023-08-22 17:02:26] INFO:Generating pipelines...
[2023-08-22 17:02:26] INFO:Generating meta features ...
[2023-08-22 17:02:28] INFO:Executing generated pipelines...
[2023-08-22 17:02:28] INFO:Running script (1/3) ...
[2023-08-22 17:02:32] INFO:Running script (2/3) ...
[2023-08-22 17:02:33] INFO:Running script (3/3) ...
[2023-08-22 17:02:35] INFO:Evaluating execution results of generated pipelines...
[2023-08-22 17:02:35] INFO:Done.
[2023-08-22 17:02:35] INFO:Building model by generated pipeline...
[2023-08-22 17:02:38] INFO:Done.
[2023-08-22 17:02:38] INFO:Predicting by built model...
SalePrice_pred SalePrice
0 121532.531098 104900
1 96658.207729 82500
2 217862.132461 193000
3 249734.842801 228500
4 218902.816808 200624
.. ... ...
141 136618.296087 143000
142 145713.563889 143500
143 429878.200479 345000
144 209332.961672 246578
145 155690.060582 149500
[146 rows x 2 columns]
Run Generated Code
cd outputs/
python final_script.py
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sapientml-0.4.0.tar.gz
(16.7 kB
view hashes)
Built Distribution
sapientml-0.4.0-py3-none-any.whl
(21.6 kB
view hashes)
Close
Hashes for sapientml-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f260327125c7ba503b2c85106f62e7b06b5a8e3d32b14bfa2893a3d8bc95ea9 |
|
MD5 | 41bb7fd6742e2311c7bd1c21ef408431 |
|
BLAKE2b-256 | 548a0c898acf24349f63219d84d36893da5a3282fe452be241980f54a722105a |