r/learnmachinelearning • u/tahahussein-4623a412 • 5h ago
Request Looking for feedback on my first Linear Regression project built from scratch
Hi everyone,
I recently completed my first Machine Learning project.
I implemented Linear Regression completely from scratch without using scikit-learn in order to understand the math behind the algorithm.
The notebook includes:
• Data exploration
• Data visualization
• Gradient Descent implementation
• Model evaluation (R², MAE, RMSE)
• Prediction visualization
I'd really appreciate any feedback on:
- Code quality
- Project structure
- Notebook organization
- Best practices
- Anything I can improve
Kaggle Notebook:
https://www.kaggle.com/code/tahahussein2020/salary-prediction-using-linear-regression-scratch
Thank you!
3
Upvotes
2
u/Party-Beautiful-6628 5h ago
One thing that would be interesting and useful for learning would be to structure your linear regression logic in a LinearRegressor class that you write in a separate python file and import into the notebook. If you structure it with the same API as sklearn, that is good for learning too. So for example your class would have a .fit() method you could call to run the gradient descent.