Skip to content

Added rslearn-py - #1559

Open
ItzRustam wants to merge 1 commit into
Kaggle:mainfrom
ItzRustam:new/rslearn
Open

Added rslearn-py#1559
ItzRustam wants to merge 1 commit into
Kaggle:mainfrom
ItzRustam:new/rslearn

Conversation

@ItzRustam

Copy link
Copy Markdown

What's New

This PR adds rslearn-py to the docker-python image so it is available as part of the pre-installed Python package set.

Why?

rslearn-py is a lightweight machine learning library focused on keeping common ML workflows simple while providing useful functionality without adding unnecessary complexity or heavy dependencies. Including it in the image makes rslearn-py readily available to Python users and projects running in docker-python, while keeping the addition small and straightforward.

Links

source code : https://github.com/ItzRustam/rslearn-ML
web : https://rslearn-py.rslearnlib.workers.dev/

Usage

import numpy as np
from rslearn.linear_model import LinearRegression

# Training data
X = np.array([
    [1],
    [2],
    [3],
    [4],
    [5],
])

y = np.array([2, 4, 6, 8, 10])

# Train the model
model = LinearRegression()
model.fit(X, y, scale=True) # Auto Scales Data, saves time

# Make predictions
predictions = model.predict(np.array([[6], [7]])) # Scales new data also on saved StandardScaler configs.
print(predictions)

# Evaluations
evals = model.evaluate_model(y_pred=predictions, y_true=[12, 14])
print(evals) 
# This will return r2_score, rmse, mse, mae at once

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant