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 likescikit-learn.no_lib: Models built strictly from scratch using purenumpymathematics.
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
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 skleam_code-0.3.0a0.tar.gz.
File metadata
- Download URL: skleam_code-0.3.0a0.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
777e4c8beaeddf91aa4ccfe66cdc0500f6e95e88b8c2457674c382538814c8fb
|
|
| MD5 |
5200079a6d05f27ff7c6c02f51eb33f7
|
|
| BLAKE2b-256 |
ac60153ca849cdafb661e66caa7a60536419c06b1fb0293c45da6f738e9fe879
|
File details
Details for the file skleam_code-0.3.0a0-py3-none-any.whl.
File metadata
- Download URL: skleam_code-0.3.0a0-py3-none-any.whl
- Upload date:
- Size: 25.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e8f69da4eb8cb0186a98bf10bab639707b52055d633c906ca7b0799cb6fd258
|
|
| MD5 |
28ce03f1e00a0eed45e96f06a7aab337
|
|
| BLAKE2b-256 |
c3b2fba121fb960190217b0ddb0a08b270286e8b5c42282bf45fa69dbd098ea4
|