Experience vs Salary Prediction (Linear Regression Code)
(Real-life Example)
Problem Statement
Predict salary based on years of experience
Step 1: Import Libraries
Step 2: Create Dataset
Explain:
-
Experience → Input
-
Salary → Output
Step 3: Divide Data
Step 4: Train Model
Explain:
-
Model learns how salary grows with experience
Step 5: Predict Salary
Explain:
-
Predict salary for 6 years experience
No comments:
Post a Comment