Skip to main content

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

Metadata

Release files for skleam-code 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for skleam-code 0.4.0
File Size Uploaded Provenance Actions
skleam_code-0.4.0.tar.gz 11.7 kB Without provenance Details for skleam_code-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for skleam-code 0.4.0
File Interpreter ABI Platform Actions
skleam_code-0.4.0-py3-none-any.whl Python 3 none any Details for skleam_code-0.4.0-py3-none-any.whl

Total release size: 37.9 kB

Release files / skleam_code-0.4.0.tar.gz

Download URL skleam_code-0.4.0.tar.gz
Size 11.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f66f5863f2d42af7b83af0a48ebec846a8ee62c136ba5e370fc4ce1405b344c8
BLAKE2b-256 checksum
How to use checksums
c3f3a6194235462bfcab5d35b874dbcc7124ca8f7caf3429733604cd78cb382e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.1

Release files / skleam_code-0.4.0-py3-none-any.whl

Download URL skleam_code-0.4.0-py3-none-any.whl
Size 26.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d8f918a1ac51fe05c11a5e3e88238d883ec28d8d3426cc63332ec4ac62d2a889
BLAKE2b-256 checksum
How to use checksums
f496ad1d7c82dd139a92f76da8558508abb81498057e3d84be9d5181645754ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.1

Security for skleam-code 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page