Skip to content

rslearn-lib/rslearn-ML-py

Β 
Β 

Repository files navigation

πŸš€ rslearn

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

License Python Status Contributions


NOTE

This is Python version of this library visit more.

Origination - rslearn-lib


✨ 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.8 - 1.0.3
  • Release Date: 2026-06-26

Latest (In Pipeline & linear_model):

  • KNN Regression & Classification Both
  • Evaluation & auto scaling support

More Info: CHANGELOG

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/rslearn-lib/rslearn-ML-py.git
cd rslearn-ML-py/

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

πŸ”¨ Origination

rslearn-lib


πŸ“œ License

This project is licensed under the GNU GPL v3 License.

About

Rslearn-ML Machine Learning Library (From Scratch)

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors

Languages

  • Python 94.2%
  • HTML 3.0%
  • CSS 2.8%