RidgeMake is a lightweight, user-friendly regression and visualization package designed to take you from raw paired data to an interpretable linear fit in a few steps. It supports fitting a line of best fit by computing the slope and intercept, generating a clear scatter plot of observed points, and overlaying the fitted regression line on the same figure for immediate visual comparison. To help you assess how well the model explains the variation in your data, RidgeMake also provides an R² score calculation as a simple, standard performance metric. Together, these functions make RidgeMake a practical tool for quick exploratory analysis, teaching demonstrations, and reproducible reporting of basic linear regression results.
get_reg_line: Calculate slope and intercept of the regression lineridge_scatter: Visualize your data pointsridge_scatter_line: Plot the fitted line on the chartridge_get_r2: Evaluate model performance with R² metric
import numpy as np
from ridgemake import (
get_reg_line,
ridge_scatter,
ridge_scatter_line,
ridge_get_r2
)
# Example paired data
x = np.array([1, 2, 3, 4, 5])
y = np.array([2, 4, 5, 4, 6])
# Fit regression line
slope, intercept = get_reg_line(x, y)
# Compute R^2
r2 = ridge_get_r2(x, y, slope, intercept)
print(f"Slope: {slope:.3f}, Intercept: {intercept:.3f}, R^2: {r2:.3f}")
# Visualize
ridge_scatter(x, y)
ridge_scatter_line(x, y, slope, intercept)RidgeMake is intended for educational use and small-to-medium sized datasets.
The package is designed for simple linear regression on paired numeric data and prioritizes clarity and ease of use over computational efficiency. It is suitable for classroom demonstrations, quick exploratory analysis, and small experiments.
RidgeMake does not support large-scale datasets, high-dimensional data, or advanced regression techniques (e.g., regularization, multivariate regression, or model diagnostics). For production-level workflows or large datasets, users should consider more specialized libraries such as scikit-learn or statsmodels.
git clone https://github.com/UBC-MDS/DSCI_524_group24.git
cd DSCI_524_group24conda env create -f environment.yml
conda activate group-24-524From the repo root:
pip install -e .From the repo root:
pytest -qIf you are installing from a released package (example):
pip install ridge_remakeFrom the repo root, run:
quartodoc buildquarto renderDocumentation deployment is automated via GitHub Actions on pushes to main.
On GitHub:
- Repository Settings → Pages
- Set Source to GitHub Actions
Push to main:
git push origin mainAfter the workflow finishes, the site will be available at the repository’s GitHub Pages URL: https://ubc-mds.github.io/DSCI_524_group24/
- Yue Xiang Ni
- Suryash Chakravarty
- Seungmyun Park
- Jingyi Zha