Skip to main content

A plug-and-play machine learning package with and without libraries.

Project description

skleam-code

A comprehensive, plug-and-play machine learning library offering algorithm implementations both with and without standard libraries (from scratch). It is designed to be highly educational, easy to use, and immediately functional.

Installation

Install the package via pip:

pip install skleam-code

Overview

The skleam-code library is structured into two main sub-modules:

  • with_lib: Models built on top of standard libraries like scikit-learn.
  • no_lib: Models built strictly from scratch using pure numpy mathematics.

Both categories contain the exact same lineup of 13 algorithms!

Supported Algorithms:

  • Regression: Linear Regression, Logistic Regression
  • Tree-Based: Decision Tree, Random Forest, Bagging Random Forest
  • Boosting: AdaBoost, XGBoost
  • SVM: Linear SVM, Non-Linear SVM
  • Unsupervised / Dimensionality Reduction: K-Means Clustering, PCA, SVD, LDA

Quick Start & Usage

Every single model in skleam-code shares a uniform, plug-and-play API. You only need to know two methods to use any algorithm:

  • .fit(X, y) or .fit(X) for unsupervised models.
  • .predict(X) or .transform(X) for projection models.

Example: Using Pre-built "From Scratch" Models (no_lib)

from skleam.no_lib import DecisionTreeNoLib

# 1. Initialize the model
model = DecisionTreeNoLib(max_depth=5)

# 2. Automatically generate dummy data to test it out!
X, y = model.generate_data(n_samples=200, n_features=4, task='classification')

# 3. Fit and Predict
model.fit(X, y)
predictions = model.predict(X)
print("Predictions:", predictions[:10])

Example: Using Standard Library Backed Models (with_lib)

from skleam.with_lib import RandomForestWithLib

# Initialize the model (you can pass kwargs supported by the underlying sklearn model)
rf = RandomForestWithLib(n_estimators=100, max_depth=3)

# Generate dummy data
X, y = rf.generate_data(task='classification')

# Fit and Predict
rf.fit(X, y)
print("RF Predictions:", rf.predict(X)[:5])

Generating Artificial Test Data

One of the best features of skleam-code is the built-in static method generate_data(), attached to every single model. If you don't have a dataset ready, the library will generate one specifically formatted for the task at hand.

Supported tasks include: 'classification', 'regression', 'clustering', and 'unsupervised'.

from skleam.no_lib import KMeansNoLib

# Generate clustering data instantly
X, y = KMeansNoLib.generate_data(n_samples=300, n_features=2, task='clustering')

kmeans = KMeansNoLib(K=3)
kmeans.fit(X)
print(kmeans.predict(X)[:10])

Exploring the Architecture

You can quickly view all available algorithms directly in your terminal using the built-in index tool:

from skleam import index
index.main()

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

skleam_code-0.4.0.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

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

skleam_code-0.4.0-py3-none-any.whl (26.2 kB view details)

Uploaded Python 3

File details

Details for the file skleam_code-0.4.0.tar.gz.

File metadata

  • Download URL: skleam_code-0.4.0.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.1

File hashes

Hashes for skleam_code-0.4.0.tar.gz
Algorithm Hash digest
SHA256 f66f5863f2d42af7b83af0a48ebec846a8ee62c136ba5e370fc4ce1405b344c8
MD5 fe4a221501251af632bed769954f9e6f
BLAKE2b-256 c3f3a6194235462bfcab5d35b874dbcc7124ca8f7caf3429733604cd78cb382e

See more details on using hashes here.

File details

Details for the file skleam_code-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: skleam_code-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 26.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.1

File hashes

Hashes for skleam_code-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d8f918a1ac51fe05c11a5e3e88238d883ec28d8d3426cc63332ec4ac62d2a889
MD5 ba78300b13c7b1a06f136fccfc9fd52c
BLAKE2b-256 f496ad1d7c82dd139a92f76da8558508abb81498057e3d84be9d5181645754ef

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