- Load a CSV with student study hours and marks. Predict the score for a new student who studied 7 hours.
- Build a multiple linear regression model to predict house prices using area, number of bedrooms, and distance from city center.
- Calculate the Mean Squared Error manually for a small dataset and compare it with the model’s MSE.
Challenge 1: Predict Student Score for 7 Hours of Study


Linear Regression Equation: y=5.94x+29.15
Predicted Score (using model):≈ 70.74 marks
Manual Calculation (using y = mx + c): y=5.94×7+29.15 = 70.74
Challenge 2: Multiple Linear Regression for House Prices

If a house has:
- Area = 1800 sq ft
- Bedrooms = 3
- Distance = 4 km
Price= 100,000 + 100×1800 + 50,000×3 + 0×4 =430,000
Final Predicted Price = $430,000

| Term | Value Used | Why This Value Was Chosen |
|---|---|---|
| Intercept (b₀) | 100,000 | Learned by the model during training. It’s the base price when all inputs are 0. |
| Area | 1800 | A realistic mid-range house area (sq ft) between 1000–2500 in the dataset. |
| Coefficient for Area | 100 | The model learned that for every 1 sq ft increase in area, price goes up by $100. |
| Bedrooms | 3 | A typical value from the dataset (ranging 2–4). Chosen to test an average case. |
| Coefficient for Bedrooms | 50,000 | The model learned that each additional bedroom adds $50,000 in value. |
| Distance from city | 4 | An arbitrary, realistic test value (between 2–8 in the dataset). |
| Coefficient for Distance | 0 | The model found that distance had no impact on price in the dataset (coefficient = 0). |
Challenge 3: Mean Squared Error (MSE) Comparison


Actual Values: [100, 150, 200]
Predicted Values: [110, 140, 195]
Step-by-Step Residuals (Actual – Predicted):
- 100 – 110 = -10
- 150 – 140 = 10
- 200 – 195 = 5
Squared Errors:
- (-10)² = 100
- (10)² = 100
- (5)² = 25
Manual Mean Squared Error (MSE): MSE=100+100+253=75.0
Disclaimer: All information provided on www.academicbrainsolutions.com is for general educational purposes only. While we strive to provide accurate and up-to-date information, we make no representations or warranties of any kind, express or implied, about the completeness, accuracy, reliability, suitability, or availability of the information contained on the blog/website for any purpose. Any reliance you place on such information is therefore strictly at your own risk. The information provided on www.academicbrainsolutions.com is not intended to be a substitute for professional educational advice, diagnosis, or treatment. Always seek the advice of your qualified educational institution, teacher, or other qualified professional with any questions you may have regarding a particular subject or educational matter. In no event will we be liable for any loss or damage including without limitation, indirect or consequential loss or damage, or any loss or damage whatsoever arising from loss of data or profits arising out of, or in connection with, the use of this blog/website. Our blog/website may contain links to external websites that are not provided or maintained by us. We do not guarantee the accuracy, relevance, timeliness, or completeness of any information on these external websites. Comments are welcome and encouraged on www.academicbrainsolutions.com is but please note that we reserve the right to edit or delete any comments submitted to this blog/website without notice due to: Comments deemed to be spam or questionable spam, Comments including profanity, Comments containing language or concepts that could be deemed offensive, Comments that attack a person individually.By using www.academicbrainsolutions.com you hereby consent to our disclaimer and agree to its terms. This disclaimer is subject to change at any time without prior notice
Leave a comment