Skip to content

Commit

Permalink
sources codes added for third video
Browse files Browse the repository at this point in the history
  • Loading branch information
selmanbaskaya committed Apr 4, 2021
1 parent dc8bb97 commit 5f2b7c3
Show file tree
Hide file tree
Showing 3 changed files with 150 additions and 5 deletions.
74 changes: 73 additions & 1 deletion ML-Project/.ipynb_checkpoints/model-checkpoint.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,79 @@
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
"source": [
"#Train Test Split\n",
"X_train, X_test, y_train, y_test = train_test_split(data.iloc[:,0:-1], data.iloc[:,-1], test_size=0.2, random_state=0)\n",
"X_train"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Linear Regression\n",
"regressor = LinearRegression()\n",
"regressor"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"regressor.fit(X_train, y_train)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Linear Regression Predict\n",
"y_pred = regressor.predict(X_test)\n",
"y_pred"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#backward elimination with statsmodels\n",
"X = np.append(arr = np.ones((969,1)).astype(int), values = data, axis=1)\n",
"x_list = np.array(data.iloc[:,0:-1], dtype = float)\n",
"model = sm.OLS(data.iloc[:,-1], x_list).fit()\n",
"model.summary()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"X = np.append(arr = np.ones((969,1)).astype(int), values = data, axis=1)\n",
"x_list = np.array(data.iloc[:,[0,1,2,3,5,6]], dtype = float)\n",
"model = sm.OLS(data.iloc[:,-1], x_list).fit()\n",
"model.summary()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"X = np.append(arr = np.ones((969,1)).astype(int), values = data, axis=1)\n",
"x_list = np.array(data.iloc[:,[0,2,3,5,6]], dtype = float)\n",
"model = sm.OLS(data.iloc[:,-1], x_list).fit()\n",
"model.summary()"
]
}
],
"metadata": {
Expand Down
74 changes: 73 additions & 1 deletion ML-Project/model.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,79 @@
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
"source": [
"#Train Test Split\n",
"X_train, X_test, y_train, y_test = train_test_split(data.iloc[:,0:-1], data.iloc[:,-1], test_size=0.2, random_state=0)\n",
"X_train"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Linear Regression\n",
"regressor = LinearRegression()\n",
"regressor"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"regressor.fit(X_train, y_train)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Linear Regression Predict\n",
"y_pred = regressor.predict(X_test)\n",
"y_pred"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#backward elimination with statsmodels\n",
"X = np.append(arr = np.ones((969,1)).astype(int), values = data, axis=1)\n",
"x_list = np.array(data.iloc[:,0:-1], dtype = float)\n",
"model = sm.OLS(data.iloc[:,-1], x_list).fit()\n",
"model.summary()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"X = np.append(arr = np.ones((969,1)).astype(int), values = data, axis=1)\n",
"x_list = np.array(data.iloc[:,[0,1,2,3,5,6]], dtype = float)\n",
"model = sm.OLS(data.iloc[:,-1], x_list).fit()\n",
"model.summary()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"X = np.append(arr = np.ones((969,1)).astype(int), values = data, axis=1)\n",
"x_list = np.array(data.iloc[:,[0,2,3,5,6]], dtype = float)\n",
"model = sm.OLS(data.iloc[:,-1], x_list).fit()\n",
"model.summary()"
]
}
],
"metadata": {
Expand Down
7 changes: 4 additions & 3 deletions readme.MD
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,19 @@

****

- [YouTube Channel](https://www.youtube.com/channel/UCqaZGIkvE8IrgyCdnTAF8Hw)
- [YouTube Channel](https://www.youtube.com/SelmanBaskaya)
- [Tanıtım | Kanal İçeriği | Machine Learning & Web Development Projesi #0](https://www.youtube.com/watch?v=BkprXbS6tA4)
- [Veri Tipleri, Kolon ve Encoding İşlemleri | Machine Learning & Web Development Projesi #1](https://www.youtube.com/watch?v=uba0iHWMsCY)
- [train_test_split() - Linear Regression - statsmodels | Machine Learning & Web Development Projesi #2](https://www.youtube.com/watch?v=IPCLX1E0mo4)

****

## ToDo List
### Machine Learning
- [x] Data labeling
- [x] Data preparation
- [ ] Training of the ML Model
- [ ] Optimization of ML Model
- [x] Training of the ML Model
- [x] Optimization of ML Model

### Web Application
- [ ] Install Flask
Expand Down

0 comments on commit 5f2b7c3

Please sign in to comment.