LineSight is a transparent Python library designed to teach you how regression actually works — not just how to call it. Every model exposes its internal mechanics through plain-English explanations, real-time training animations, and over 30 diagnostic visualizations.
from linesight import LinearRegression
model = LinearRegression(
learning_rate=0.01,
epochs=1000,
store_history=True
)
model.fit(X, y)
# See your equation
model.show_equation()
→ ŷ = 2.01x + 0.98
# Understand the fit
model.explain_fit(X, y)
→ R² = 0.998 — explains 99.8% of variance
# Watch it learn
model.animate_training(X, y)
Hands-on, end-to-end walkthroughs that teach regression concepts through working code. Each tutorial runs directly in Jupyter Notebooks — zero configuration required.
No prerequisites beyond basic Python. Build intuition for core regression concepts through guided, interactive examples.
Train, evaluate, and interpret your first regression model
in five lines of code using fit(),
predict(), and score().
Watch gradient descent converge in real time. Explore 3D loss surfaces, residual distributions, and training dynamics through interactive plots.
Translate raw coefficients into actionable insights using
summary() and explain_coefficients() for
human-readable model interpretation.
Explore regularization techniques, binary classification, and publication-quality diagnostic visualizations.
Understand the geometry of regularization — visualize L1/L2 constraint regions, coefficient shrinkage paths, and feature elimination thresholds.
Visualize decision boundaries, sigmoid probability surfaces, ROC/AUC curves, and confusion matrices for binary classification tasks.
Generate 3D loss surfaces, multicollinearity diagnostics (VIF), partial regression plots, prediction intervals, and sensitivity analyses.
Six regression and classification models built on a consistent,
scikit-learn-style API. Every model exposes fit(), predict(),
score(), and get_training_history() — making it easy to
compare algorithms side by side.
Ordinary least squares via gradient descent. Directly exposes learned
m (slope) and b (intercept) for full transparency.
Multi-feature regression with per-feature importance ranking, Variance Inflation Factor (VIF) diagnostics, and partial regression analysis.
Gradient DescentL2-penalized regression that prevents overfitting by shrinking coefficients toward zero. Includes visual constraint region overlays and shrinkage path plots.
Gradient DescentL1-penalized regression for automatic feature selection. Visualize sparsity paths that reveal at which regularization strength each feature is eliminated.
Coordinate DescentCombines L1 and L2 penalties with a tunable mixing ratio. Visualize the trade-off between sparsity (Lasso) and stability (Ridge) in a unified framework.
Coordinate DescentBinary classification via the sigmoid function. Renders decision boundaries, probability surfaces, ROC/AUC curves, and confusion matrices for comprehensive evaluation.
Gradient DescentEvery model in LineSight is decomposed into three clearly separated layers — computation, interpretation, and visualization — so you always know exactly what is happening and why.
The numerical core. Clean, readable implementations of gradient descent
and coordinate descent that expose named weights and bias
parameters instead of opaque theta vectors.
Natural-language interpretation layer. Automatically translates coefficients, regularization effects, and decision boundaries into human-readable explanations with contextual annotations.
Publication-quality matplotlib visualizations and animations. Includes loss surfaces, residual diagnostics, training convergence animations, prediction intervals, and 30+ additional methods.
Install LineSight with a single command and begin exploring regression models immediately. No additional configuration required.
pip install linesight
git clone https://github.com/AnshumanTiwari2006/linesight && cd linesight && pip install -e ".[dev]"