Skip to main content

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().

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pythios-0.1.3.tar.gz (29.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pythios-0.1.3-py3-none-any.whl (30.4 kB view details)

Uploaded Python 3

File details

Details for the file pythios-0.1.3.tar.gz.

File metadata

  • Download URL: pythios-0.1.3.tar.gz
  • Upload date:
  • Size: 29.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for pythios-0.1.3.tar.gz
Algorithm Hash digest
SHA256 28c22a5af738bd5d87b6bbaa3a3ee38af4a2de96f84a6ef6618d308328565c64
MD5 344ddd26c70047c05bf6b90c774e3655
BLAKE2b-256 8b385c14658c247ca7a53d5d7cb1ff63469993515309a19112b348ad66d030a5

See more details on using hashes here.

File details

Details for the file pythios-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: pythios-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 30.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for pythios-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a729bd715cfcc800dccfdcbdf5df74d76f561232c48aeb83d80bd5c006c06c92
MD5 0509bb891779e6f4f9af02092f5885d8
BLAKE2b-256 4fa136d95d683f8a9a1a8cd528f0a6d365093ee1695580661cca3d2a2506bc55

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page