Linear Regressionscikit-learnNext.js API

Salary Predictor

A full-stack implementation of a Linear Regression model achieving 0.93 R-squared, trained on the Global MNC Employee Dataset.

Live Salary Prediction

Data is processed via Next.js backend API routes.

The Objective

Real-world corporate salary data is notoriously noisy, requiring strict preprocessing pipelines to extract a clean mathematical signal. The goal was to accurately predict employee salaries based on performance metrics, experience, and demographic data without relying on a heavy Python backend for inference.

Technical Implementation

1. Categorical Encoding

Handled text-based variables (like Department and Education) using Pandas One-Hot Encoding to convert them into machine-readable matrices.

2. Feature Scaling

Applied Standard Scaling to normalize continuous variables, preventing high-magnitude features from dominating the gradient descent.

3. Model Training

Deployed a Multiple Linear Regression algorithm in Python to establish a baseline, isolating the exact mathematical weights of each feature.

4. API Extraction

Extracted the final mathematical weights from `scikit-learn` and injected them into a secure Next.js API route for lightning-fast frontend inference.

The Outcome

The model achieved a highly accurate R-squared score of 0.93. By deploying the mathematical pipeline via a Next.js API, the system delivers real-time salary predictions with zero cold-starts and no reliance on expensive Python cloud hosting.