hilal35 commited on
Commit
6cf716b
β€’
1 Parent(s): 6fab9fb

Upload 2 files

Browse files
Files changed (2) hide show
  1. cars.ipynb +1452 -0
  2. cars.xls +0 -0
cars.ipynb ADDED
@@ -0,0 +1,1452 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "nbformat": 4,
3
+ "nbformat_minor": 0,
4
+ "metadata": {
5
+ "colab": {
6
+ "provenance": []
7
+ },
8
+ "kernelspec": {
9
+ "name": "python3",
10
+ "display_name": "Python 3"
11
+ },
12
+ "language_info": {
13
+ "name": "python"
14
+ }
15
+ },
16
+ "cells": [
17
+ {
18
+ "cell_type": "code",
19
+ "execution_count": 6,
20
+ "metadata": {
21
+ "id": "RdGj5r4ilCXW"
22
+ },
23
+ "outputs": [],
24
+ "source": [
25
+ "import pandas as pd\n",
26
+ "from sklearn.model_selection import train_test_split\n",
27
+ "from sklearn.linear_model import LinearRegression\n",
28
+ "from sklearn.metrics import r2_score,mean_squared_error\n",
29
+ "from sklearn.compose import ColumnTransformer\n",
30
+ "from sklearn.preprocessing import OneHotEncoder, StandardScaler\n",
31
+ "from sklearn.pipeline import Pipeline"
32
+ ]
33
+ },
34
+ {
35
+ "cell_type": "markdown",
36
+ "source": [
37
+ "import pandas as pd = Verileri tablolama ve ân işleme aşamalarında kullanıldı.from sklearn.model_selection import train_test_split: Ana veri setini eğitim ve test verilerine ayırmak için kullanıldı.\n",
38
+ "from sklearn.linear_model import LinearRegression : Doğrusal regresyon\n",
39
+ "from sklearn.metrics import r2_score,mean_squared_error : modelimizin performansını âlçmek için\n",
40
+ "from sklearn.compose import ColumnTransformer :Sütun dânüşüm işlemleri\n",
41
+ "from sklearn.preprocessing import OneHotEncoder, StandardScaler : kategori - sayısal dânüşüm ve âlçeklendirme\n",
42
+ "from sklearn.pipeline import Pipeline : Veri işleme hattı"
43
+ ],
44
+ "metadata": {
45
+ "id": "xOSP5tvYlhT8"
46
+ }
47
+ },
48
+ {
49
+ "cell_type": "code",
50
+ "source": [
51
+ "pip install xldr"
52
+ ],
53
+ "metadata": {
54
+ "colab": {
55
+ "base_uri": "https://localhost:8080/"
56
+ },
57
+ "collapsed": true,
58
+ "id": "RB7HDScwl5fB",
59
+ "outputId": "33075e92-e29d-4ad6-a849-474362666f11"
60
+ },
61
+ "execution_count": 7,
62
+ "outputs": [
63
+ {
64
+ "output_type": "stream",
65
+ "name": "stdout",
66
+ "text": [
67
+ "\u001b[31mERROR: Could not find a version that satisfies the requirement xldr (from versions: none)\u001b[0m\u001b[31m\n",
68
+ "\u001b[0m\u001b[31mERROR: No matching distribution found for xldr\u001b[0m\u001b[31m\n",
69
+ "\u001b[0m"
70
+ ]
71
+ }
72
+ ]
73
+ },
74
+ {
75
+ "cell_type": "markdown",
76
+ "source": [
77
+ "Proje excel dosyası olduğu için"
78
+ ],
79
+ "metadata": {
80
+ "id": "kj4-OtBBmFuG"
81
+ }
82
+ },
83
+ {
84
+ "cell_type": "code",
85
+ "source": [
86
+ "df=pd.read_excel('cars.xls')\n",
87
+ "df"
88
+ ],
89
+ "metadata": {
90
+ "colab": {
91
+ "base_uri": "https://localhost:8080/",
92
+ "height": 423
93
+ },
94
+ "id": "95ASq-kSnjIB",
95
+ "outputId": "3a194963-1a64-4919-c089-3611fd6402de"
96
+ },
97
+ "execution_count": 9,
98
+ "outputs": [
99
+ {
100
+ "output_type": "execute_result",
101
+ "data": {
102
+ "text/plain": [
103
+ " Price Mileage Make Model Trim Type Cylinder \\\n",
104
+ "0 17314.103129 8221 Buick Century Sedan 4D Sedan 6 \n",
105
+ "1 17542.036083 9135 Buick Century Sedan 4D Sedan 6 \n",
106
+ "2 16218.847862 13196 Buick Century Sedan 4D Sedan 6 \n",
107
+ "3 16336.913140 16342 Buick Century Sedan 4D Sedan 6 \n",
108
+ "4 16339.170324 19832 Buick Century Sedan 4D Sedan 6 \n",
109
+ ".. ... ... ... ... ... ... ... \n",
110
+ "799 16507.070267 16229 Saturn L Series L300 Sedan 4D Sedan 6 \n",
111
+ "800 16175.957604 19095 Saturn L Series L300 Sedan 4D Sedan 6 \n",
112
+ "801 15731.132897 20484 Saturn L Series L300 Sedan 4D Sedan 6 \n",
113
+ "802 15118.893228 25979 Saturn L Series L300 Sedan 4D Sedan 6 \n",
114
+ "803 13585.636802 35662 Saturn L Series L300 Sedan 4D Sedan 6 \n",
115
+ "\n",
116
+ " Liter Doors Cruise Sound Leather \n",
117
+ "0 3.1 4 1 1 1 \n",
118
+ "1 3.1 4 1 1 0 \n",
119
+ "2 3.1 4 1 1 0 \n",
120
+ "3 3.1 4 1 0 0 \n",
121
+ "4 3.1 4 1 0 1 \n",
122
+ ".. ... ... ... ... ... \n",
123
+ "799 3.0 4 1 0 0 \n",
124
+ "800 3.0 4 1 1 0 \n",
125
+ "801 3.0 4 1 1 0 \n",
126
+ "802 3.0 4 1 1 0 \n",
127
+ "803 3.0 4 1 0 0 \n",
128
+ "\n",
129
+ "[804 rows x 12 columns]"
130
+ ],
131
+ "text/html": [
132
+ "\n",
133
+ " <div id=\"df-3cc9f608-874f-44c8-9e7f-2a19395206c5\" class=\"colab-df-container\">\n",
134
+ " <div>\n",
135
+ "<style scoped>\n",
136
+ " .dataframe tbody tr th:only-of-type {\n",
137
+ " vertical-align: middle;\n",
138
+ " }\n",
139
+ "\n",
140
+ " .dataframe tbody tr th {\n",
141
+ " vertical-align: top;\n",
142
+ " }\n",
143
+ "\n",
144
+ " .dataframe thead th {\n",
145
+ " text-align: right;\n",
146
+ " }\n",
147
+ "</style>\n",
148
+ "<table border=\"1\" class=\"dataframe\">\n",
149
+ " <thead>\n",
150
+ " <tr style=\"text-align: right;\">\n",
151
+ " <th></th>\n",
152
+ " <th>Price</th>\n",
153
+ " <th>Mileage</th>\n",
154
+ " <th>Make</th>\n",
155
+ " <th>Model</th>\n",
156
+ " <th>Trim</th>\n",
157
+ " <th>Type</th>\n",
158
+ " <th>Cylinder</th>\n",
159
+ " <th>Liter</th>\n",
160
+ " <th>Doors</th>\n",
161
+ " <th>Cruise</th>\n",
162
+ " <th>Sound</th>\n",
163
+ " <th>Leather</th>\n",
164
+ " </tr>\n",
165
+ " </thead>\n",
166
+ " <tbody>\n",
167
+ " <tr>\n",
168
+ " <th>0</th>\n",
169
+ " <td>17314.103129</td>\n",
170
+ " <td>8221</td>\n",
171
+ " <td>Buick</td>\n",
172
+ " <td>Century</td>\n",
173
+ " <td>Sedan 4D</td>\n",
174
+ " <td>Sedan</td>\n",
175
+ " <td>6</td>\n",
176
+ " <td>3.1</td>\n",
177
+ " <td>4</td>\n",
178
+ " <td>1</td>\n",
179
+ " <td>1</td>\n",
180
+ " <td>1</td>\n",
181
+ " </tr>\n",
182
+ " <tr>\n",
183
+ " <th>1</th>\n",
184
+ " <td>17542.036083</td>\n",
185
+ " <td>9135</td>\n",
186
+ " <td>Buick</td>\n",
187
+ " <td>Century</td>\n",
188
+ " <td>Sedan 4D</td>\n",
189
+ " <td>Sedan</td>\n",
190
+ " <td>6</td>\n",
191
+ " <td>3.1</td>\n",
192
+ " <td>4</td>\n",
193
+ " <td>1</td>\n",
194
+ " <td>1</td>\n",
195
+ " <td>0</td>\n",
196
+ " </tr>\n",
197
+ " <tr>\n",
198
+ " <th>2</th>\n",
199
+ " <td>16218.847862</td>\n",
200
+ " <td>13196</td>\n",
201
+ " <td>Buick</td>\n",
202
+ " <td>Century</td>\n",
203
+ " <td>Sedan 4D</td>\n",
204
+ " <td>Sedan</td>\n",
205
+ " <td>6</td>\n",
206
+ " <td>3.1</td>\n",
207
+ " <td>4</td>\n",
208
+ " <td>1</td>\n",
209
+ " <td>1</td>\n",
210
+ " <td>0</td>\n",
211
+ " </tr>\n",
212
+ " <tr>\n",
213
+ " <th>3</th>\n",
214
+ " <td>16336.913140</td>\n",
215
+ " <td>16342</td>\n",
216
+ " <td>Buick</td>\n",
217
+ " <td>Century</td>\n",
218
+ " <td>Sedan 4D</td>\n",
219
+ " <td>Sedan</td>\n",
220
+ " <td>6</td>\n",
221
+ " <td>3.1</td>\n",
222
+ " <td>4</td>\n",
223
+ " <td>1</td>\n",
224
+ " <td>0</td>\n",
225
+ " <td>0</td>\n",
226
+ " </tr>\n",
227
+ " <tr>\n",
228
+ " <th>4</th>\n",
229
+ " <td>16339.170324</td>\n",
230
+ " <td>19832</td>\n",
231
+ " <td>Buick</td>\n",
232
+ " <td>Century</td>\n",
233
+ " <td>Sedan 4D</td>\n",
234
+ " <td>Sedan</td>\n",
235
+ " <td>6</td>\n",
236
+ " <td>3.1</td>\n",
237
+ " <td>4</td>\n",
238
+ " <td>1</td>\n",
239
+ " <td>0</td>\n",
240
+ " <td>1</td>\n",
241
+ " </tr>\n",
242
+ " <tr>\n",
243
+ " <th>...</th>\n",
244
+ " <td>...</td>\n",
245
+ " <td>...</td>\n",
246
+ " <td>...</td>\n",
247
+ " <td>...</td>\n",
248
+ " <td>...</td>\n",
249
+ " <td>...</td>\n",
250
+ " <td>...</td>\n",
251
+ " <td>...</td>\n",
252
+ " <td>...</td>\n",
253
+ " <td>...</td>\n",
254
+ " <td>...</td>\n",
255
+ " <td>...</td>\n",
256
+ " </tr>\n",
257
+ " <tr>\n",
258
+ " <th>799</th>\n",
259
+ " <td>16507.070267</td>\n",
260
+ " <td>16229</td>\n",
261
+ " <td>Saturn</td>\n",
262
+ " <td>L Series</td>\n",
263
+ " <td>L300 Sedan 4D</td>\n",
264
+ " <td>Sedan</td>\n",
265
+ " <td>6</td>\n",
266
+ " <td>3.0</td>\n",
267
+ " <td>4</td>\n",
268
+ " <td>1</td>\n",
269
+ " <td>0</td>\n",
270
+ " <td>0</td>\n",
271
+ " </tr>\n",
272
+ " <tr>\n",
273
+ " <th>800</th>\n",
274
+ " <td>16175.957604</td>\n",
275
+ " <td>19095</td>\n",
276
+ " <td>Saturn</td>\n",
277
+ " <td>L Series</td>\n",
278
+ " <td>L300 Sedan 4D</td>\n",
279
+ " <td>Sedan</td>\n",
280
+ " <td>6</td>\n",
281
+ " <td>3.0</td>\n",
282
+ " <td>4</td>\n",
283
+ " <td>1</td>\n",
284
+ " <td>1</td>\n",
285
+ " <td>0</td>\n",
286
+ " </tr>\n",
287
+ " <tr>\n",
288
+ " <th>801</th>\n",
289
+ " <td>15731.132897</td>\n",
290
+ " <td>20484</td>\n",
291
+ " <td>Saturn</td>\n",
292
+ " <td>L Series</td>\n",
293
+ " <td>L300 Sedan 4D</td>\n",
294
+ " <td>Sedan</td>\n",
295
+ " <td>6</td>\n",
296
+ " <td>3.0</td>\n",
297
+ " <td>4</td>\n",
298
+ " <td>1</td>\n",
299
+ " <td>1</td>\n",
300
+ " <td>0</td>\n",
301
+ " </tr>\n",
302
+ " <tr>\n",
303
+ " <th>802</th>\n",
304
+ " <td>15118.893228</td>\n",
305
+ " <td>25979</td>\n",
306
+ " <td>Saturn</td>\n",
307
+ " <td>L Series</td>\n",
308
+ " <td>L300 Sedan 4D</td>\n",
309
+ " <td>Sedan</td>\n",
310
+ " <td>6</td>\n",
311
+ " <td>3.0</td>\n",
312
+ " <td>4</td>\n",
313
+ " <td>1</td>\n",
314
+ " <td>1</td>\n",
315
+ " <td>0</td>\n",
316
+ " </tr>\n",
317
+ " <tr>\n",
318
+ " <th>803</th>\n",
319
+ " <td>13585.636802</td>\n",
320
+ " <td>35662</td>\n",
321
+ " <td>Saturn</td>\n",
322
+ " <td>L Series</td>\n",
323
+ " <td>L300 Sedan 4D</td>\n",
324
+ " <td>Sedan</td>\n",
325
+ " <td>6</td>\n",
326
+ " <td>3.0</td>\n",
327
+ " <td>4</td>\n",
328
+ " <td>1</td>\n",
329
+ " <td>0</td>\n",
330
+ " <td>0</td>\n",
331
+ " </tr>\n",
332
+ " </tbody>\n",
333
+ "</table>\n",
334
+ "<p>804 rows Γ— 12 columns</p>\n",
335
+ "</div>\n",
336
+ " <div class=\"colab-df-buttons\">\n",
337
+ "\n",
338
+ " <div class=\"colab-df-container\">\n",
339
+ " <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-3cc9f608-874f-44c8-9e7f-2a19395206c5')\"\n",
340
+ " title=\"Convert this dataframe to an interactive table.\"\n",
341
+ " style=\"display:none;\">\n",
342
+ "\n",
343
+ " <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
344
+ " <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
345
+ " </svg>\n",
346
+ " </button>\n",
347
+ "\n",
348
+ " <style>\n",
349
+ " .colab-df-container {\n",
350
+ " display:flex;\n",
351
+ " gap: 12px;\n",
352
+ " }\n",
353
+ "\n",
354
+ " .colab-df-convert {\n",
355
+ " background-color: #E8F0FE;\n",
356
+ " border: none;\n",
357
+ " border-radius: 50%;\n",
358
+ " cursor: pointer;\n",
359
+ " display: none;\n",
360
+ " fill: #1967D2;\n",
361
+ " height: 32px;\n",
362
+ " padding: 0 0 0 0;\n",
363
+ " width: 32px;\n",
364
+ " }\n",
365
+ "\n",
366
+ " .colab-df-convert:hover {\n",
367
+ " background-color: #E2EBFA;\n",
368
+ " box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
369
+ " fill: #174EA6;\n",
370
+ " }\n",
371
+ "\n",
372
+ " .colab-df-buttons div {\n",
373
+ " margin-bottom: 4px;\n",
374
+ " }\n",
375
+ "\n",
376
+ " [theme=dark] .colab-df-convert {\n",
377
+ " background-color: #3B4455;\n",
378
+ " fill: #D2E3FC;\n",
379
+ " }\n",
380
+ "\n",
381
+ " [theme=dark] .colab-df-convert:hover {\n",
382
+ " background-color: #434B5C;\n",
383
+ " box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
384
+ " filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
385
+ " fill: #FFFFFF;\n",
386
+ " }\n",
387
+ " </style>\n",
388
+ "\n",
389
+ " <script>\n",
390
+ " const buttonEl =\n",
391
+ " document.querySelector('#df-3cc9f608-874f-44c8-9e7f-2a19395206c5 button.colab-df-convert');\n",
392
+ " buttonEl.style.display =\n",
393
+ " google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
394
+ "\n",
395
+ " async function convertToInteractive(key) {\n",
396
+ " const element = document.querySelector('#df-3cc9f608-874f-44c8-9e7f-2a19395206c5');\n",
397
+ " const dataTable =\n",
398
+ " await google.colab.kernel.invokeFunction('convertToInteractive',\n",
399
+ " [key], {});\n",
400
+ " if (!dataTable) return;\n",
401
+ "\n",
402
+ " const docLinkHtml = 'Like what you see? Visit the ' +\n",
403
+ " '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
404
+ " + ' to learn more about interactive tables.';\n",
405
+ " element.innerHTML = '';\n",
406
+ " dataTable['output_type'] = 'display_data';\n",
407
+ " await google.colab.output.renderOutput(dataTable, element);\n",
408
+ " const docLink = document.createElement('div');\n",
409
+ " docLink.innerHTML = docLinkHtml;\n",
410
+ " element.appendChild(docLink);\n",
411
+ " }\n",
412
+ " </script>\n",
413
+ " </div>\n",
414
+ "\n",
415
+ "\n",
416
+ "<div id=\"df-6299111d-1cc8-4e91-adc7-252cf17863c3\">\n",
417
+ " <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-6299111d-1cc8-4e91-adc7-252cf17863c3')\"\n",
418
+ " title=\"Suggest charts\"\n",
419
+ " style=\"display:none;\">\n",
420
+ "\n",
421
+ "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
422
+ " width=\"24px\">\n",
423
+ " <g>\n",
424
+ " <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n",
425
+ " </g>\n",
426
+ "</svg>\n",
427
+ " </button>\n",
428
+ "\n",
429
+ "<style>\n",
430
+ " .colab-df-quickchart {\n",
431
+ " --bg-color: #E8F0FE;\n",
432
+ " --fill-color: #1967D2;\n",
433
+ " --hover-bg-color: #E2EBFA;\n",
434
+ " --hover-fill-color: #174EA6;\n",
435
+ " --disabled-fill-color: #AAA;\n",
436
+ " --disabled-bg-color: #DDD;\n",
437
+ " }\n",
438
+ "\n",
439
+ " [theme=dark] .colab-df-quickchart {\n",
440
+ " --bg-color: #3B4455;\n",
441
+ " --fill-color: #D2E3FC;\n",
442
+ " --hover-bg-color: #434B5C;\n",
443
+ " --hover-fill-color: #FFFFFF;\n",
444
+ " --disabled-bg-color: #3B4455;\n",
445
+ " --disabled-fill-color: #666;\n",
446
+ " }\n",
447
+ "\n",
448
+ " .colab-df-quickchart {\n",
449
+ " background-color: var(--bg-color);\n",
450
+ " border: none;\n",
451
+ " border-radius: 50%;\n",
452
+ " cursor: pointer;\n",
453
+ " display: none;\n",
454
+ " fill: var(--fill-color);\n",
455
+ " height: 32px;\n",
456
+ " padding: 0;\n",
457
+ " width: 32px;\n",
458
+ " }\n",
459
+ "\n",
460
+ " .colab-df-quickchart:hover {\n",
461
+ " background-color: var(--hover-bg-color);\n",
462
+ " box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
463
+ " fill: var(--button-hover-fill-color);\n",
464
+ " }\n",
465
+ "\n",
466
+ " .colab-df-quickchart-complete:disabled,\n",
467
+ " .colab-df-quickchart-complete:disabled:hover {\n",
468
+ " background-color: var(--disabled-bg-color);\n",
469
+ " fill: var(--disabled-fill-color);\n",
470
+ " box-shadow: none;\n",
471
+ " }\n",
472
+ "\n",
473
+ " .colab-df-spinner {\n",
474
+ " border: 2px solid var(--fill-color);\n",
475
+ " border-color: transparent;\n",
476
+ " border-bottom-color: var(--fill-color);\n",
477
+ " animation:\n",
478
+ " spin 1s steps(1) infinite;\n",
479
+ " }\n",
480
+ "\n",
481
+ " @keyframes spin {\n",
482
+ " 0% {\n",
483
+ " border-color: transparent;\n",
484
+ " border-bottom-color: var(--fill-color);\n",
485
+ " border-left-color: var(--fill-color);\n",
486
+ " }\n",
487
+ " 20% {\n",
488
+ " border-color: transparent;\n",
489
+ " border-left-color: var(--fill-color);\n",
490
+ " border-top-color: var(--fill-color);\n",
491
+ " }\n",
492
+ " 30% {\n",
493
+ " border-color: transparent;\n",
494
+ " border-left-color: var(--fill-color);\n",
495
+ " border-top-color: var(--fill-color);\n",
496
+ " border-right-color: var(--fill-color);\n",
497
+ " }\n",
498
+ " 40% {\n",
499
+ " border-color: transparent;\n",
500
+ " border-right-color: var(--fill-color);\n",
501
+ " border-top-color: var(--fill-color);\n",
502
+ " }\n",
503
+ " 60% {\n",
504
+ " border-color: transparent;\n",
505
+ " border-right-color: var(--fill-color);\n",
506
+ " }\n",
507
+ " 80% {\n",
508
+ " border-color: transparent;\n",
509
+ " border-right-color: var(--fill-color);\n",
510
+ " border-bottom-color: var(--fill-color);\n",
511
+ " }\n",
512
+ " 90% {\n",
513
+ " border-color: transparent;\n",
514
+ " border-bottom-color: var(--fill-color);\n",
515
+ " }\n",
516
+ " }\n",
517
+ "</style>\n",
518
+ "\n",
519
+ " <script>\n",
520
+ " async function quickchart(key) {\n",
521
+ " const quickchartButtonEl =\n",
522
+ " document.querySelector('#' + key + ' button');\n",
523
+ " quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n",
524
+ " quickchartButtonEl.classList.add('colab-df-spinner');\n",
525
+ " try {\n",
526
+ " const charts = await google.colab.kernel.invokeFunction(\n",
527
+ " 'suggestCharts', [key], {});\n",
528
+ " } catch (error) {\n",
529
+ " console.error('Error during call to suggestCharts:', error);\n",
530
+ " }\n",
531
+ " quickchartButtonEl.classList.remove('colab-df-spinner');\n",
532
+ " quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n",
533
+ " }\n",
534
+ " (() => {\n",
535
+ " let quickchartButtonEl =\n",
536
+ " document.querySelector('#df-6299111d-1cc8-4e91-adc7-252cf17863c3 button');\n",
537
+ " quickchartButtonEl.style.display =\n",
538
+ " google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
539
+ " })();\n",
540
+ " </script>\n",
541
+ "</div>\n",
542
+ "\n",
543
+ " <div id=\"id_d344df63-81a5-4d4a-b319-bdbbb7b95641\">\n",
544
+ " <style>\n",
545
+ " .colab-df-generate {\n",
546
+ " background-color: #E8F0FE;\n",
547
+ " border: none;\n",
548
+ " border-radius: 50%;\n",
549
+ " cursor: pointer;\n",
550
+ " display: none;\n",
551
+ " fill: #1967D2;\n",
552
+ " height: 32px;\n",
553
+ " padding: 0 0 0 0;\n",
554
+ " width: 32px;\n",
555
+ " }\n",
556
+ "\n",
557
+ " .colab-df-generate:hover {\n",
558
+ " background-color: #E2EBFA;\n",
559
+ " box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
560
+ " fill: #174EA6;\n",
561
+ " }\n",
562
+ "\n",
563
+ " [theme=dark] .colab-df-generate {\n",
564
+ " background-color: #3B4455;\n",
565
+ " fill: #D2E3FC;\n",
566
+ " }\n",
567
+ "\n",
568
+ " [theme=dark] .colab-df-generate:hover {\n",
569
+ " background-color: #434B5C;\n",
570
+ " box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
571
+ " filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
572
+ " fill: #FFFFFF;\n",
573
+ " }\n",
574
+ " </style>\n",
575
+ " <button class=\"colab-df-generate\" onclick=\"generateWithVariable('df')\"\n",
576
+ " title=\"Generate code using this dataframe.\"\n",
577
+ " style=\"display:none;\">\n",
578
+ "\n",
579
+ " <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
580
+ " width=\"24px\">\n",
581
+ " <path d=\"M7,19H8.4L18.45,9,17,7.55,7,17.6ZM5,21V16.75L18.45,3.32a2,2,0,0,1,2.83,0l1.4,1.43a1.91,1.91,0,0,1,.58,1.4,1.91,1.91,0,0,1-.58,1.4L9.25,21ZM18.45,9,17,7.55Zm-12,3A5.31,5.31,0,0,0,4.9,8.1,5.31,5.31,0,0,0,1,6.5,5.31,5.31,0,0,0,4.9,4.9,5.31,5.31,0,0,0,6.5,1,5.31,5.31,0,0,0,8.1,4.9,5.31,5.31,0,0,0,12,6.5,5.46,5.46,0,0,0,6.5,12Z\"/>\n",
582
+ " </svg>\n",
583
+ " </button>\n",
584
+ " <script>\n",
585
+ " (() => {\n",
586
+ " const buttonEl =\n",
587
+ " document.querySelector('#id_d344df63-81a5-4d4a-b319-bdbbb7b95641 button.colab-df-generate');\n",
588
+ " buttonEl.style.display =\n",
589
+ " google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
590
+ "\n",
591
+ " buttonEl.onclick = () => {\n",
592
+ " google.colab.notebook.generateWithVariable('df');\n",
593
+ " }\n",
594
+ " })();\n",
595
+ " </script>\n",
596
+ " </div>\n",
597
+ "\n",
598
+ " </div>\n",
599
+ " </div>\n"
600
+ ],
601
+ "application/vnd.google.colaboratory.intrinsic+json": {
602
+ "type": "dataframe",
603
+ "variable_name": "df",
604
+ "summary": "{\n \"name\": \"df\",\n \"rows\": 804,\n \"fields\": [\n {\n \"column\": \"Price\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 9884.852800898008,\n \"min\": 8638.930895260657,\n \"max\": 70755.46671654288,\n \"num_unique_values\": 798,\n \"samples\": [\n 28432.824212532152,\n 24852.495280683135,\n 22661.048485078372\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Mileage\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 8196,\n \"min\": 266,\n \"max\": 50387,\n \"num_unique_values\": 791,\n \"samples\": [\n 21386,\n 29649,\n 29368\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Make\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 6,\n \"samples\": [\n \"Buick\",\n \"Cadillac\",\n \"Saturn\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Model\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 32,\n \"samples\": [\n \"9-2X AWD\",\n \"Impala\",\n \"Vibe\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Trim\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 47,\n \"samples\": [\n \"GXP Sedan 4D\",\n \"Aero Sedan 4D\",\n \"SS Coupe 2D\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Type\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"Convertible\",\n \"Wagon\",\n \"Hatchback\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Cylinder\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 1,\n \"min\": 4,\n \"max\": 8,\n \"num_unique_values\": 3,\n \"samples\": [\n 6,\n 8,\n 4\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Liter\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 1.1055619585094583,\n \"min\": 1.6,\n \"max\": 6.0,\n \"num_unique_values\": 16,\n \"samples\": [\n 3.1,\n 3.6,\n 4.6\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Doors\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0,\n \"min\": 2,\n \"max\": 4,\n \"num_unique_values\": 2,\n \"samples\": [\n 2,\n 4\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Cruise\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0,\n \"min\": 0,\n \"max\": 1,\n \"num_unique_values\": 2,\n \"samples\": [\n 0,\n 1\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Sound\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0,\n \"min\": 0,\n \"max\": 1,\n \"num_unique_values\": 2,\n \"samples\": [\n 0,\n 1\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Leather\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0,\n \"min\": 0,\n \"max\": 1,\n \"num_unique_values\": 2,\n \"samples\": [\n 0,\n 1\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"
605
+ }
606
+ },
607
+ "metadata": {},
608
+ "execution_count": 9
609
+ }
610
+ ]
611
+ },
612
+ {
613
+ "cell_type": "markdown",
614
+ "source": [
615
+ "Proje yΓΌklendi."
616
+ ],
617
+ "metadata": {
618
+ "id": "RIYLZX0KoufQ"
619
+ }
620
+ },
621
+ {
622
+ "cell_type": "code",
623
+ "source": [
624
+ "df.info()"
625
+ ],
626
+ "metadata": {
627
+ "colab": {
628
+ "base_uri": "https://localhost:8080/"
629
+ },
630
+ "id": "V3ONZtVtovzg",
631
+ "outputId": "ba9d149d-dd08-4d15-a149-cf948fe3153a"
632
+ },
633
+ "execution_count": 10,
634
+ "outputs": [
635
+ {
636
+ "output_type": "stream",
637
+ "name": "stdout",
638
+ "text": [
639
+ "<class 'pandas.core.frame.DataFrame'>\n",
640
+ "RangeIndex: 804 entries, 0 to 803\n",
641
+ "Data columns (total 12 columns):\n",
642
+ " # Column Non-Null Count Dtype \n",
643
+ "--- ------ -------------- ----- \n",
644
+ " 0 Price 804 non-null float64\n",
645
+ " 1 Mileage 804 non-null int64 \n",
646
+ " 2 Make 804 non-null object \n",
647
+ " 3 Model 804 non-null object \n",
648
+ " 4 Trim 804 non-null object \n",
649
+ " 5 Type 804 non-null object \n",
650
+ " 6 Cylinder 804 non-null int64 \n",
651
+ " 7 Liter 804 non-null float64\n",
652
+ " 8 Doors 804 non-null int64 \n",
653
+ " 9 Cruise 804 non-null int64 \n",
654
+ " 10 Sound 804 non-null int64 \n",
655
+ " 11 Leather 804 non-null int64 \n",
656
+ "dtypes: float64(2), int64(6), object(4)\n",
657
+ "memory usage: 75.5+ KB\n"
658
+ ]
659
+ }
660
+ ]
661
+ },
662
+ {
663
+ "cell_type": "markdown",
664
+ "source": [
665
+ "Proje hakkΔ±nda bilgi edinildi."
666
+ ],
667
+ "metadata": {
668
+ "id": "KMMxJh4epowO"
669
+ }
670
+ },
671
+ {
672
+ "cell_type": "code",
673
+ "source": [
674
+ "df.head(5)\n"
675
+ ],
676
+ "metadata": {
677
+ "colab": {
678
+ "base_uri": "https://localhost:8080/",
679
+ "height": 206
680
+ },
681
+ "id": "4KR2FxY6qKgk",
682
+ "outputId": "1112a6b1-a1ea-49b7-e8b1-04c2f7e69350"
683
+ },
684
+ "execution_count": 11,
685
+ "outputs": [
686
+ {
687
+ "output_type": "execute_result",
688
+ "data": {
689
+ "text/plain": [
690
+ " Price Mileage Make Model Trim Type Cylinder Liter \\\n",
691
+ "0 17314.103129 8221 Buick Century Sedan 4D Sedan 6 3.1 \n",
692
+ "1 17542.036083 9135 Buick Century Sedan 4D Sedan 6 3.1 \n",
693
+ "2 16218.847862 13196 Buick Century Sedan 4D Sedan 6 3.1 \n",
694
+ "3 16336.913140 16342 Buick Century Sedan 4D Sedan 6 3.1 \n",
695
+ "4 16339.170324 19832 Buick Century Sedan 4D Sedan 6 3.1 \n",
696
+ "\n",
697
+ " Doors Cruise Sound Leather \n",
698
+ "0 4 1 1 1 \n",
699
+ "1 4 1 1 0 \n",
700
+ "2 4 1 1 0 \n",
701
+ "3 4 1 0 0 \n",
702
+ "4 4 1 0 1 "
703
+ ],
704
+ "text/html": [
705
+ "\n",
706
+ " <div id=\"df-651124a1-30aa-4000-a85f-e210b7ebab84\" class=\"colab-df-container\">\n",
707
+ " <div>\n",
708
+ "<style scoped>\n",
709
+ " .dataframe tbody tr th:only-of-type {\n",
710
+ " vertical-align: middle;\n",
711
+ " }\n",
712
+ "\n",
713
+ " .dataframe tbody tr th {\n",
714
+ " vertical-align: top;\n",
715
+ " }\n",
716
+ "\n",
717
+ " .dataframe thead th {\n",
718
+ " text-align: right;\n",
719
+ " }\n",
720
+ "</style>\n",
721
+ "<table border=\"1\" class=\"dataframe\">\n",
722
+ " <thead>\n",
723
+ " <tr style=\"text-align: right;\">\n",
724
+ " <th></th>\n",
725
+ " <th>Price</th>\n",
726
+ " <th>Mileage</th>\n",
727
+ " <th>Make</th>\n",
728
+ " <th>Model</th>\n",
729
+ " <th>Trim</th>\n",
730
+ " <th>Type</th>\n",
731
+ " <th>Cylinder</th>\n",
732
+ " <th>Liter</th>\n",
733
+ " <th>Doors</th>\n",
734
+ " <th>Cruise</th>\n",
735
+ " <th>Sound</th>\n",
736
+ " <th>Leather</th>\n",
737
+ " </tr>\n",
738
+ " </thead>\n",
739
+ " <tbody>\n",
740
+ " <tr>\n",
741
+ " <th>0</th>\n",
742
+ " <td>17314.103129</td>\n",
743
+ " <td>8221</td>\n",
744
+ " <td>Buick</td>\n",
745
+ " <td>Century</td>\n",
746
+ " <td>Sedan 4D</td>\n",
747
+ " <td>Sedan</td>\n",
748
+ " <td>6</td>\n",
749
+ " <td>3.1</td>\n",
750
+ " <td>4</td>\n",
751
+ " <td>1</td>\n",
752
+ " <td>1</td>\n",
753
+ " <td>1</td>\n",
754
+ " </tr>\n",
755
+ " <tr>\n",
756
+ " <th>1</th>\n",
757
+ " <td>17542.036083</td>\n",
758
+ " <td>9135</td>\n",
759
+ " <td>Buick</td>\n",
760
+ " <td>Century</td>\n",
761
+ " <td>Sedan 4D</td>\n",
762
+ " <td>Sedan</td>\n",
763
+ " <td>6</td>\n",
764
+ " <td>3.1</td>\n",
765
+ " <td>4</td>\n",
766
+ " <td>1</td>\n",
767
+ " <td>1</td>\n",
768
+ " <td>0</td>\n",
769
+ " </tr>\n",
770
+ " <tr>\n",
771
+ " <th>2</th>\n",
772
+ " <td>16218.847862</td>\n",
773
+ " <td>13196</td>\n",
774
+ " <td>Buick</td>\n",
775
+ " <td>Century</td>\n",
776
+ " <td>Sedan 4D</td>\n",
777
+ " <td>Sedan</td>\n",
778
+ " <td>6</td>\n",
779
+ " <td>3.1</td>\n",
780
+ " <td>4</td>\n",
781
+ " <td>1</td>\n",
782
+ " <td>1</td>\n",
783
+ " <td>0</td>\n",
784
+ " </tr>\n",
785
+ " <tr>\n",
786
+ " <th>3</th>\n",
787
+ " <td>16336.913140</td>\n",
788
+ " <td>16342</td>\n",
789
+ " <td>Buick</td>\n",
790
+ " <td>Century</td>\n",
791
+ " <td>Sedan 4D</td>\n",
792
+ " <td>Sedan</td>\n",
793
+ " <td>6</td>\n",
794
+ " <td>3.1</td>\n",
795
+ " <td>4</td>\n",
796
+ " <td>1</td>\n",
797
+ " <td>0</td>\n",
798
+ " <td>0</td>\n",
799
+ " </tr>\n",
800
+ " <tr>\n",
801
+ " <th>4</th>\n",
802
+ " <td>16339.170324</td>\n",
803
+ " <td>19832</td>\n",
804
+ " <td>Buick</td>\n",
805
+ " <td>Century</td>\n",
806
+ " <td>Sedan 4D</td>\n",
807
+ " <td>Sedan</td>\n",
808
+ " <td>6</td>\n",
809
+ " <td>3.1</td>\n",
810
+ " <td>4</td>\n",
811
+ " <td>1</td>\n",
812
+ " <td>0</td>\n",
813
+ " <td>1</td>\n",
814
+ " </tr>\n",
815
+ " </tbody>\n",
816
+ "</table>\n",
817
+ "</div>\n",
818
+ " <div class=\"colab-df-buttons\">\n",
819
+ "\n",
820
+ " <div class=\"colab-df-container\">\n",
821
+ " <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-651124a1-30aa-4000-a85f-e210b7ebab84')\"\n",
822
+ " title=\"Convert this dataframe to an interactive table.\"\n",
823
+ " style=\"display:none;\">\n",
824
+ "\n",
825
+ " <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
826
+ " <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
827
+ " </svg>\n",
828
+ " </button>\n",
829
+ "\n",
830
+ " <style>\n",
831
+ " .colab-df-container {\n",
832
+ " display:flex;\n",
833
+ " gap: 12px;\n",
834
+ " }\n",
835
+ "\n",
836
+ " .colab-df-convert {\n",
837
+ " background-color: #E8F0FE;\n",
838
+ " border: none;\n",
839
+ " border-radius: 50%;\n",
840
+ " cursor: pointer;\n",
841
+ " display: none;\n",
842
+ " fill: #1967D2;\n",
843
+ " height: 32px;\n",
844
+ " padding: 0 0 0 0;\n",
845
+ " width: 32px;\n",
846
+ " }\n",
847
+ "\n",
848
+ " .colab-df-convert:hover {\n",
849
+ " background-color: #E2EBFA;\n",
850
+ " box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
851
+ " fill: #174EA6;\n",
852
+ " }\n",
853
+ "\n",
854
+ " .colab-df-buttons div {\n",
855
+ " margin-bottom: 4px;\n",
856
+ " }\n",
857
+ "\n",
858
+ " [theme=dark] .colab-df-convert {\n",
859
+ " background-color: #3B4455;\n",
860
+ " fill: #D2E3FC;\n",
861
+ " }\n",
862
+ "\n",
863
+ " [theme=dark] .colab-df-convert:hover {\n",
864
+ " background-color: #434B5C;\n",
865
+ " box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
866
+ " filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
867
+ " fill: #FFFFFF;\n",
868
+ " }\n",
869
+ " </style>\n",
870
+ "\n",
871
+ " <script>\n",
872
+ " const buttonEl =\n",
873
+ " document.querySelector('#df-651124a1-30aa-4000-a85f-e210b7ebab84 button.colab-df-convert');\n",
874
+ " buttonEl.style.display =\n",
875
+ " google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
876
+ "\n",
877
+ " async function convertToInteractive(key) {\n",
878
+ " const element = document.querySelector('#df-651124a1-30aa-4000-a85f-e210b7ebab84');\n",
879
+ " const dataTable =\n",
880
+ " await google.colab.kernel.invokeFunction('convertToInteractive',\n",
881
+ " [key], {});\n",
882
+ " if (!dataTable) return;\n",
883
+ "\n",
884
+ " const docLinkHtml = 'Like what you see? Visit the ' +\n",
885
+ " '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
886
+ " + ' to learn more about interactive tables.';\n",
887
+ " element.innerHTML = '';\n",
888
+ " dataTable['output_type'] = 'display_data';\n",
889
+ " await google.colab.output.renderOutput(dataTable, element);\n",
890
+ " const docLink = document.createElement('div');\n",
891
+ " docLink.innerHTML = docLinkHtml;\n",
892
+ " element.appendChild(docLink);\n",
893
+ " }\n",
894
+ " </script>\n",
895
+ " </div>\n",
896
+ "\n",
897
+ "\n",
898
+ "<div id=\"df-f84499d9-ca47-46ab-b03f-e1b46127dadb\">\n",
899
+ " <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-f84499d9-ca47-46ab-b03f-e1b46127dadb')\"\n",
900
+ " title=\"Suggest charts\"\n",
901
+ " style=\"display:none;\">\n",
902
+ "\n",
903
+ "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
904
+ " width=\"24px\">\n",
905
+ " <g>\n",
906
+ " <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n",
907
+ " </g>\n",
908
+ "</svg>\n",
909
+ " </button>\n",
910
+ "\n",
911
+ "<style>\n",
912
+ " .colab-df-quickchart {\n",
913
+ " --bg-color: #E8F0FE;\n",
914
+ " --fill-color: #1967D2;\n",
915
+ " --hover-bg-color: #E2EBFA;\n",
916
+ " --hover-fill-color: #174EA6;\n",
917
+ " --disabled-fill-color: #AAA;\n",
918
+ " --disabled-bg-color: #DDD;\n",
919
+ " }\n",
920
+ "\n",
921
+ " [theme=dark] .colab-df-quickchart {\n",
922
+ " --bg-color: #3B4455;\n",
923
+ " --fill-color: #D2E3FC;\n",
924
+ " --hover-bg-color: #434B5C;\n",
925
+ " --hover-fill-color: #FFFFFF;\n",
926
+ " --disabled-bg-color: #3B4455;\n",
927
+ " --disabled-fill-color: #666;\n",
928
+ " }\n",
929
+ "\n",
930
+ " .colab-df-quickchart {\n",
931
+ " background-color: var(--bg-color);\n",
932
+ " border: none;\n",
933
+ " border-radius: 50%;\n",
934
+ " cursor: pointer;\n",
935
+ " display: none;\n",
936
+ " fill: var(--fill-color);\n",
937
+ " height: 32px;\n",
938
+ " padding: 0;\n",
939
+ " width: 32px;\n",
940
+ " }\n",
941
+ "\n",
942
+ " .colab-df-quickchart:hover {\n",
943
+ " background-color: var(--hover-bg-color);\n",
944
+ " box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
945
+ " fill: var(--button-hover-fill-color);\n",
946
+ " }\n",
947
+ "\n",
948
+ " .colab-df-quickchart-complete:disabled,\n",
949
+ " .colab-df-quickchart-complete:disabled:hover {\n",
950
+ " background-color: var(--disabled-bg-color);\n",
951
+ " fill: var(--disabled-fill-color);\n",
952
+ " box-shadow: none;\n",
953
+ " }\n",
954
+ "\n",
955
+ " .colab-df-spinner {\n",
956
+ " border: 2px solid var(--fill-color);\n",
957
+ " border-color: transparent;\n",
958
+ " border-bottom-color: var(--fill-color);\n",
959
+ " animation:\n",
960
+ " spin 1s steps(1) infinite;\n",
961
+ " }\n",
962
+ "\n",
963
+ " @keyframes spin {\n",
964
+ " 0% {\n",
965
+ " border-color: transparent;\n",
966
+ " border-bottom-color: var(--fill-color);\n",
967
+ " border-left-color: var(--fill-color);\n",
968
+ " }\n",
969
+ " 20% {\n",
970
+ " border-color: transparent;\n",
971
+ " border-left-color: var(--fill-color);\n",
972
+ " border-top-color: var(--fill-color);\n",
973
+ " }\n",
974
+ " 30% {\n",
975
+ " border-color: transparent;\n",
976
+ " border-left-color: var(--fill-color);\n",
977
+ " border-top-color: var(--fill-color);\n",
978
+ " border-right-color: var(--fill-color);\n",
979
+ " }\n",
980
+ " 40% {\n",
981
+ " border-color: transparent;\n",
982
+ " border-right-color: var(--fill-color);\n",
983
+ " border-top-color: var(--fill-color);\n",
984
+ " }\n",
985
+ " 60% {\n",
986
+ " border-color: transparent;\n",
987
+ " border-right-color: var(--fill-color);\n",
988
+ " }\n",
989
+ " 80% {\n",
990
+ " border-color: transparent;\n",
991
+ " border-right-color: var(--fill-color);\n",
992
+ " border-bottom-color: var(--fill-color);\n",
993
+ " }\n",
994
+ " 90% {\n",
995
+ " border-color: transparent;\n",
996
+ " border-bottom-color: var(--fill-color);\n",
997
+ " }\n",
998
+ " }\n",
999
+ "</style>\n",
1000
+ "\n",
1001
+ " <script>\n",
1002
+ " async function quickchart(key) {\n",
1003
+ " const quickchartButtonEl =\n",
1004
+ " document.querySelector('#' + key + ' button');\n",
1005
+ " quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n",
1006
+ " quickchartButtonEl.classList.add('colab-df-spinner');\n",
1007
+ " try {\n",
1008
+ " const charts = await google.colab.kernel.invokeFunction(\n",
1009
+ " 'suggestCharts', [key], {});\n",
1010
+ " } catch (error) {\n",
1011
+ " console.error('Error during call to suggestCharts:', error);\n",
1012
+ " }\n",
1013
+ " quickchartButtonEl.classList.remove('colab-df-spinner');\n",
1014
+ " quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n",
1015
+ " }\n",
1016
+ " (() => {\n",
1017
+ " let quickchartButtonEl =\n",
1018
+ " document.querySelector('#df-f84499d9-ca47-46ab-b03f-e1b46127dadb button');\n",
1019
+ " quickchartButtonEl.style.display =\n",
1020
+ " google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
1021
+ " })();\n",
1022
+ " </script>\n",
1023
+ "</div>\n",
1024
+ "\n",
1025
+ " </div>\n",
1026
+ " </div>\n"
1027
+ ],
1028
+ "application/vnd.google.colaboratory.intrinsic+json": {
1029
+ "type": "dataframe",
1030
+ "variable_name": "df",
1031
+ "summary": "{\n \"name\": \"df\",\n \"rows\": 804,\n \"fields\": [\n {\n \"column\": \"Price\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 9884.852800898008,\n \"min\": 8638.930895260657,\n \"max\": 70755.46671654288,\n \"num_unique_values\": 798,\n \"samples\": [\n 28432.824212532152,\n 24852.495280683135,\n 22661.048485078372\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Mileage\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 8196,\n \"min\": 266,\n \"max\": 50387,\n \"num_unique_values\": 791,\n \"samples\": [\n 21386,\n 29649,\n 29368\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Make\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 6,\n \"samples\": [\n \"Buick\",\n \"Cadillac\",\n \"Saturn\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Model\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 32,\n \"samples\": [\n \"9-2X AWD\",\n \"Impala\",\n \"Vibe\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Trim\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 47,\n \"samples\": [\n \"GXP Sedan 4D\",\n \"Aero Sedan 4D\",\n \"SS Coupe 2D\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Type\",\n \"properties\": {\n \"dtype\": \"category\",\n \"num_unique_values\": 5,\n \"samples\": [\n \"Convertible\",\n \"Wagon\",\n \"Hatchback\"\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Cylinder\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 1,\n \"min\": 4,\n \"max\": 8,\n \"num_unique_values\": 3,\n \"samples\": [\n 6,\n 8,\n 4\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Liter\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 1.1055619585094583,\n \"min\": 1.6,\n \"max\": 6.0,\n \"num_unique_values\": 16,\n \"samples\": [\n 3.1,\n 3.6,\n 4.6\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Doors\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0,\n \"min\": 2,\n \"max\": 4,\n \"num_unique_values\": 2,\n \"samples\": [\n 2,\n 4\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Cruise\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0,\n \"min\": 0,\n \"max\": 1,\n \"num_unique_values\": 2,\n \"samples\": [\n 0,\n 1\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Sound\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0,\n \"min\": 0,\n \"max\": 1,\n \"num_unique_values\": 2,\n \"samples\": [\n 0,\n 1\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n },\n {\n \"column\": \"Leather\",\n \"properties\": {\n \"dtype\": \"number\",\n \"std\": 0,\n \"min\": 0,\n \"max\": 1,\n \"num_unique_values\": 2,\n \"samples\": [\n 0,\n 1\n ],\n \"semantic_type\": \"\",\n \"description\": \"\"\n }\n }\n ]\n}"
1032
+ }
1033
+ },
1034
+ "metadata": {},
1035
+ "execution_count": 11
1036
+ }
1037
+ ]
1038
+ },
1039
+ {
1040
+ "cell_type": "markdown",
1041
+ "source": [
1042
+ "Veri setinin ilk 5 satΔ±rΔ±nΔ± getirir ve verinin yapΔ±sΔ± hakkΔ±nda ΓΆn bilgi verir."
1043
+ ],
1044
+ "metadata": {
1045
+ "id": "0jgxLWZEqQi1"
1046
+ }
1047
+ },
1048
+ {
1049
+ "cell_type": "code",
1050
+ "source": [
1051
+ "df.shape"
1052
+ ],
1053
+ "metadata": {
1054
+ "colab": {
1055
+ "base_uri": "https://localhost:8080/"
1056
+ },
1057
+ "id": "-SjR6JBUqVQC",
1058
+ "outputId": "c19b8e18-355d-4f69-a1af-3e939fa981a6"
1059
+ },
1060
+ "execution_count": 12,
1061
+ "outputs": [
1062
+ {
1063
+ "output_type": "execute_result",
1064
+ "data": {
1065
+ "text/plain": [
1066
+ "(804, 12)"
1067
+ ]
1068
+ },
1069
+ "metadata": {},
1070
+ "execution_count": 12
1071
+ }
1072
+ ]
1073
+ },
1074
+ {
1075
+ "cell_type": "markdown",
1076
+ "source": [
1077
+ "Veri setinin kaç satır ve sütundan oluştuğunu gâsterir.\n",
1078
+ "\n"
1079
+ ],
1080
+ "metadata": {
1081
+ "id": "TcvqOd2kqa7a"
1082
+ }
1083
+ },
1084
+ {
1085
+ "cell_type": "code",
1086
+ "source": [
1087
+ "X=df.drop('Price',axis=1)\n",
1088
+ "y=df['Price']"
1089
+ ],
1090
+ "metadata": {
1091
+ "id": "vTLh077kqfni"
1092
+ },
1093
+ "execution_count": 13,
1094
+ "outputs": []
1095
+ },
1096
+ {
1097
+ "cell_type": "markdown",
1098
+ "source": [
1099
+ "Fiyat sütunuyla veri ân işleme başladı."
1100
+ ],
1101
+ "metadata": {
1102
+ "id": "rsqvPvJ5q1rI"
1103
+ }
1104
+ },
1105
+ {
1106
+ "cell_type": "code",
1107
+ "source": [
1108
+ "X_train,X_test,y_train,y_test=train_test_split(X,y,test_size=0.2,random_state=42)"
1109
+ ],
1110
+ "metadata": {
1111
+ "id": "RJGA1qKTsJST"
1112
+ },
1113
+ "execution_count": 14,
1114
+ "outputs": []
1115
+ },
1116
+ {
1117
+ "cell_type": "code",
1118
+ "source": [
1119
+ "preprocess=ColumnTransformer(\n",
1120
+ " transformers=[\n",
1121
+ " ('num',StandardScaler(),['Mileage', 'Cylinder','Liter','Doors']),\n",
1122
+ " ('cat',OneHotEncoder(),['Make','Model','Trim','Type'])\n",
1123
+ " ]\n",
1124
+ ")"
1125
+ ],
1126
+ "metadata": {
1127
+ "id": "wSwPfUZhshha"
1128
+ },
1129
+ "execution_count": 15,
1130
+ "outputs": []
1131
+ },
1132
+ {
1133
+ "cell_type": "code",
1134
+ "source": [
1135
+ "cars_model= LinearRegression()"
1136
+ ],
1137
+ "metadata": {
1138
+ "id": "YdOchgVqtvLc"
1139
+ },
1140
+ "execution_count": 16,
1141
+ "outputs": []
1142
+ },
1143
+ {
1144
+ "cell_type": "code",
1145
+ "source": [
1146
+ "pipe=Pipeline(steps=[('preprocessor',preprocess),('model',cars_model)])"
1147
+ ],
1148
+ "metadata": {
1149
+ "id": "-tpAChVrv8th"
1150
+ },
1151
+ "execution_count": 18,
1152
+ "outputs": []
1153
+ },
1154
+ {
1155
+ "cell_type": "markdown",
1156
+ "source": [
1157
+ "Pipeline tanΔ±mlandΔ±"
1158
+ ],
1159
+ "metadata": {
1160
+ "id": "15e56QlVwC-q"
1161
+ }
1162
+ },
1163
+ {
1164
+ "cell_type": "code",
1165
+ "source": [
1166
+ "pipe.fit(X_train,y_train)"
1167
+ ],
1168
+ "metadata": {
1169
+ "colab": {
1170
+ "base_uri": "https://localhost:8080/",
1171
+ "height": 191
1172
+ },
1173
+ "id": "f0TO4rAEwOZG",
1174
+ "outputId": "29cb6d66-f9ce-4b0a-d76a-443bc2523929"
1175
+ },
1176
+ "execution_count": 19,
1177
+ "outputs": [
1178
+ {
1179
+ "output_type": "execute_result",
1180
+ "data": {
1181
+ "text/plain": [
1182
+ "Pipeline(steps=[('preprocessor',\n",
1183
+ " ColumnTransformer(transformers=[('num', StandardScaler(),\n",
1184
+ " ['Mileage', 'Cylinder',\n",
1185
+ " 'Liter', 'Doors']),\n",
1186
+ " ('cat', OneHotEncoder(),\n",
1187
+ " ['Make', 'Model', 'Trim',\n",
1188
+ " 'Type'])])),\n",
1189
+ " ('model', LinearRegression())])"
1190
+ ],
1191
+ "text/html": [
1192
+ "<style>#sk-container-id-1 {color: black;background-color: white;}#sk-container-id-1 pre{padding: 0;}#sk-container-id-1 div.sk-toggleable {background-color: white;}#sk-container-id-1 label.sk-toggleable__label {cursor: pointer;display: block;width: 100%;margin-bottom: 0;padding: 0.3em;box-sizing: border-box;text-align: center;}#sk-container-id-1 label.sk-toggleable__label-arrow:before {content: \"β–Έ\";float: left;margin-right: 0.25em;color: #696969;}#sk-container-id-1 label.sk-toggleable__label-arrow:hover:before {color: black;}#sk-container-id-1 div.sk-estimator:hover label.sk-toggleable__label-arrow:before {color: black;}#sk-container-id-1 div.sk-toggleable__content {max-height: 0;max-width: 0;overflow: hidden;text-align: left;background-color: #f0f8ff;}#sk-container-id-1 div.sk-toggleable__content pre {margin: 0.2em;color: black;border-radius: 0.25em;background-color: #f0f8ff;}#sk-container-id-1 input.sk-toggleable__control:checked~div.sk-toggleable__content {max-height: 200px;max-width: 100%;overflow: auto;}#sk-container-id-1 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {content: \"β–Ύ\";}#sk-container-id-1 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-1 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-1 input.sk-hidden--visually {border: 0;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;width: 1px;}#sk-container-id-1 div.sk-estimator {font-family: monospace;background-color: #f0f8ff;border: 1px dotted black;border-radius: 0.25em;box-sizing: border-box;margin-bottom: 0.5em;}#sk-container-id-1 div.sk-estimator:hover {background-color: #d4ebff;}#sk-container-id-1 div.sk-parallel-item::after {content: \"\";width: 100%;border-bottom: 1px solid gray;flex-grow: 1;}#sk-container-id-1 div.sk-label:hover label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-1 div.sk-serial::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: 0;}#sk-container-id-1 div.sk-serial {display: flex;flex-direction: column;align-items: center;background-color: white;padding-right: 0.2em;padding-left: 0.2em;position: relative;}#sk-container-id-1 div.sk-item {position: relative;z-index: 1;}#sk-container-id-1 div.sk-parallel {display: flex;align-items: stretch;justify-content: center;background-color: white;position: relative;}#sk-container-id-1 div.sk-item::before, #sk-container-id-1 div.sk-parallel-item::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: -1;}#sk-container-id-1 div.sk-parallel-item {display: flex;flex-direction: column;z-index: 1;position: relative;background-color: white;}#sk-container-id-1 div.sk-parallel-item:first-child::after {align-self: flex-end;width: 50%;}#sk-container-id-1 div.sk-parallel-item:last-child::after {align-self: flex-start;width: 50%;}#sk-container-id-1 div.sk-parallel-item:only-child::after {width: 0;}#sk-container-id-1 div.sk-dashed-wrapped {border: 1px dashed gray;margin: 0 0.4em 0.5em 0.4em;box-sizing: border-box;padding-bottom: 0.4em;background-color: white;}#sk-container-id-1 div.sk-label label {font-family: monospace;font-weight: bold;display: inline-block;line-height: 1.2em;}#sk-container-id-1 div.sk-label-container {text-align: center;}#sk-container-id-1 div.sk-container {/* jupyter's `normalize.less` sets `[hidden] { display: none; }` but bootstrap.min.css set `[hidden] { display: none !important; }` so we also need the `!important` here to be able to override the default hidden behavior on the sphinx rendered scikit-learn.org. See: https://github.com/scikit-learn/scikit-learn/issues/21755 */display: inline-block !important;position: relative;}#sk-container-id-1 div.sk-text-repr-fallback {display: none;}</style><div id=\"sk-container-id-1\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>Pipeline(steps=[(&#x27;preprocessor&#x27;,\n",
1193
+ " ColumnTransformer(transformers=[(&#x27;num&#x27;, StandardScaler(),\n",
1194
+ " [&#x27;Mileage&#x27;, &#x27;Cylinder&#x27;,\n",
1195
+ " &#x27;Liter&#x27;, &#x27;Doors&#x27;]),\n",
1196
+ " (&#x27;cat&#x27;, OneHotEncoder(),\n",
1197
+ " [&#x27;Make&#x27;, &#x27;Model&#x27;, &#x27;Trim&#x27;,\n",
1198
+ " &#x27;Type&#x27;])])),\n",
1199
+ " (&#x27;model&#x27;, LinearRegression())])</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item sk-dashed-wrapped\"><div class=\"sk-label-container\"><div class=\"sk-label sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-1\" type=\"checkbox\" ><label for=\"sk-estimator-id-1\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">Pipeline</label><div class=\"sk-toggleable__content\"><pre>Pipeline(steps=[(&#x27;preprocessor&#x27;,\n",
1200
+ " ColumnTransformer(transformers=[(&#x27;num&#x27;, StandardScaler(),\n",
1201
+ " [&#x27;Mileage&#x27;, &#x27;Cylinder&#x27;,\n",
1202
+ " &#x27;Liter&#x27;, &#x27;Doors&#x27;]),\n",
1203
+ " (&#x27;cat&#x27;, OneHotEncoder(),\n",
1204
+ " [&#x27;Make&#x27;, &#x27;Model&#x27;, &#x27;Trim&#x27;,\n",
1205
+ " &#x27;Type&#x27;])])),\n",
1206
+ " (&#x27;model&#x27;, LinearRegression())])</pre></div></div></div><div class=\"sk-serial\"><div class=\"sk-item sk-dashed-wrapped\"><div class=\"sk-label-container\"><div class=\"sk-label sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-2\" type=\"checkbox\" ><label for=\"sk-estimator-id-2\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">preprocessor: ColumnTransformer</label><div class=\"sk-toggleable__content\"><pre>ColumnTransformer(transformers=[(&#x27;num&#x27;, StandardScaler(),\n",
1207
+ " [&#x27;Mileage&#x27;, &#x27;Cylinder&#x27;, &#x27;Liter&#x27;, &#x27;Doors&#x27;]),\n",
1208
+ " (&#x27;cat&#x27;, OneHotEncoder(),\n",
1209
+ " [&#x27;Make&#x27;, &#x27;Model&#x27;, &#x27;Trim&#x27;, &#x27;Type&#x27;])])</pre></div></div></div><div class=\"sk-parallel\"><div class=\"sk-parallel-item\"><div class=\"sk-item\"><div class=\"sk-label-container\"><div class=\"sk-label sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-3\" type=\"checkbox\" ><label for=\"sk-estimator-id-3\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">num</label><div class=\"sk-toggleable__content\"><pre>[&#x27;Mileage&#x27;, &#x27;Cylinder&#x27;, &#x27;Liter&#x27;, &#x27;Doors&#x27;]</pre></div></div></div><div class=\"sk-serial\"><div class=\"sk-item\"><div class=\"sk-estimator sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-4\" type=\"checkbox\" ><label for=\"sk-estimator-id-4\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">StandardScaler</label><div class=\"sk-toggleable__content\"><pre>StandardScaler()</pre></div></div></div></div></div></div><div class=\"sk-parallel-item\"><div class=\"sk-item\"><div class=\"sk-label-container\"><div class=\"sk-label sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-5\" type=\"checkbox\" ><label for=\"sk-estimator-id-5\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">cat</label><div class=\"sk-toggleable__content\"><pre>[&#x27;Make&#x27;, &#x27;Model&#x27;, &#x27;Trim&#x27;, &#x27;Type&#x27;]</pre></div></div></div><div class=\"sk-serial\"><div class=\"sk-item\"><div class=\"sk-estimator sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-6\" type=\"checkbox\" ><label for=\"sk-estimator-id-6\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">OneHotEncoder</label><div class=\"sk-toggleable__content\"><pre>OneHotEncoder()</pre></div></div></div></div></div></div></div></div><div class=\"sk-item\"><div class=\"sk-estimator sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-7\" type=\"checkbox\" ><label for=\"sk-estimator-id-7\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">LinearRegression</label><div class=\"sk-toggleable__content\"><pre>LinearRegression()</pre></div></div></div></div></div></div></div>"
1210
+ ]
1211
+ },
1212
+ "metadata": {},
1213
+ "execution_count": 19
1214
+ }
1215
+ ]
1216
+ },
1217
+ {
1218
+ "cell_type": "code",
1219
+ "source": [
1220
+ "y_pred=pipe.predict(X_test)\n",
1221
+ "print('RMSE',mean_squared_error(y_test,y_pred)**0.5)\n",
1222
+ "print('R2',r2_score(y_test,y_pred))"
1223
+ ],
1224
+ "metadata": {
1225
+ "colab": {
1226
+ "base_uri": "https://localhost:8080/"
1227
+ },
1228
+ "id": "41ntEyZOwpMG",
1229
+ "outputId": "719ead68-c3a8-458e-d09d-0f36d3138d95"
1230
+ },
1231
+ "execution_count": 20,
1232
+ "outputs": [
1233
+ {
1234
+ "output_type": "stream",
1235
+ "name": "stdout",
1236
+ "text": [
1237
+ "RMSE 835.1007875600316\n",
1238
+ "R2 0.9912072813963753\n"
1239
+ ]
1240
+ }
1241
+ ]
1242
+ },
1243
+ {
1244
+ "cell_type": "markdown",
1245
+ "source": [
1246
+ "Skorlar kaydedildi."
1247
+ ],
1248
+ "metadata": {
1249
+ "id": "Vc9d9Ch4xEXe"
1250
+ }
1251
+ },
1252
+ {
1253
+ "cell_type": "code",
1254
+ "source": [
1255
+ "pipe.fit(X,y)"
1256
+ ],
1257
+ "metadata": {
1258
+ "colab": {
1259
+ "base_uri": "https://localhost:8080/",
1260
+ "height": 191
1261
+ },
1262
+ "id": "-i3lnaj_xMNW",
1263
+ "outputId": "b82306d3-50b0-4cad-b7a9-5128891be4c2"
1264
+ },
1265
+ "execution_count": 21,
1266
+ "outputs": [
1267
+ {
1268
+ "output_type": "execute_result",
1269
+ "data": {
1270
+ "text/plain": [
1271
+ "Pipeline(steps=[('preprocessor',\n",
1272
+ " ColumnTransformer(transformers=[('num', StandardScaler(),\n",
1273
+ " ['Mileage', 'Cylinder',\n",
1274
+ " 'Liter', 'Doors']),\n",
1275
+ " ('cat', OneHotEncoder(),\n",
1276
+ " ['Make', 'Model', 'Trim',\n",
1277
+ " 'Type'])])),\n",
1278
+ " ('model', LinearRegression())])"
1279
+ ],
1280
+ "text/html": [
1281
+ "<style>#sk-container-id-2 {color: black;background-color: white;}#sk-container-id-2 pre{padding: 0;}#sk-container-id-2 div.sk-toggleable {background-color: white;}#sk-container-id-2 label.sk-toggleable__label {cursor: pointer;display: block;width: 100%;margin-bottom: 0;padding: 0.3em;box-sizing: border-box;text-align: center;}#sk-container-id-2 label.sk-toggleable__label-arrow:before {content: \"β–Έ\";float: left;margin-right: 0.25em;color: #696969;}#sk-container-id-2 label.sk-toggleable__label-arrow:hover:before {color: black;}#sk-container-id-2 div.sk-estimator:hover label.sk-toggleable__label-arrow:before {color: black;}#sk-container-id-2 div.sk-toggleable__content {max-height: 0;max-width: 0;overflow: hidden;text-align: left;background-color: #f0f8ff;}#sk-container-id-2 div.sk-toggleable__content pre {margin: 0.2em;color: black;border-radius: 0.25em;background-color: #f0f8ff;}#sk-container-id-2 input.sk-toggleable__control:checked~div.sk-toggleable__content {max-height: 200px;max-width: 100%;overflow: auto;}#sk-container-id-2 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {content: \"β–Ύ\";}#sk-container-id-2 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-2 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-2 input.sk-hidden--visually {border: 0;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;width: 1px;}#sk-container-id-2 div.sk-estimator {font-family: monospace;background-color: #f0f8ff;border: 1px dotted black;border-radius: 0.25em;box-sizing: border-box;margin-bottom: 0.5em;}#sk-container-id-2 div.sk-estimator:hover {background-color: #d4ebff;}#sk-container-id-2 div.sk-parallel-item::after {content: \"\";width: 100%;border-bottom: 1px solid gray;flex-grow: 1;}#sk-container-id-2 div.sk-label:hover label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-2 div.sk-serial::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: 0;}#sk-container-id-2 div.sk-serial {display: flex;flex-direction: column;align-items: center;background-color: white;padding-right: 0.2em;padding-left: 0.2em;position: relative;}#sk-container-id-2 div.sk-item {position: relative;z-index: 1;}#sk-container-id-2 div.sk-parallel {display: flex;align-items: stretch;justify-content: center;background-color: white;position: relative;}#sk-container-id-2 div.sk-item::before, #sk-container-id-2 div.sk-parallel-item::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: -1;}#sk-container-id-2 div.sk-parallel-item {display: flex;flex-direction: column;z-index: 1;position: relative;background-color: white;}#sk-container-id-2 div.sk-parallel-item:first-child::after {align-self: flex-end;width: 50%;}#sk-container-id-2 div.sk-parallel-item:last-child::after {align-self: flex-start;width: 50%;}#sk-container-id-2 div.sk-parallel-item:only-child::after {width: 0;}#sk-container-id-2 div.sk-dashed-wrapped {border: 1px dashed gray;margin: 0 0.4em 0.5em 0.4em;box-sizing: border-box;padding-bottom: 0.4em;background-color: white;}#sk-container-id-2 div.sk-label label {font-family: monospace;font-weight: bold;display: inline-block;line-height: 1.2em;}#sk-container-id-2 div.sk-label-container {text-align: center;}#sk-container-id-2 div.sk-container {/* jupyter's `normalize.less` sets `[hidden] { display: none; }` but bootstrap.min.css set `[hidden] { display: none !important; }` so we also need the `!important` here to be able to override the default hidden behavior on the sphinx rendered scikit-learn.org. See: https://github.com/scikit-learn/scikit-learn/issues/21755 */display: inline-block !important;position: relative;}#sk-container-id-2 div.sk-text-repr-fallback {display: none;}</style><div id=\"sk-container-id-2\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>Pipeline(steps=[(&#x27;preprocessor&#x27;,\n",
1282
+ " ColumnTransformer(transformers=[(&#x27;num&#x27;, StandardScaler(),\n",
1283
+ " [&#x27;Mileage&#x27;, &#x27;Cylinder&#x27;,\n",
1284
+ " &#x27;Liter&#x27;, &#x27;Doors&#x27;]),\n",
1285
+ " (&#x27;cat&#x27;, OneHotEncoder(),\n",
1286
+ " [&#x27;Make&#x27;, &#x27;Model&#x27;, &#x27;Trim&#x27;,\n",
1287
+ " &#x27;Type&#x27;])])),\n",
1288
+ " (&#x27;model&#x27;, LinearRegression())])</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item sk-dashed-wrapped\"><div class=\"sk-label-container\"><div class=\"sk-label sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-8\" type=\"checkbox\" ><label for=\"sk-estimator-id-8\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">Pipeline</label><div class=\"sk-toggleable__content\"><pre>Pipeline(steps=[(&#x27;preprocessor&#x27;,\n",
1289
+ " ColumnTransformer(transformers=[(&#x27;num&#x27;, StandardScaler(),\n",
1290
+ " [&#x27;Mileage&#x27;, &#x27;Cylinder&#x27;,\n",
1291
+ " &#x27;Liter&#x27;, &#x27;Doors&#x27;]),\n",
1292
+ " (&#x27;cat&#x27;, OneHotEncoder(),\n",
1293
+ " [&#x27;Make&#x27;, &#x27;Model&#x27;, &#x27;Trim&#x27;,\n",
1294
+ " &#x27;Type&#x27;])])),\n",
1295
+ " (&#x27;model&#x27;, LinearRegression())])</pre></div></div></div><div class=\"sk-serial\"><div class=\"sk-item sk-dashed-wrapped\"><div class=\"sk-label-container\"><div class=\"sk-label sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-9\" type=\"checkbox\" ><label for=\"sk-estimator-id-9\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">preprocessor: ColumnTransformer</label><div class=\"sk-toggleable__content\"><pre>ColumnTransformer(transformers=[(&#x27;num&#x27;, StandardScaler(),\n",
1296
+ " [&#x27;Mileage&#x27;, &#x27;Cylinder&#x27;, &#x27;Liter&#x27;, &#x27;Doors&#x27;]),\n",
1297
+ " (&#x27;cat&#x27;, OneHotEncoder(),\n",
1298
+ " [&#x27;Make&#x27;, &#x27;Model&#x27;, &#x27;Trim&#x27;, &#x27;Type&#x27;])])</pre></div></div></div><div class=\"sk-parallel\"><div class=\"sk-parallel-item\"><div class=\"sk-item\"><div class=\"sk-label-container\"><div class=\"sk-label sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-10\" type=\"checkbox\" ><label for=\"sk-estimator-id-10\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">num</label><div class=\"sk-toggleable__content\"><pre>[&#x27;Mileage&#x27;, &#x27;Cylinder&#x27;, &#x27;Liter&#x27;, &#x27;Doors&#x27;]</pre></div></div></div><div class=\"sk-serial\"><div class=\"sk-item\"><div class=\"sk-estimator sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-11\" type=\"checkbox\" ><label for=\"sk-estimator-id-11\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">StandardScaler</label><div class=\"sk-toggleable__content\"><pre>StandardScaler()</pre></div></div></div></div></div></div><div class=\"sk-parallel-item\"><div class=\"sk-item\"><div class=\"sk-label-container\"><div class=\"sk-label sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-12\" type=\"checkbox\" ><label for=\"sk-estimator-id-12\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">cat</label><div class=\"sk-toggleable__content\"><pre>[&#x27;Make&#x27;, &#x27;Model&#x27;, &#x27;Trim&#x27;, &#x27;Type&#x27;]</pre></div></div></div><div class=\"sk-serial\"><div class=\"sk-item\"><div class=\"sk-estimator sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-13\" type=\"checkbox\" ><label for=\"sk-estimator-id-13\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">OneHotEncoder</label><div class=\"sk-toggleable__content\"><pre>OneHotEncoder()</pre></div></div></div></div></div></div></div></div><div class=\"sk-item\"><div class=\"sk-estimator sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-14\" type=\"checkbox\" ><label for=\"sk-estimator-id-14\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">LinearRegression</label><div class=\"sk-toggleable__content\"><pre>LinearRegression()</pre></div></div></div></div></div></div></div>"
1299
+ ]
1300
+ },
1301
+ "metadata": {},
1302
+ "execution_count": 21
1303
+ }
1304
+ ]
1305
+ },
1306
+ {
1307
+ "cell_type": "markdown",
1308
+ "source": [
1309
+ "Veri setiyle tekrar eğitim yapıldı."
1310
+ ],
1311
+ "metadata": {
1312
+ "id": "bEKsz1pExU7o"
1313
+ }
1314
+ },
1315
+ {
1316
+ "cell_type": "code",
1317
+ "source": [
1318
+ "!pip install streamlit"
1319
+ ],
1320
+ "metadata": {
1321
+ "colab": {
1322
+ "base_uri": "https://localhost:8080/"
1323
+ },
1324
+ "id": "hP5OsYaZxa5I",
1325
+ "outputId": "d32a7d22-551d-40b2-fdab-93c2f666dd44"
1326
+ },
1327
+ "execution_count": 22,
1328
+ "outputs": [
1329
+ {
1330
+ "output_type": "stream",
1331
+ "name": "stdout",
1332
+ "text": [
1333
+ "Collecting streamlit\n",
1334
+ " Downloading streamlit-1.35.0-py2.py3-none-any.whl (8.6 MB)\n",
1335
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m8.6/8.6 MB\u001b[0m \u001b[31m46.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
1336
+ "\u001b[?25hRequirement already satisfied: altair<6,>=4.0 in /usr/local/lib/python3.10/dist-packages (from streamlit) (4.2.2)\n",
1337
+ "Requirement already satisfied: blinker<2,>=1.0.0 in /usr/lib/python3/dist-packages (from streamlit) (1.4)\n",
1338
+ "Requirement already satisfied: cachetools<6,>=4.0 in /usr/local/lib/python3.10/dist-packages (from streamlit) (5.3.3)\n",
1339
+ "Requirement already satisfied: click<9,>=7.0 in /usr/local/lib/python3.10/dist-packages (from streamlit) (8.1.7)\n",
1340
+ "Requirement already satisfied: numpy<2,>=1.19.3 in /usr/local/lib/python3.10/dist-packages (from streamlit) (1.25.2)\n",
1341
+ "Requirement already satisfied: packaging<25,>=16.8 in /usr/local/lib/python3.10/dist-packages (from streamlit) (24.1)\n",
1342
+ "Requirement already satisfied: pandas<3,>=1.3.0 in /usr/local/lib/python3.10/dist-packages (from streamlit) (2.0.3)\n",
1343
+ "Requirement already satisfied: pillow<11,>=7.1.0 in /usr/local/lib/python3.10/dist-packages (from streamlit) (9.4.0)\n",
1344
+ "Requirement already satisfied: protobuf<5,>=3.20 in /usr/local/lib/python3.10/dist-packages (from streamlit) (3.20.3)\n",
1345
+ "Requirement already satisfied: pyarrow>=7.0 in /usr/local/lib/python3.10/dist-packages (from streamlit) (14.0.2)\n",
1346
+ "Requirement already satisfied: requests<3,>=2.27 in /usr/local/lib/python3.10/dist-packages (from streamlit) (2.31.0)\n",
1347
+ "Requirement already satisfied: rich<14,>=10.14.0 in /usr/local/lib/python3.10/dist-packages (from streamlit) (13.7.1)\n",
1348
+ "Requirement already satisfied: tenacity<9,>=8.1.0 in /usr/local/lib/python3.10/dist-packages (from streamlit) (8.3.0)\n",
1349
+ "Requirement already satisfied: toml<2,>=0.10.1 in /usr/local/lib/python3.10/dist-packages (from streamlit) (0.10.2)\n",
1350
+ "Requirement already satisfied: typing-extensions<5,>=4.3.0 in /usr/local/lib/python3.10/dist-packages (from streamlit) (4.12.2)\n",
1351
+ "Collecting gitpython!=3.1.19,<4,>=3.0.7 (from streamlit)\n",
1352
+ " Downloading GitPython-3.1.43-py3-none-any.whl (207 kB)\n",
1353
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m207.3/207.3 kB\u001b[0m \u001b[31m26.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
1354
+ "\u001b[?25hCollecting pydeck<1,>=0.8.0b4 (from streamlit)\n",
1355
+ " Downloading pydeck-0.9.1-py2.py3-none-any.whl (6.9 MB)\n",
1356
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m6.9/6.9 MB\u001b[0m \u001b[31m88.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
1357
+ "\u001b[?25hRequirement already satisfied: tornado<7,>=6.0.3 in /usr/local/lib/python3.10/dist-packages (from streamlit) (6.3.3)\n",
1358
+ "Collecting watchdog>=2.1.5 (from streamlit)\n",
1359
+ " Downloading watchdog-4.0.1-py3-none-manylinux2014_x86_64.whl (83 kB)\n",
1360
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m83.0/83.0 kB\u001b[0m \u001b[31m11.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
1361
+ "\u001b[?25hRequirement already satisfied: entrypoints in /usr/local/lib/python3.10/dist-packages (from altair<6,>=4.0->streamlit) (0.4)\n",
1362
+ "Requirement already satisfied: jinja2 in /usr/local/lib/python3.10/dist-packages (from altair<6,>=4.0->streamlit) (3.1.4)\n",
1363
+ "Requirement already satisfied: jsonschema>=3.0 in /usr/local/lib/python3.10/dist-packages (from altair<6,>=4.0->streamlit) (4.19.2)\n",
1364
+ "Requirement already satisfied: toolz in /usr/local/lib/python3.10/dist-packages (from altair<6,>=4.0->streamlit) (0.12.1)\n",
1365
+ "Collecting gitdb<5,>=4.0.1 (from gitpython!=3.1.19,<4,>=3.0.7->streamlit)\n",
1366
+ " Downloading gitdb-4.0.11-py3-none-any.whl (62 kB)\n",
1367
+ "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m62.7/62.7 kB\u001b[0m \u001b[31m8.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
1368
+ "\u001b[?25hRequirement already satisfied: python-dateutil>=2.8.2 in /usr/local/lib/python3.10/dist-packages (from pandas<3,>=1.3.0->streamlit) (2.8.2)\n",
1369
+ "Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas<3,>=1.3.0->streamlit) (2023.4)\n",
1370
+ "Requirement already satisfied: tzdata>=2022.1 in /usr/local/lib/python3.10/dist-packages (from pandas<3,>=1.3.0->streamlit) (2024.1)\n",
1371
+ "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests<3,>=2.27->streamlit) (3.3.2)\n",
1372
+ "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests<3,>=2.27->streamlit) (3.7)\n",
1373
+ "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests<3,>=2.27->streamlit) (2.0.7)\n",
1374
+ "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests<3,>=2.27->streamlit) (2024.6.2)\n",
1375
+ "Requirement already satisfied: markdown-it-py>=2.2.0 in /usr/local/lib/python3.10/dist-packages (from rich<14,>=10.14.0->streamlit) (3.0.0)\n",
1376
+ "Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /usr/local/lib/python3.10/dist-packages (from rich<14,>=10.14.0->streamlit) (2.16.1)\n",
1377
+ "Collecting smmap<6,>=3.0.1 (from gitdb<5,>=4.0.1->gitpython!=3.1.19,<4,>=3.0.7->streamlit)\n",
1378
+ " Downloading smmap-5.0.1-py3-none-any.whl (24 kB)\n",
1379
+ "Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.10/dist-packages (from jinja2->altair<6,>=4.0->streamlit) (2.1.5)\n",
1380
+ "Requirement already satisfied: attrs>=22.2.0 in /usr/local/lib/python3.10/dist-packages (from jsonschema>=3.0->altair<6,>=4.0->streamlit) (23.2.0)\n",
1381
+ "Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /usr/local/lib/python3.10/dist-packages (from jsonschema>=3.0->altair<6,>=4.0->streamlit) (2023.12.1)\n",
1382
+ "Requirement already satisfied: referencing>=0.28.4 in /usr/local/lib/python3.10/dist-packages (from jsonschema>=3.0->altair<6,>=4.0->streamlit) (0.35.1)\n",
1383
+ "Requirement already satisfied: rpds-py>=0.7.1 in /usr/local/lib/python3.10/dist-packages (from jsonschema>=3.0->altair<6,>=4.0->streamlit) (0.18.1)\n",
1384
+ "Requirement already satisfied: mdurl~=0.1 in /usr/local/lib/python3.10/dist-packages (from markdown-it-py>=2.2.0->rich<14,>=10.14.0->streamlit) (0.1.2)\n",
1385
+ "Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil>=2.8.2->pandas<3,>=1.3.0->streamlit) (1.16.0)\n",
1386
+ "Installing collected packages: watchdog, smmap, pydeck, gitdb, gitpython, streamlit\n",
1387
+ "Successfully installed gitdb-4.0.11 gitpython-3.1.43 pydeck-0.9.1 smmap-5.0.1 streamlit-1.35.0 watchdog-4.0.1\n"
1388
+ ]
1389
+ }
1390
+ ]
1391
+ },
1392
+ {
1393
+ "cell_type": "code",
1394
+ "source": [
1395
+ "import streamlit as st\n",
1396
+ "\n",
1397
+ "def price(make,model,trim,mileage,car_type,cylinder,liter,doors,cruise,sound,leather):\n",
1398
+ " input_data=pd.DataFrame({'Make':[make],\n",
1399
+ " 'Model':[model],\n",
1400
+ " 'Trim':[trim],\n",
1401
+ " 'Mileage':[mileage],\n",
1402
+ " 'Type':[car_type],\n",
1403
+ " 'Cylinder':[cylinder],\n",
1404
+ " 'Liter':[liter],\n",
1405
+ " 'Doors':[doors],\n",
1406
+ " 'Cruise':[cruise],\n",
1407
+ " 'Sound':[sound],\n",
1408
+ " 'Leather':[leather]})\n",
1409
+ " prediction=pipe.predict(input_data)[0]\n",
1410
+ " return prediction\n",
1411
+ "st.title(\"II. El Araba FiyatΔ± Tahmin:red_car: @drmurataltun\")\n",
1412
+ "st.write('Arabanın âzelliklerini seçiniz')\n",
1413
+ "make=st.selectbox('Marka',df['Make'].unique())\n",
1414
+ "model=st.selectbox('Model',df[df['Make']==make]['Model'].unique())\n",
1415
+ "trim=st.selectbox('Trim',df[(df['Make']==make) &(df['Model']==model)]['Trim'].unique())\n",
1416
+ "mileage=st.number_input('Kilometre',100,200000)\n",
1417
+ "car_type=st.selectbox('Araç Tipi',df[(df['Make']==make) &(df['Model']==model)&(df['Trim']==trim)]['Type'].unique())\n",
1418
+ "cylinder=st.selectbox('Cylinder',df['Cylinder'].unique())\n",
1419
+ "liter=st.number_input('YakΔ±t hacmi',1,10)\n",
1420
+ "doors=st.selectbox('KapΔ± sayΔ±sΔ±',df['Doors'].unique())\n",
1421
+ "cruise=st.radio('HΔ±z Sbt.',[True,False])\n",
1422
+ "sound=st.radio('Ses Sis.',[True,False])\n",
1423
+ "leather=st.radio('Deri dâşeme.',[True,False])\n",
1424
+ "if st.button('Tahmin'):\n",
1425
+ " pred=price(make,model,trim,mileage,car_type,cylinder,liter,doors,cruise,sound,leather)\n",
1426
+ " st.write('Fiyat:$', round(pred[0],2))"
1427
+ ],
1428
+ "metadata": {
1429
+ "colab": {
1430
+ "base_uri": "https://localhost:8080/"
1431
+ },
1432
+ "id": "xC3w9NK_3Lmh",
1433
+ "outputId": "f232a770-f806-4362-dce1-ea2ea73e79cf"
1434
+ },
1435
+ "execution_count": 23,
1436
+ "outputs": [
1437
+ {
1438
+ "output_type": "stream",
1439
+ "name": "stderr",
1440
+ "text": [
1441
+ "2024-06-18 15:00:30.503 \n",
1442
+ " \u001b[33m\u001b[1mWarning:\u001b[0m to view this Streamlit app on a browser, run it with the following\n",
1443
+ " command:\n",
1444
+ "\n",
1445
+ " streamlit run /usr/local/lib/python3.10/dist-packages/colab_kernel_launcher.py [ARGUMENTS]\n",
1446
+ "2024-06-18 15:00:30.507 Session state does not function when running a script without `streamlit run`\n"
1447
+ ]
1448
+ }
1449
+ ]
1450
+ }
1451
+ ]
1452
+ }
cars.xls ADDED
Binary file (142 kB). View file