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.2.0.tar.gz (10.8 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.2.0-py3-none-any.whl (25.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: skleam_code-0.2.0.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

Hashes for skleam_code-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c4f7df4d6032736aec892b541cba69b5e839f17054593263b93157f5d7912c8b
MD5 1a7445519b800de844aa27f3d7fee12e
BLAKE2b-256 cdb9ca3b0d2e87c8612cd47d86cb673a06857dab3760fed9aeb47f2157171932

See more details on using hashes here.

File details

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

File metadata

  • Download URL: skleam_code-0.2.0-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

Hashes for skleam_code-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2ce939b60811556938eb6768084105ce2391840f19474e1c70db68f7bf400319
MD5 4bed0bd1594d8c394f7b5b5e775e0871
BLAKE2b-256 474080c18ae41add621c75b2768aee30e25d47bb0c2ae7a8098834534065d81f

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