The oracle for your data — low-code ML for everyone.
Project description
Pythios
Low-code machine learning for tabular data.
Pythios loads data, prepares features, compares models, tunes the best candidate, and evaluates results through one simple workflow.
Installation
python -m pip install pythios
Pythios supports Python 3.9 and newer. On macOS, XGBoost and LightGBM may require brew install libomp.
Optional features:
python -m pip install "pythios[full]"
Quick start
from pythios import Data, Models, Evaluate
data = Data.from_csv("churn.csv", target="Churn")
model = Models(data)
model.auto(metric="f1")
evaluation = Evaluate(model)
evaluation.metrics()
evaluation.confusion_matrix()
Models.auto() automatically splits data, encodes categorical features, compares applicable models, selects the best model, tunes it with Optuna, and retrains it. Skip tuning for a faster run:
model.auto(metric="f1", tune=False)
Metrics
Classification metrics are accuracy, f1, recall, precision, and auc_roc. Regression metrics are r2, rmse, and mae.
model.auto(metric="recall")
model.auto(metric="auc_roc")
Defaults are accuracy for classification and r2 for regression. You can also use model.set_metric("f1").compare().
For example, a complete regression workflow using the built-in Diabetes dataset is:
from pythios import Data, Evaluate, Models
data = Data.from_sklearn("diabetes")
model = Models(data).auto(metric="r2", tune=False)
evaluation = Evaluate(model)
evaluation.metrics()
evaluation.residuals()
An R² score of 0.455 means the model explains approximately 45.5% of the variation in the test target. This is a moderate baseline: R² of 1.0 is perfect, 0.0 is equivalent to predicting the mean, and a negative value is worse than that baseline. Always consider R² together with MAE, RMSE, and cross-validation:
evaluation.cross_validate()
Loading data
from pythios import Data
data = Data.from_csv("data.csv", target="target")
excel = Data.from_excel("data.xlsx", target="target")
remote = Data.from_url("https://example.com/data.csv", target="target")
iris = Data.from_sklearn("iris")
Built-in datasets are iris, wine, breast_cancer, digits, diabetes, california_housing, and linnerud.
data.describe()
print(data.missing_report())
data.split(test=0.2, seed=42)
String targets such as Yes/No are automatically detected as binary classification.
Preprocessing
Models.auto() handles ordinary tabular preprocessing automatically. For manual control:
from pythios import Preprocess, Models
data.split()
processed = Preprocess(data).auto().apply()
model = Models(processed).auto(metric="f1")
Configuration methods are chainable:
processed = (
Preprocess(data)
.impute(method="median")
.scale(method="standard")
.encode(method="onehot")
.apply()
)
The target is never transformed, and preprocessing is fitted on training data only.
Models
Available names include random_forest, logistic_regression, linear_regression, svm, knn, decision_tree, gradient_boosting, naive_bayes, ridge, lasso, xgboost, and lightgbm.
data.split()
model = Models(data)
model.train("random_forest", n_estimators=200)
results = model.compare()
model.tune("xgboost", trials=30)
Evaluation
predictions = model.predict()
probabilities = model.predict_proba()
evaluation = Evaluate(model)
evaluation.metrics()
evaluation.overfit_check()
evaluation.confusion_matrix()
evaluation.roc_curve()
evaluation.feature_importance()
evaluation.cross_validate()
evaluation.report(save="report.txt")
Visualization
from pythios import Visualize
visuals = Visualize(data)
visuals.distribution()
visuals.correlation()
visuals.missing()
visuals.pairplot()
visuals.summary()
Most visualization methods accept save="plot.png".
Unsupervised learning
from pythios import Unsupervised
u = Unsupervised(data)
u.cluster(method="kmeans", k=4)
u.reduce(method="pca", n=2)
u.plot_clusters()
print(u.silhouette_score())
Supported clustering methods include KMeans, DBSCAN, agglomerative clustering, and Gaussian mixtures. Reduction methods include PCA, t-SNE, and UMAP.
Embeddings
from pythios import Embeddings
embeddings = Embeddings().text()
vectors = embeddings.encode(["first document", "second document"])
print(embeddings.similarity(vectors[0], vectors[1]))
Faiss index search is available with the full extra.
Tools
from pythios import Tools
Tools.profile(data)
Tools.suggest(data)
Tools.validate(data)
Tools.detect_outliers(data)
Tools.export(data, "cleaned.csv")
Other utilities include balancing, memory reporting, reproducible seeds, dataset comparison, and timing. LLM helpers use a locally running Ollama server.
Saving models
model.save("model.pkl")
restored = Models(data).load("model.pkl")
predictions = restored.predict()
Development
python -m venv .venv
source .venv/bin/activate
python -m pip install -e .
python -m pip install pytest
pytest -q
License
Pythios is released under the MIT License.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pythios-0.1.4.tar.gz.
File metadata
- Download URL: pythios-0.1.4.tar.gz
- Upload date:
- Size: 33.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da8a1878d62338158890596c1af7c295f18c0d05a0b069d5762e6c0cc653adae
|
|
| MD5 |
a5408ebed0ecf833d5047cdbe1eff15f
|
|
| BLAKE2b-256 |
e24fc644cbb9ecd8722eb8930fedc99bc3e9329522cef28feb2f0b9afe0f4bc4
|
File details
Details for the file pythios-0.1.4-py3-none-any.whl.
File metadata
- Download URL: pythios-0.1.4-py3-none-any.whl
- Upload date:
- Size: 34.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ec36fed5b40af9888cf76c3d1a800314668d90650fc6a7600fc6f412605b8e5
|
|
| MD5 |
5460eb22100f0b91dc5e729b7c9c9714
|
|
| BLAKE2b-256 |
4cdcbd40d14f492bc93b8a4163a1abf9b4ac3399ee2c2ba4e53c37ac8c662a60
|