Skip to content

Commit 714463a

Browse files
Building the Linear Regression Model
1 parent be1d4b6 commit 714463a

1 file changed

Lines changed: 53 additions & 4 deletions

File tree

4_data_analysis/MLProject.ipynb

Lines changed: 53 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -634,11 +634,60 @@
634634
]
635635
},
636636
{
637-
"cell_type": "code",
638-
"execution_count": null,
639-
"id": "fceebc18",
637+
"cell_type": "markdown",
638+
"id": "ab51a910",
639+
"metadata": {},
640+
"source": []
641+
},
642+
{
643+
"cell_type": "markdown",
644+
"id": "87025184",
645+
"metadata": {},
646+
"source": []
647+
},
648+
{
649+
"cell_type": "markdown",
650+
"id": "69f4c652",
651+
"metadata": {},
652+
"source": []
653+
},
654+
{
655+
"cell_type": "markdown",
656+
"id": "00a83671",
657+
"metadata": {},
658+
"source": [
659+
"6. Building the Linear Regression Model"
660+
]
661+
},
662+
{
663+
"cell_type": "markdown",
664+
"id": "3231b2b5",
665+
"metadata": {},
666+
"source": [
667+
"# Step 6.1: Create and train the model\n",
668+
"print(\"=== BUILDING LINEAR REGRESSION MODEL ===\")\n",
669+
"\n",
670+
"# Initialize the model\n",
671+
"model = LinearRegression()\n",
672+
"\n",
673+
"# Train the model\n",
674+
"model.fit(X_train_scaled, y_train)\n",
675+
"\n",
676+
"print(\"Model training completed!\")\n",
677+
"print(f\"\\nModel Coefficients: {model.coef_}\")\n",
678+
"print(f\"Model Intercept: {model.intercept_:.2f}\")\n",
679+
"\n",
680+
"# Step 6.2: Make predictions\n",
681+
"y_pred_train = model.predict(X_train_scaled)\n",
682+
"y_pred_test = model.predict(X_test_scaled)\n",
683+
"\n",
684+
"print(\"\\nPredictions generated for training and testing sets\")"
685+
]
686+
},
687+
{
688+
"cell_type": "markdown",
689+
"id": "59382706",
640690
"metadata": {},
641-
"outputs": [],
642691
"source": []
643692
}
644693
],

0 commit comments

Comments
 (0)