Skip to main content

Lightweight interface to scikit-learn, xgboost, lightgbm, catboost, with 2 classes

Project description

tisthemachinelearner


Lightweight interface to scikit-learn with 2 classes, Classifier and `Regressor.

PyPI PyPI - License Downloads Documentation

Installing (for Python and R)

Python

  • 1st method: by using pip at the command line for the stable version
pip install tisthemachinelearner
  • 2nd method: from Github, for the development version
pip install git+https://github.com/Techtonique/tisthemachinelearner.git

or

git clone https://github.com/Techtonique/tisthemachinelearner.git
cd tisthemachinelearner
make install

Examples

import numpy as np
from sklearn.datasets import load_diabetes, load_breast_cancer
from sklearn.model_selection import train_test_split
from tisthemachinelearner import Classifier, Regressor

# Classification
X, y = load_breast_cancer(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)

clf = Classifier("LogisticRegression", random_state=42)
clf.fit(X_train, y_train)
print(clf.predict(X_test))
print(clf.score(X_test, y_test))

clf = Classifier("RandomForestClassifier", n_estimators=100, random_state=42)
clf.fit(X_train, y_train)
print(clf.predict(X_test))
print(clf.score(X_test, y_test))

# Regression
X, y = load_diabetes(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)

reg = Regressor("LinearRegression")
reg.fit(X_train, y_train)
print(reg.predict(X_test))
print(np.sqrt(np.mean((reg.predict(X_test) - y_test) ** 2)))

reg = Regressor("RidgeCV", alphas=[0.01, 0.1, 1, 10])
reg.fit(X_train, y_train)
print(reg.predict(X_test))
print(np.sqrt(np.mean((reg.predict(X_test) - y_test) ** 2)))

License

BSD 3-Clause © T. Moudiki, 2025.

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

tisthemachinelearner-0.6.0.tar.gz (95.8 kB view details)

Uploaded Source

Built Distribution

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

tisthemachinelearner-0.6.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file tisthemachinelearner-0.6.0.tar.gz.

File metadata

  • Download URL: tisthemachinelearner-0.6.0.tar.gz
  • Upload date:
  • Size: 95.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for tisthemachinelearner-0.6.0.tar.gz
Algorithm Hash digest
SHA256 6a0f355362fdc7a91e3eb6db94f3c86d81750a61d3f858e22124c2eda054d8e8
MD5 4c9caed2d6cf809f87755d22ad5a5ea6
BLAKE2b-256 54da21350174f6030016faa8bd72080adec7179d0807b4157f50d24c927cd4be

See more details on using hashes here.

File details

Details for the file tisthemachinelearner-0.6.0-py3-none-any.whl.

File metadata

File hashes

Hashes for tisthemachinelearner-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3029dbc66b3f85e8bccbb5674a092f26a5f7f732c3111ae6e18f9762aebf8e09
MD5 4b751829c0d56533a5a891d654a25c0a
BLAKE2b-256 bc27c207af40dc177f215a1eb95c842f99e416dc73dd5db5633c07919336cd82

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