Skip to main content

🚀 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
  • 📈 Automated evaluations with evaluate_model

Release & Changes

  • Version : 1.1.1 - 1.0.5
  • Release Date: 2026-08-20
  • CHANGELOG

NOTE

tests/* will be changed for each functions after documantation update.

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)

📊 K-nearest Neighbors Models

  • KNNRegressor (Single & Multi-feature)
  • KNNClassifier (Binary & Multi-class)

📏 Metrics

  • Mean Squared Error (MSE)
  • Mean Absolute Error (MAE)
  • Root Mean Squared Error (RMSE)
  • R² Score
  • Accuracy (for classification)
  • Euclidian Distance (for KNN)

✔ 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
  • or just use scale=True parameter while fit()


🤖 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-ML/
│
├── rslearn/
│   │
│   ├── BaseEstimators/
│   │   └── __init__.py  
│   │   └── _base.py  
│   │   └── _estimator.py  
│   │
│   ├── Errors/
│   │   ├── __init__.py
│   │   └── _errors.py  
│   │
│   ├── loader/
│   │   ├── __init__.py
│   │   └── _pipeline_loader.py
│   │   └── _model_loader.py  
│   │
│   ├── linear_model/
│   │   ├── __init__.py
│   │   ├── README.md
│   │   ├── _LinearRegression.py
│   │   ├── _LogisticRegression.py
│   │   └── _regulizations.py
│   │
│   ├── metrics/
│   │   ├── __init__.py
│   │   ├── README.md  
│   │   ├── _evaluations.py  
│   │   ├── regression_readme.md  
│   │   ├── evaluation.md  
│   │   ├── classification_readme.md
│   │   ├── _classification.py
│   │   ├── _distances.py
│   │   └── _regression.py
│   │
│   ├── model_selection/
│   │   ├── __init__.py
│   │   ├── README.md
│   │   └── _split.py
│   │
│   ├── neighbors/
│   │   ├── __init__.py
│   │   ├── README.md
│   │   ├── _knnClass.py
│   │   └── _knnReg.py
│   │
│   ├── Pipeline/
│   │   ├── __init__.py
│   │   ├── README.md
│   │   └── _pipeline.py
│   │
│   ├── preprocessing/
│   │   ├── __init__.py
│   │   ├── README.md
│   │   └── _scaler.py
│   │
│   └── __init__.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

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

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

model = LinearRegression()
model.fit(X, y, scale=True) # Auto Scale if True, else Gradient Stability Backend

print(model.predict([40]))

📚 Documentation

  • Each folder includes its own README.md

  • Covers:

    • Usage
    • Parameters
    • Examples
    • Internal working
      Good For Developers & Contributors

User Guide


🧑‍💻 Author

ItzRustam

🔨 Origination

rslearn-lib


📜 License

This project is licensed under the GNU GPL v3 License.

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.5.tar.gz (43.2 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.5-py3-none-any.whl (58.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rslearn_py-1.0.5.tar.gz
  • Upload date:
  • Size: 43.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.5

File hashes

Hashes for rslearn_py-1.0.5.tar.gz
Algorithm Hash digest
SHA256 d5e24eee084560224671956c1eca688d8693eec18b5f323d073801e290e0cd3c
MD5 ba65c104384180dc3e6b2151e31598bc
BLAKE2b-256 3b8ce1aad12ca10e5f2b5bd1c743fc7896bc017dd3954f9327625f14814eb35f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rslearn_py-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 58.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.5

File hashes

Hashes for rslearn_py-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7696fed5403dc83c146f2ab3d74421c9b031306640dc352e9a6996dd54a976de
MD5 a9c7846cedf462a72328daf0ce138217
BLAKE2b-256 f07d1a0fd3f40023aa4db02b6d060048024eb85d394098c3c996d5f1449da7ff

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.5 This release

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

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