Skip to main content

A simple sklearn-like ML library built from scratch, Relaunch For rslearn-ML

Project description

๐Ÿš€ rslearn

A beginner-friendly machine learning library that automates preprocessing, training, and evaluation.

License Python Status Contributions


โœจ Why rslearn?

  • โšก Minimal setup โ€” no complex configuration
  • ๐Ÿค– Automatic pipeline (scaling, splitting, evaluation)
  • ๐Ÿ“Š Built-in metrics for regression & classification
  • ๐Ÿง  Designed for beginners learning ML concepts
  • ๐Ÿงฉ Clean and simple API inspired by sklearn

Release & Changes

  • Version : 1.0.7 - 1.0.1
  • Release Date: 2026-05-26

๐Ÿš€ Features

Latest (In Pipeline & linear_model):

  • Pipeline With Inbuilt Analysis Method With Regulizations class support
  • evaluation() Function Support in All Classes

More Info: CHANGELOG
More Parameter Info (in Pipeline): README
More Parameter Info (in linear_models): README Read Doc Strings For Extra Information About Parameter

Fix

  • Shape varification issue in linear_model
  • Auto Scaler Problem

Changed

  • MIT License to GNU GPL v3
  • analysis() to evaluate() in Pipeline

๐Ÿ—„๏ธ New File & Folders

  • Folder: Pipeline
  • File: Pipeline/_pipeline.py

Download Version Specific Module

Downloads - Module

๐Ÿ“Š Linear Models

  • Linear Regression (Single & Multi-feature)
  • Logistic Regression (Binary & Multi-class)
  • Ridge Regression (L2 Regularization)
  • Lasso Regression (L1 Regularization)
  • Elastic Net (L1 + L2)

๐Ÿ“ Metrics

  • Mean Squared Error (MSE)
  • Mean Absolute Error (MAE)
  • Root Mean Squared Error (RMSE)
  • Rยฒ Score
  • Accuracy (for classification)

โœ” Supports single-output and multi-output tasks


๐Ÿ”ง Preprocessing

  • StandardScaler
  • MinMaxScaler

๐Ÿงช Model Selection

  • Train-Test Split

    • Supports stratify for balanced sampling

โš™๏ธ Optimization Details

All models in rslearn are implemented using Gradient Descent.

โš ๏ธ Important:

  • Feature scaling is highly recommended for stable and faster convergence.

  • Use:

    • StandardScaler (recommended)
    • or MinMaxScaler

๐Ÿค– Auto Standard Scaling (Linear, Logistic, Ridge, Lasso, ElasticNet)

models include Inbuilt StandardScaler Feature in fit() Method:

scale=True  # default
  • Automatically applies feature scaling internally
  • Helps prevent numerical instability

๐Ÿ“ Project Structure

rslearn/
โ”‚
โ”œโ”€โ”€ linear_model/
โ”‚   โ”œโ”€โ”€ _linear_regression.py
โ”‚   โ”œโ”€โ”€ _logistic_regression.py
โ”‚   โ”œโ”€โ”€ _ridge.py
โ”‚   โ”œโ”€โ”€ _lasso.py
โ”‚   โ”œโ”€โ”€ _elastic_net.py
โ”‚
โ”œโ”€โ”€ preprocessing/
โ”‚   โ”œโ”€โ”€ _scaler.py
โ”‚
โ”œโ”€โ”€ metrics/
โ”‚   โ”œโ”€โ”€ _regression.py
โ”‚
โ”œโ”€โ”€ model_selection/
โ”‚   โ”œโ”€โ”€ _split.py
โ”‚
โ””โ”€โ”€ README.md

๐Ÿ“Œ Each module contains its own detailed README with usage examples and explanations.


๐Ÿ› ๏ธ Installation

Clone the repository

git clone https://github.com/ItzRustam/rslearn-ML.git
cd rslearn

Install Usable Library (Stable - Latest)

pip install rslearn-py

Download Version Specific Module

Downloads Older Library

Install dependencies

pip install -r requirements.txt

๐Ÿ“Œ Quick Example

from rslearn.linear_model import LinearRegression
from rslearn.preprocessing import StandardScaler
import numpy as np

X = np.array([10, 20, 30])
y = np.array([5, 10, 15])

scaler = StandardScaler()
X_scaled = scaler.fit_transform(X)

model = LinearRegression()
model.fit(X_scaled, y)

print(model.predict([40]))

๐Ÿ“š Documentation

  • Each folder includes its own README.md

  • Covers:

    • Usage
    • Parameters
    • Examples
    • Internal working

๐ŸŽฏ Goals of this Project

  • Understand ML algorithms from scratch
  • Build a sklearn-like API
  • Create reusable and modular ML components
  • Learn real-world ML system design
  • Check Self Ability

๐Ÿง‘โ€๐Ÿ’ป Author

ItzRustam


๐Ÿ“œ License

This project is licensed under the GNU GPL v3 License.

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

rslearn_py-1.0.1.tar.gz (35.3 kB view details)

Uploaded Source

Built Distribution

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

rslearn_py-1.0.1-py3-none-any.whl (44.5 kB view details)

Uploaded Python 3

File details

Details for the file rslearn_py-1.0.1.tar.gz.

File metadata

  • Download URL: rslearn_py-1.0.1.tar.gz
  • Upload date:
  • Size: 35.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for rslearn_py-1.0.1.tar.gz
Algorithm Hash digest
SHA256 5886b0b18c5098a5c387c0173117b06899b1c7849e8de172022994b2835a22d9
MD5 4d539d4931ec0b9c7a58925113a2ca1e
BLAKE2b-256 2f8ae31b8ee1d9a6512ffe2d24144d67be9294371152a806670f69cd5c7ddaa6

See more details on using hashes here.

File details

Details for the file rslearn_py-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: rslearn_py-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 44.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for rslearn_py-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fbd8aecbad7c6f836ecfd98db4e4ecd60ffb29f53081d621841f0ae7e02fa62c
MD5 ef80d2a98e48cd1b606ded9656b76ef2
BLAKE2b-256 cf9b95eb5dd38a2be676062e77d417936876e92d5f1469d458df3749a5b0d9aa

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