diff --git a/cab_fare.ipynb b/cab_fare.ipynb
index f7acdc3..a7333a4 100644
--- a/cab_fare.ipynb
+++ b/cab_fare.ipynb
@@ -5,7 +5,7 @@
"colab": {
"name": "cab_fare",
"provenance": [],
- "authorship_tag": "ABX9TyPv+QW/yqWdKp6axJPlIG3H",
+ "authorship_tag": "ABX9TyOG84z5JR94k/FabStHz4LL",
"include_colab_link": true
},
"kernelspec": {
@@ -56,7 +56,7 @@
"\n",
"%matplotlib inline"
],
- "execution_count": 412,
+ "execution_count": 5,
"outputs": []
},
{
@@ -69,7 +69,7 @@
"source": [
"train = pd.read_csv(\"train_cab.csv\",na_values={\"pickup_datetime\":\"43\"})"
],
- "execution_count": 413,
+ "execution_count": 6,
"outputs": []
},
{
@@ -81,12 +81,12 @@
"base_uri": "https://localhost:8080/",
"height": 609
},
- "outputId": "cafc3fc8-636e-4b92-99e5-c89d5922737a"
+ "outputId": "80a315b4-1e01-43a8-85fb-7954cec09df2"
},
"source": [
"train"
],
- "execution_count": 414,
+ "execution_count": 7,
"outputs": [
{
"output_type": "execute_result",
@@ -255,7 +255,7 @@
"metadata": {
"tags": []
},
- "execution_count": 414
+ "execution_count": 7
}
]
},
@@ -269,7 +269,7 @@
"source": [
"test_data = pd.read_csv('test.csv')"
],
- "execution_count": 415,
+ "execution_count": 8,
"outputs": []
},
{
@@ -281,12 +281,12 @@
"base_uri": "https://localhost:8080/",
"height": 589
},
- "outputId": "6d28e16a-c458-4e33-b5d5-6592105d8a4f"
+ "outputId": "1e3d40ee-e32c-4902-c786-685726b4f6e3"
},
"source": [
"test_data\n"
],
- "execution_count": 416,
+ "execution_count": 9,
"outputs": [
{
"output_type": "execute_result",
@@ -443,7 +443,7 @@
"metadata": {
"tags": []
},
- "execution_count": 416
+ "execution_count": 9
}
]
},
@@ -464,14 +464,14 @@
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
- "height": 309
+ "height": 202
},
- "outputId": "e33d9ac4-60a7-4157-9b54-9a6f2afaf3c8"
+ "outputId": "60116b9d-d7a0-4ea1-c650-f64cf26e49f9"
},
"source": [
- "train.head() "
+ "train.head(5) "
],
- "execution_count": 417,
+ "execution_count": 95,
"outputs": [
{
"output_type": "execute_result",
@@ -496,84 +496,88 @@
"
\n",
" | \n",
" fare_amount | \n",
- " pickup_datetime | \n",
- " pickup_longitude | \n",
- " pickup_latitude | \n",
- " dropoff_longitude | \n",
- " dropoff_latitude | \n",
" passenger_count | \n",
+ " year | \n",
+ " Month | \n",
+ " Date | \n",
+ " Day | \n",
+ " Hour | \n",
+ " distance | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 4.5 | \n",
- " 2009-06-15 17:26:21 UTC | \n",
- " -73.844311 | \n",
- " 40.721319 | \n",
- " -73.841610 | \n",
- " 40.712278 | \n",
- " 1.0 | \n",
+ " 1 | \n",
+ " 2009 | \n",
+ " 6 | \n",
+ " 15 | \n",
+ " 0 | \n",
+ " 17 | \n",
+ " 1.030764 | \n",
"
\n",
" \n",
" 1 | \n",
" 16.9 | \n",
- " 2010-01-05 16:52:16 UTC | \n",
- " -74.016048 | \n",
- " 40.711303 | \n",
- " -73.979268 | \n",
- " 40.782004 | \n",
- " 1.0 | \n",
+ " 1 | \n",
+ " 2010 | \n",
+ " 1 | \n",
+ " 5 | \n",
+ " 1 | \n",
+ " 16 | \n",
+ " 8.450134 | \n",
"
\n",
" \n",
" 2 | \n",
" 5.7 | \n",
- " 2011-08-18 00:35:00 UTC | \n",
- " -73.982738 | \n",
- " 40.761270 | \n",
- " -73.991242 | \n",
- " 40.750562 | \n",
- " 2.0 | \n",
+ " 2 | \n",
+ " 2011 | \n",
+ " 8 | \n",
+ " 18 | \n",
+ " 3 | \n",
+ " 0 | \n",
+ " 1.389525 | \n",
"
\n",
" \n",
" 3 | \n",
" 7.7 | \n",
- " 2012-04-21 04:30:42 UTC | \n",
- " -73.987130 | \n",
- " 40.733143 | \n",
- " -73.991567 | \n",
- " 40.758092 | \n",
- " 1.0 | \n",
+ " 1 | \n",
+ " 2012 | \n",
+ " 4 | \n",
+ " 21 | \n",
+ " 5 | \n",
+ " 4 | \n",
+ " 2.799270 | \n",
"
\n",
" \n",
" 4 | \n",
" 5.3 | \n",
- " 2010-03-09 07:51:00 UTC | \n",
- " -73.968095 | \n",
- " 40.768008 | \n",
- " -73.956655 | \n",
- " 40.783762 | \n",
- " 1.0 | \n",
+ " 1 | \n",
+ " 2010 | \n",
+ " 3 | \n",
+ " 9 | \n",
+ " 1 | \n",
+ " 7 | \n",
+ " 1.999157 | \n",
"
\n",
" \n",
"\n",
""
],
"text/plain": [
- " fare_amount pickup_datetime ... dropoff_latitude passenger_count\n",
- "0 4.5 2009-06-15 17:26:21 UTC ... 40.712278 1.0\n",
- "1 16.9 2010-01-05 16:52:16 UTC ... 40.782004 1.0\n",
- "2 5.7 2011-08-18 00:35:00 UTC ... 40.750562 2.0\n",
- "3 7.7 2012-04-21 04:30:42 UTC ... 40.758092 1.0\n",
- "4 5.3 2010-03-09 07:51:00 UTC ... 40.783762 1.0\n",
- "\n",
- "[5 rows x 7 columns]"
+ " fare_amount passenger_count year Month Date Day Hour distance\n",
+ "0 4.5 1 2009 6 15 0 17 1.030764\n",
+ "1 16.9 1 2010 1 5 1 16 8.450134\n",
+ "2 5.7 2 2011 8 18 3 0 1.389525\n",
+ "3 7.7 1 2012 4 21 5 4 2.799270\n",
+ "4 5.3 1 2010 3 9 1 7 1.999157"
]
},
"metadata": {
"tags": []
},
- "execution_count": 417
+ "execution_count": 95
}
]
},
@@ -594,14 +598,14 @@
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
- "height": 289
+ "height": 202
},
- "outputId": "1ce67cd6-3191-4f88-c73c-8ee314ccfa68"
+ "outputId": "b4607f8b-f89a-48ba-cae2-7cf4a774eb1c"
},
"source": [
- "test_data.head() "
+ "test_data.head(5) "
],
- "execution_count": 418,
+ "execution_count": 94,
"outputs": [
{
"output_type": "execute_result",
@@ -625,79 +629,91 @@
" \n",
" \n",
" | \n",
- " pickup_datetime | \n",
- " pickup_longitude | \n",
- " pickup_latitude | \n",
- " dropoff_longitude | \n",
- " dropoff_latitude | \n",
" passenger_count | \n",
+ " year | \n",
+ " date | \n",
+ " month | \n",
+ " day | \n",
+ " hour | \n",
+ " distance | \n",
+ " predicted fare | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
- " 2015-01-27 13:08:24 UTC | \n",
- " -73.973320 | \n",
- " 40.763805 | \n",
- " -73.981430 | \n",
- " 40.743835 | \n",
" 1 | \n",
+ " 2015 | \n",
+ " 2015-01-27 | \n",
+ " 1 | \n",
+ " 1 | \n",
+ " 13 | \n",
+ " 2.323259 | \n",
+ " 9.030922 | \n",
"
\n",
" \n",
" 1 | \n",
- " 2015-01-27 13:08:24 UTC | \n",
- " -73.986862 | \n",
- " 40.719383 | \n",
- " -73.998886 | \n",
- " 40.739201 | \n",
" 1 | \n",
+ " 2015 | \n",
+ " 2015-01-27 | \n",
+ " 1 | \n",
+ " 1 | \n",
+ " 13 | \n",
+ " 2.425353 | \n",
+ " 17.752611 | \n",
"
\n",
" \n",
" 2 | \n",
- " 2011-10-08 11:53:44 UTC | \n",
- " -73.982524 | \n",
- " 40.751260 | \n",
- " -73.979654 | \n",
- " 40.746139 | \n",
" 1 | \n",
+ " 2011 | \n",
+ " 2011-10-08 | \n",
+ " 10 | \n",
+ " 5 | \n",
+ " 11 | \n",
+ " 0.618628 | \n",
+ " 6.344608 | \n",
"
\n",
" \n",
" 3 | \n",
- " 2012-12-01 21:12:12 UTC | \n",
- " -73.981160 | \n",
- " 40.767807 | \n",
- " -73.990448 | \n",
- " 40.751635 | \n",
" 1 | \n",
+ " 2012 | \n",
+ " 2012-12-01 | \n",
+ " 12 | \n",
+ " 5 | \n",
+ " 21 | \n",
+ " 1.961033 | \n",
+ " 7.431251 | \n",
"
\n",
" \n",
" 4 | \n",
- " 2012-12-01 21:12:12 UTC | \n",
- " -73.966046 | \n",
- " 40.789775 | \n",
- " -73.988565 | \n",
- " 40.744427 | \n",
" 1 | \n",
+ " 2012 | \n",
+ " 2012-12-01 | \n",
+ " 12 | \n",
+ " 5 | \n",
+ " 21 | \n",
+ " 5.387301 | \n",
+ " 14.611386 | \n",
"
\n",
" \n",
"\n",
""
],
"text/plain": [
- " pickup_datetime pickup_longitude ... dropoff_latitude passenger_count\n",
- "0 2015-01-27 13:08:24 UTC -73.973320 ... 40.743835 1\n",
- "1 2015-01-27 13:08:24 UTC -73.986862 ... 40.739201 1\n",
- "2 2011-10-08 11:53:44 UTC -73.982524 ... 40.746139 1\n",
- "3 2012-12-01 21:12:12 UTC -73.981160 ... 40.751635 1\n",
- "4 2012-12-01 21:12:12 UTC -73.966046 ... 40.744427 1\n",
+ " passenger_count year date ... hour distance predicted fare \n",
+ "0 1 2015 2015-01-27 ... 13 2.323259 9.030922\n",
+ "1 1 2015 2015-01-27 ... 13 2.425353 17.752611\n",
+ "2 1 2011 2011-10-08 ... 11 0.618628 6.344608\n",
+ "3 1 2012 2012-12-01 ... 21 1.961033 7.431251\n",
+ "4 1 2012 2012-12-01 ... 21 5.387301 14.611386\n",
"\n",
- "[5 rows x 6 columns]"
+ "[5 rows x 8 columns]"
]
},
"metadata": {
"tags": []
},
- "execution_count": 418
+ "execution_count": 94
}
]
},
@@ -720,12 +736,12 @@
"base_uri": "https://localhost:8080/",
"height": 156
},
- "outputId": "cb8a50b3-1196-4e3b-be4c-ab3fbc7afc77"
+ "outputId": "432677ee-4c2a-41f8-8555-4a0ca4b31ec4"
},
"source": [
"train.dtypes"
],
- "execution_count": 419,
+ "execution_count": 12,
"outputs": [
{
"output_type": "execute_result",
@@ -744,7 +760,7 @@
"metadata": {
"tags": []
},
- "execution_count": 419
+ "execution_count": 12
}
]
},
@@ -767,12 +783,12 @@
"base_uri": "https://localhost:8080/",
"height": 139
},
- "outputId": "e8b0a9b6-f54c-488b-ee45-4a40057e2237"
+ "outputId": "a8734fbd-d675-46e4-90cd-a39bdd05e474"
},
"source": [
"test_data.dtypes"
],
- "execution_count": 420,
+ "execution_count": 13,
"outputs": [
{
"output_type": "execute_result",
@@ -790,7 +806,7 @@
"metadata": {
"tags": []
},
- "execution_count": 420
+ "execution_count": 13
}
]
},
@@ -813,7 +829,7 @@
"base_uri": "https://localhost:8080/",
"height": 52
},
- "outputId": "4b3843f6-b3e0-45e5-a319-4f109c99f507"
+ "outputId": "d9ceb36f-0591-4b17-e56b-cb2a660766e1"
},
"source": [
"\n",
@@ -821,7 +837,7 @@
"x,y = train.shape\n",
"print('\\t',x,' \\t',y)"
],
- "execution_count": 421,
+ "execution_count": 14,
"outputs": [
{
"output_type": "stream",
@@ -852,7 +868,7 @@
"base_uri": "https://localhost:8080/",
"height": 52
},
- "outputId": "97960bf9-79fc-4caf-93be-35e4b28a8882"
+ "outputId": "f8bfca98-2b2c-4701-f68e-801580d43077"
},
"source": [
"\n",
@@ -860,7 +876,7 @@
"x,y = test_data.shape\n",
"print('\\t',x,' \\t',y)"
],
- "execution_count": 422,
+ "execution_count": 15,
"outputs": [
{
"output_type": "stream",
@@ -891,13 +907,13 @@
"base_uri": "https://localhost:8080/",
"height": 294
},
- "outputId": "80cb540b-eb99-4153-b454-5f35a09efb65"
+ "outputId": "0446e425-edbc-4150-e668-cd197e4cfbab"
},
"source": [
"\n",
"test_data.describe()"
],
- "execution_count": 423,
+ "execution_count": 16,
"outputs": [
{
"output_type": "execute_result",
@@ -1014,7 +1030,7 @@
"metadata": {
"tags": []
},
- "execution_count": 423
+ "execution_count": 16
}
]
},
@@ -1037,13 +1053,13 @@
"base_uri": "https://localhost:8080/",
"height": 294
},
- "outputId": "8749c83e-2834-44bf-9a72-71d9901879fb"
+ "outputId": "c15cb2b2-6f12-4fec-a3a2-712fdf3020b5"
},
"source": [
"#Descrbing the data set:Describe(): The describe() method is used for calculating some statistical data like percentile, mean and std of the numerical values of the Series or DataFrame. It analyzes both numeric and object series and also the DataFrame column sets of mixed data types.\n",
"train.describe()"
],
- "execution_count": 424,
+ "execution_count": 17,
"outputs": [
{
"output_type": "execute_result",
@@ -1160,7 +1176,7 @@
"metadata": {
"tags": []
},
- "execution_count": 424
+ "execution_count": 17
}
]
},
@@ -1196,7 +1212,7 @@
"train[\"fare_amount\"] = pd.to_numeric(train[\"fare_amount\"],errors = \"coerce\") \n",
" "
],
- "execution_count": 425,
+ "execution_count": 18,
"outputs": []
},
{
@@ -1218,12 +1234,12 @@
"base_uri": "https://localhost:8080/",
"height": 156
},
- "outputId": "f02f3977-c09b-4891-a89c-d1aaa610c4fa"
+ "outputId": "c6e52458-8556-4ead-c63e-92a5bfac8ac0"
},
"source": [
"train.dtypes\n"
],
- "execution_count": 426,
+ "execution_count": 19,
"outputs": [
{
"output_type": "execute_result",
@@ -1242,7 +1258,7 @@
"metadata": {
"tags": []
},
- "execution_count": 426
+ "execution_count": 19
}
]
},
@@ -1257,7 +1273,7 @@
"#Converting date time to date_time format from object format\n",
"train['pickup_datetime'] = pd.to_datetime(train['pickup_datetime'], format='%Y-%m-%d %H:%M:%S UTC')"
],
- "execution_count": 427,
+ "execution_count": 20,
"outputs": []
},
{
@@ -1269,12 +1285,12 @@
"base_uri": "https://localhost:8080/",
"height": 156
},
- "outputId": "9f818cf5-c585-487c-958c-41484450a032"
+ "outputId": "34c099e4-8e0c-43dc-f650-b9268327720e"
},
"source": [
"train.dtypes"
],
- "execution_count": 428,
+ "execution_count": 21,
"outputs": [
{
"output_type": "execute_result",
@@ -1293,7 +1309,7 @@
"metadata": {
"tags": []
},
- "execution_count": 428
+ "execution_count": 21
}
]
},
@@ -1316,12 +1332,12 @@
"base_uri": "https://localhost:8080/",
"height": 609
},
- "outputId": "5865d3a2-5268-4bc0-e3ca-d1011b3975b7"
+ "outputId": "50363fe8-184a-47a0-be55-277faab56043"
},
"source": [
"train.dropna(subset= [\"pickup_datetime\"]) #dropping NA values in datetime column"
],
- "execution_count": 429,
+ "execution_count": 22,
"outputs": [
{
"output_type": "execute_result",
@@ -1490,7 +1506,7 @@
"metadata": {
"tags": []
},
- "execution_count": 429
+ "execution_count": 22
}
]
},
@@ -1522,7 +1538,7 @@
"train['Hour'] = train['pickup_datetime'].dt.hour\n",
"train['Minute'] = train['pickup_datetime'].dt.minute"
],
- "execution_count": 430,
+ "execution_count": 23,
"outputs": []
},
{
@@ -1534,12 +1550,12 @@
"base_uri": "https://localhost:8080/",
"height": 260
},
- "outputId": "241fe042-a600-4040-ca2c-1ba9b47e0fc8"
+ "outputId": "bdd25732-f2b9-4581-a53a-6506d1206e86"
},
"source": [
"train.dtypes"
],
- "execution_count": 431,
+ "execution_count": 24,
"outputs": [
{
"output_type": "execute_result",
@@ -1564,7 +1580,7 @@
"metadata": {
"tags": []
},
- "execution_count": 431
+ "execution_count": 24
}
]
},
@@ -1578,7 +1594,7 @@
"source": [
"test_data['pickup_datetime']= pd.to_datetime(test_data['pickup_datetime'],format= \"%Y-%m-%d %H:%M:%S UTC\")"
],
- "execution_count": 432,
+ "execution_count": 25,
"outputs": []
},
{
@@ -1590,12 +1606,12 @@
"base_uri": "https://localhost:8080/",
"height": 139
},
- "outputId": "7b19633d-5db7-4e6c-be20-f5c80abed842"
+ "outputId": "821ad0df-e4ff-497b-ac96-631a416212ce"
},
"source": [
"test_data.dtypes"
],
- "execution_count": 433,
+ "execution_count": 26,
"outputs": [
{
"output_type": "execute_result",
@@ -1613,7 +1629,7 @@
"metadata": {
"tags": []
},
- "execution_count": 433
+ "execution_count": 26
}
]
},
@@ -1637,7 +1653,7 @@
"source": [
"test_data['year'] = test_data['pickup_datetime'].dt.year"
],
- "execution_count": 434,
+ "execution_count": 27,
"outputs": []
},
{
@@ -1649,12 +1665,12 @@
"base_uri": "https://localhost:8080/",
"height": 156
},
- "outputId": "7243647d-f025-4f98-d2f8-75b8aa479d22"
+ "outputId": "6e5bb512-cb4b-4082-c03c-2281a32f73bd"
},
"source": [
"test_data.dtypes"
],
- "execution_count": 435,
+ "execution_count": 28,
"outputs": [
{
"output_type": "execute_result",
@@ -1673,7 +1689,7 @@
"metadata": {
"tags": []
},
- "execution_count": 435
+ "execution_count": 28
}
]
},
@@ -1694,7 +1710,7 @@
"\n",
"\n"
],
- "execution_count": 436,
+ "execution_count": 29,
"outputs": []
},
{
@@ -1706,12 +1722,12 @@
"base_uri": "https://localhost:8080/",
"height": 243
},
- "outputId": "9494497b-1179-49ef-a225-bb53fda28f07"
+ "outputId": "f44214eb-0c6e-487c-bbb5-d9884b271504"
},
"source": [
"test_data.dtypes"
],
- "execution_count": 437,
+ "execution_count": 30,
"outputs": [
{
"output_type": "execute_result",
@@ -1735,7 +1751,7 @@
"metadata": {
"tags": []
},
- "execution_count": 437
+ "execution_count": 30
}
]
},
@@ -1763,7 +1779,7 @@
"train = train.drop(drop, axis = 1)\n",
"\n"
],
- "execution_count": 438,
+ "execution_count": 31,
"outputs": []
},
{
@@ -1777,7 +1793,7 @@
"drop1=['pickup_datetime', 'Minute']\n",
"test_data = test_data.drop(drop, axis = 1)"
],
- "execution_count": 439,
+ "execution_count": 32,
"outputs": []
},
{
@@ -1807,12 +1823,12 @@
"base_uri": "https://localhost:8080/",
"height": 173
},
- "outputId": "1b7caaab-621d-46ef-d86c-4cd5b48f242b"
+ "outputId": "e4e67d6b-98bf-475a-a215-0d04a23b7c97"
},
"source": [
"train['passenger_count'].describe()"
],
- "execution_count": 440,
+ "execution_count": 33,
"outputs": [
{
"output_type": "execute_result",
@@ -1832,7 +1848,7 @@
"metadata": {
"tags": []
},
- "execution_count": 440
+ "execution_count": 33
}
]
},
@@ -1856,7 +1872,7 @@
"source": [
"train = train.drop(train[train[\"passenger_count\"]> 6 ].index, axis=0)"
],
- "execution_count": 441,
+ "execution_count": 34,
"outputs": []
},
{
@@ -1868,12 +1884,12 @@
"base_uri": "https://localhost:8080/",
"height": 173
},
- "outputId": "a441b205-a079-4de0-af60-d40a2fb19d3d"
+ "outputId": "fe32bf0b-6965-4261-9450-41c255e6b5ad"
},
"source": [
"train['passenger_count'].describe()"
],
- "execution_count": 442,
+ "execution_count": 35,
"outputs": [
{
"output_type": "execute_result",
@@ -1893,7 +1909,7 @@
"metadata": {
"tags": []
},
- "execution_count": 442
+ "execution_count": 35
}
]
},
@@ -1919,7 +1935,7 @@
"##print(train.shape)\n",
"#print(train['pickup_datetime'].isnull().sum())"
],
- "execution_count": 443,
+ "execution_count": 36,
"outputs": []
},
{
@@ -1942,7 +1958,7 @@
"source": [
"train = train.drop(train[train[\"passenger_count\"] == 0 ].index, axis=0)"
],
- "execution_count": 444,
+ "execution_count": 37,
"outputs": []
},
{
@@ -1954,12 +1970,12 @@
"base_uri": "https://localhost:8080/",
"height": 173
},
- "outputId": "05bf9403-ef50-4521-d00e-c0063203dcee"
+ "outputId": "85a1a7e8-3ae1-49b1-94c2-a73f1e0b6156"
},
"source": [
"train[\"passenger_count\"].describe()"
],
- "execution_count": 445,
+ "execution_count": 38,
"outputs": [
{
"output_type": "execute_result",
@@ -1979,7 +1995,7 @@
"metadata": {
"tags": []
},
- "execution_count": 445
+ "execution_count": 38
}
]
},
@@ -1992,12 +2008,12 @@
"base_uri": "https://localhost:8080/",
"height": 225
},
- "outputId": "9b5d6dfc-2473-4b2a-dd4d-e60c5a5999fc"
+ "outputId": "57bc53b4-698a-47d6-8644-3b4fe8d511b0"
},
"source": [
"train['passenger_count'].sort_values(ascending = True)"
],
- "execution_count": 446,
+ "execution_count": 39,
"outputs": [
{
"output_type": "execute_result",
@@ -2020,7 +2036,7 @@
"metadata": {
"tags": []
},
- "execution_count": 446
+ "execution_count": 39
}
]
},
@@ -2043,14 +2059,14 @@
"base_uri": "https://localhost:8080/",
"height": 52
},
- "outputId": "616284bc-1e0d-4331-feef-b8622fd3713c"
+ "outputId": "434a4ede-51c4-4d89-a5e9-26480fce1947"
},
"source": [
"train = train.drop(train[train['passenger_count'].isnull()].index, axis=0)\n",
"print(train.shape)\n",
"print(train['passenger_count'].isnull().sum())"
],
- "execution_count": 447,
+ "execution_count": 40,
"outputs": [
{
"output_type": "stream",
@@ -2081,7 +2097,7 @@
"base_uri": "https://localhost:8080/",
"height": 52
},
- "outputId": "7d071386-e534-4d9a-e471-360222b957e9"
+ "outputId": "53eaa110-4189-471a-a82f-4db1d79321c7"
},
"source": [
"\n",
@@ -2089,7 +2105,7 @@
"print(train.shape)\n",
"print(train['passenger_count'].isnull().sum())\n"
],
- "execution_count": 448,
+ "execution_count": 41,
"outputs": [
{
"output_type": "stream",
@@ -2134,13 +2150,13 @@
"base_uri": "https://localhost:8080/",
"height": 99
},
- "outputId": "7ec1ab22-59be-4282-f016-1fa76523e3a9"
+ "outputId": "962a6fd1-0550-4866-9de8-c042dc517ee0"
},
"source": [
"train[train['pickup_latitude']<-90]\n",
"train[train['pickup_latitude']>90]"
],
- "execution_count": 449,
+ "execution_count": 42,
"outputs": [
{
"output_type": "execute_result",
@@ -2206,7 +2222,7 @@
"metadata": {
"tags": []
},
- "execution_count": 449
+ "execution_count": 42
}
]
},
@@ -2222,7 +2238,7 @@
"train = train.drop((train[train['pickup_latitude']<-90]).index, axis=0)\n",
"train = train.drop((train[train['pickup_latitude']>90]).index, axis=0)"
],
- "execution_count": 450,
+ "execution_count": 43,
"outputs": []
},
{
@@ -2234,13 +2250,13 @@
"base_uri": "https://localhost:8080/",
"height": 69
},
- "outputId": "42c7b6d7-ca99-4ef7-a3c0-e98113becd3d"
+ "outputId": "b633b3d1-416c-403c-b257-c8a487a22cd1"
},
"source": [
"train[train['pickup_longitude']<-180]\n",
"train[train['pickup_longitude']>180]"
],
- "execution_count": 451,
+ "execution_count": 44,
"outputs": [
{
"output_type": "execute_result",
@@ -2291,7 +2307,7 @@
"metadata": {
"tags": []
},
- "execution_count": 451
+ "execution_count": 44
}
]
},
@@ -2304,13 +2320,13 @@
"base_uri": "https://localhost:8080/",
"height": 69
},
- "outputId": "3fdb9975-b333-4b4f-be24-82c18913595f"
+ "outputId": "323c65cb-5b8c-4cc4-c3fa-5a219c06a6fd"
},
"source": [
"train[train['dropoff_latitude']<-90]\n",
"train[train['dropoff_latitude']>90]\n"
],
- "execution_count": 452,
+ "execution_count": 45,
"outputs": [
{
"output_type": "execute_result",
@@ -2361,7 +2377,7 @@
"metadata": {
"tags": []
},
- "execution_count": 452
+ "execution_count": 45
}
]
},
@@ -2374,13 +2390,13 @@
"base_uri": "https://localhost:8080/",
"height": 69
},
- "outputId": "831f9879-0a10-4527-fee1-80cdefc26276"
+ "outputId": "22641ec2-6b30-49c7-c4a1-091e963075c6"
},
"source": [
"train[train['dropoff_longitude']<-180]\n",
"train[train['dropoff_longitude']>180]\n"
],
- "execution_count": 453,
+ "execution_count": 46,
"outputs": [
{
"output_type": "execute_result",
@@ -2431,7 +2447,7 @@
"metadata": {
"tags": []
},
- "execution_count": 453
+ "execution_count": 46
}
]
},
@@ -2444,12 +2460,12 @@
"base_uri": "https://localhost:8080/",
"height": 173
},
- "outputId": "ccd9c65b-5434-4173-aab6-332a5d89f7bc"
+ "outputId": "c071dfc9-111d-470b-9c15-67edcdeca583"
},
"source": [
"train['dropoff_longitude'].describe()"
],
- "execution_count": 454,
+ "execution_count": 47,
"outputs": [
{
"output_type": "execute_result",
@@ -2469,7 +2485,7 @@
"metadata": {
"tags": []
},
- "execution_count": 454
+ "execution_count": 47
}
]
},
@@ -2482,12 +2498,12 @@
"base_uri": "https://localhost:8080/",
"height": 173
},
- "outputId": "adbb43c2-946a-4f67-bd73-6832e95d1f0b"
+ "outputId": "fce1b570-a42d-4dff-b9ee-348087a27651"
},
"source": [
"train['dropoff_latitude'].describe()"
],
- "execution_count": 455,
+ "execution_count": 48,
"outputs": [
{
"output_type": "execute_result",
@@ -2507,7 +2523,7 @@
"metadata": {
"tags": []
},
- "execution_count": 455
+ "execution_count": 48
}
]
},
@@ -2520,12 +2536,12 @@
"base_uri": "https://localhost:8080/",
"height": 173
},
- "outputId": "d7186bda-6611-4d08-e387-bbe6c9c30291"
+ "outputId": "28255266-5ec0-44c8-d766-8ca1edd9bb38"
},
"source": [
"train['pickup_latitude'].describe()"
],
- "execution_count": 456,
+ "execution_count": 49,
"outputs": [
{
"output_type": "execute_result",
@@ -2545,7 +2561,7 @@
"metadata": {
"tags": []
},
- "execution_count": 456
+ "execution_count": 49
}
]
},
@@ -2558,12 +2574,12 @@
"base_uri": "https://localhost:8080/",
"height": 173
},
- "outputId": "a3c1bece-ad1c-423c-f023-efd7edde995f"
+ "outputId": "250d1d6f-f14a-4680-91d1-8574f0ca5206"
},
"source": [
"train['dropoff_longitude'].describe()"
],
- "execution_count": 457,
+ "execution_count": 50,
"outputs": [
{
"output_type": "execute_result",
@@ -2583,7 +2599,7 @@
"metadata": {
"tags": []
},
- "execution_count": 457
+ "execution_count": 50
}
]
},
@@ -2606,12 +2622,12 @@
"base_uri": "https://localhost:8080/",
"height": 225
},
- "outputId": "dc71ba39-87bf-4da0-f5f1-25cd3a08c878"
+ "outputId": "6d0746a1-e1f2-4620-f3c0-4a1ddc16dc98"
},
"source": [
"train['fare_amount'].sort_values(ascending=True)"
],
- "execution_count": 458,
+ "execution_count": 51,
"outputs": [
{
"output_type": "execute_result",
@@ -2634,7 +2650,7 @@
"metadata": {
"tags": []
},
- "execution_count": 458
+ "execution_count": 51
}
]
},
@@ -2658,7 +2674,7 @@
"source": [
"train = train.drop(train[train['fare_amount'].isnull()].index,axis=0)"
],
- "execution_count": 459,
+ "execution_count": 52,
"outputs": []
},
{
@@ -2672,7 +2688,7 @@
"\n",
"train = train.drop(train[train[\"fare_amount\"]<0].index, axis=0)\n"
],
- "execution_count": 460,
+ "execution_count": 53,
"outputs": []
},
{
@@ -2686,7 +2702,7 @@
"train = train.drop(train[train[\"fare_amount\"]<1].index, axis=0)\n",
"train = train.drop(train[train[\"fare_amount\"]> 454 ].index, axis=0)"
],
- "execution_count": 461,
+ "execution_count": 54,
"outputs": []
},
{
@@ -2698,12 +2714,12 @@
"base_uri": "https://localhost:8080/",
"height": 173
},
- "outputId": "1cee2425-0427-4ef6-ad10-57c151faeeb4"
+ "outputId": "bbd9e434-9e13-46be-979a-f7aefc658d4c"
},
"source": [
"train['fare_amount'].describe()"
],
- "execution_count": 462,
+ "execution_count": 55,
"outputs": [
{
"output_type": "execute_result",
@@ -2723,7 +2739,7 @@
"metadata": {
"tags": []
},
- "execution_count": 462
+ "execution_count": 55
}
]
},
@@ -2763,7 +2779,7 @@
" km = 6371* c\n",
" return km"
],
- "execution_count": 463,
+ "execution_count": 56,
"outputs": []
},
{
@@ -2776,7 +2792,7 @@
"source": [
"train['distance'] = train[['pickup_longitude','pickup_latitude','dropoff_longitude','dropoff_latitude']].apply(haversine,axis=1)"
],
- "execution_count": 464,
+ "execution_count": 57,
"outputs": []
},
{
@@ -2789,7 +2805,7 @@
"source": [
"test_data['distance'] = test_data[['pickup_longitude','pickup_latitude','dropoff_longitude','dropoff_latitude']].apply(haversine,axis=1)"
],
- "execution_count": 465,
+ "execution_count": 58,
"outputs": []
},
{
@@ -2813,7 +2829,7 @@
"drop = [ 'pickup_longitude', 'pickup_latitude','dropoff_longitude', 'dropoff_latitude']\n",
"train = train.drop(drop, axis = 1)"
],
- "execution_count": 466,
+ "execution_count": 59,
"outputs": []
},
{
@@ -2827,7 +2843,7 @@
"drop1=['pickup_longitude', 'pickup_latitude','dropoff_longitude', 'dropoff_latitude']\n",
"test_data = test_data.drop(drop, axis = 1)"
],
- "execution_count": 467,
+ "execution_count": 60,
"outputs": []
},
{
@@ -2849,12 +2865,12 @@
"base_uri": "https://localhost:8080/",
"height": 202
},
- "outputId": "2c10b080-ffdd-446d-9c71-bade9b66e68a"
+ "outputId": "a1b7c78e-76a5-4195-ad1f-7c1b71174719"
},
"source": [
"train.head()"
],
- "execution_count": 468,
+ "execution_count": 61,
"outputs": [
{
"output_type": "execute_result",
@@ -2960,7 +2976,7 @@
"metadata": {
"tags": []
},
- "execution_count": 468
+ "execution_count": 61
}
]
},
@@ -2973,12 +2989,12 @@
"base_uri": "https://localhost:8080/",
"height": 202
},
- "outputId": "39cbc11a-dcc4-4939-cd24-df15c338ea4c"
+ "outputId": "7e510ffb-6ac1-43b4-f091-da1a358d1ec1"
},
"source": [
"test_data.head()"
],
- "execution_count": 469,
+ "execution_count": 62,
"outputs": [
{
"output_type": "execute_result",
@@ -3078,7 +3094,7 @@
"metadata": {
"tags": []
},
- "execution_count": 469
+ "execution_count": 62
}
]
},
@@ -3091,12 +3107,12 @@
"base_uri": "https://localhost:8080/",
"height": 156
},
- "outputId": "245a114d-db01-4fb2-8565-4246701edd45"
+ "outputId": "59faf0d0-1ebd-4e8b-dadf-8aa83895ec75"
},
"source": [
"test_data.nunique()"
],
- "execution_count": 470,
+ "execution_count": 63,
"outputs": [
{
"output_type": "execute_result",
@@ -3115,7 +3131,7 @@
"metadata": {
"tags": []
},
- "execution_count": 470
+ "execution_count": 63
}
]
},
@@ -3128,12 +3144,12 @@
"base_uri": "https://localhost:8080/",
"height": 173
},
- "outputId": "4f3dc6f6-bdd9-46a4-e651-b2c68fb1b0dc"
+ "outputId": "159c4ad2-63b2-43f0-dec1-dae3f1497d44"
},
"source": [
"train.nunique()"
],
- "execution_count": 471,
+ "execution_count": 64,
"outputs": [
{
"output_type": "execute_result",
@@ -3153,7 +3169,7 @@
"metadata": {
"tags": []
},
- "execution_count": 471
+ "execution_count": 64
}
]
},
@@ -3166,12 +3182,12 @@
"base_uri": "https://localhost:8080/",
"height": 225
},
- "outputId": "f9f6c52c-6224-4820-8c74-86fd3af2a5fe"
+ "outputId": "54e97124-058a-4ac4-e9da-d87a07cada21"
},
"source": [
"train['distance'].sort_values( ascending=False,kind = 'quicksort')"
],
- "execution_count": 472,
+ "execution_count": 65,
"outputs": [
{
"output_type": "execute_result",
@@ -3194,7 +3210,7 @@
"metadata": {
"tags": []
},
- "execution_count": 472
+ "execution_count": 65
}
]
},
@@ -3230,7 +3246,7 @@
"source": [
"train = train.drop(train[train['distance']==0].index,level = None,axis = 0)"
],
- "execution_count": 473,
+ "execution_count": 66,
"outputs": []
},
{
@@ -3253,7 +3269,7 @@
"source": [
"train = train.drop(train[train['distance']>129].index,axis = 0,level = None)"
],
- "execution_count": 474,
+ "execution_count": 67,
"outputs": []
},
{
@@ -3265,12 +3281,12 @@
"base_uri": "https://localhost:8080/",
"height": 225
},
- "outputId": "f7e7010a-4cf7-4e40-de7b-524429ed8449"
+ "outputId": "6a49c36c-7259-42e5-8c09-61bb75a081f1"
},
"source": [
"train['distance']"
],
- "execution_count": 475,
+ "execution_count": 68,
"outputs": [
{
"output_type": "execute_result",
@@ -3293,7 +3309,7 @@
"metadata": {
"tags": []
},
- "execution_count": 475
+ "execution_count": 68
}
]
},
@@ -3306,12 +3322,12 @@
"base_uri": "https://localhost:8080/",
"height": 314
},
- "outputId": "3231b728-159d-490a-bf33-5d38278023d3"
+ "outputId": "8563b6f7-535f-4bed-c547-3aed71c78870"
},
"source": [
"train.describe()"
],
- "execution_count": 476,
+ "execution_count": 69,
"outputs": [
{
"output_type": "execute_result",
@@ -3455,7 +3471,7 @@
"metadata": {
"tags": []
},
- "execution_count": 476
+ "execution_count": 69
}
]
},
@@ -3468,12 +3484,12 @@
"base_uri": "https://localhost:8080/",
"height": 173
},
- "outputId": "8506db67-bcd9-48c9-8ae7-1e8f1c9e765e"
+ "outputId": "a3483cf0-70f9-4972-bdfe-a19a0b7d5bce"
},
"source": [
"train.dtypes"
],
- "execution_count": 477,
+ "execution_count": 70,
"outputs": [
{
"output_type": "execute_result",
@@ -3493,7 +3509,7 @@
"metadata": {
"tags": []
},
- "execution_count": 477
+ "execution_count": 70
}
]
},
@@ -3516,12 +3532,12 @@
"base_uri": "https://localhost:8080/",
"height": 225
},
- "outputId": "6e01db98-d732-4430-c20e-ab8052b9e410"
+ "outputId": "fa36738d-5785-41e9-9c1f-c486b14869df"
},
"source": [
"train['passenger_count']"
],
- "execution_count": 478,
+ "execution_count": 71,
"outputs": [
{
"output_type": "execute_result",
@@ -3544,7 +3560,7 @@
"metadata": {
"tags": []
},
- "execution_count": 478
+ "execution_count": 71
}
]
},
@@ -3558,7 +3574,7 @@
"source": [
"train['passenger_count'] = train['passenger_count'].astype('int64')\n"
],
- "execution_count": 479,
+ "execution_count": 72,
"outputs": []
},
{
@@ -3570,12 +3586,12 @@
"base_uri": "https://localhost:8080/",
"height": 173
},
- "outputId": "394968c8-1177-4316-d557-22f67fb26b81"
+ "outputId": "0aecfa59-b200-496f-802f-9c36728d3bf5"
},
"source": [
"train['year'].describe()"
],
- "execution_count": 480,
+ "execution_count": 73,
"outputs": [
{
"output_type": "execute_result",
@@ -3595,7 +3611,7 @@
"metadata": {
"tags": []
},
- "execution_count": 480
+ "execution_count": 73
}
]
},
@@ -3609,7 +3625,7 @@
"source": [
"train = train.drop(train[train['year'].isnull()].index, axis=0)\n"
],
- "execution_count": 481,
+ "execution_count": 74,
"outputs": []
},
{
@@ -3625,7 +3641,7 @@
"train['Day'] = train['Day'].astype('int64')\n",
"train['Hour'] = train['Hour'].astype('int64')"
],
- "execution_count": 482,
+ "execution_count": 75,
"outputs": []
},
{
@@ -3638,7 +3654,7 @@
"source": [
"train['year'] = train['year'].astype('int64')"
],
- "execution_count": 483,
+ "execution_count": 76,
"outputs": []
},
{
@@ -3650,12 +3666,12 @@
"base_uri": "https://localhost:8080/",
"height": 173
},
- "outputId": "9cea1a98-2b0b-424e-e526-18eb80c91bd6"
+ "outputId": "eaeffade-a4f8-4d45-beeb-77a7b29f52d2"
},
"source": [
"train.dtypes"
],
- "execution_count": 484,
+ "execution_count": 77,
"outputs": [
{
"output_type": "execute_result",
@@ -3675,7 +3691,7 @@
"metadata": {
"tags": []
},
- "execution_count": 484
+ "execution_count": 77
}
]
},
@@ -3688,12 +3704,12 @@
"base_uri": "https://localhost:8080/",
"height": 225
},
- "outputId": "d51b5401-869d-4041-e28d-ecbd17af078d"
+ "outputId": "ad50111d-5a09-4077-d937-7afd967b4801"
},
"source": [
"train['year']"
],
- "execution_count": 485,
+ "execution_count": 78,
"outputs": [
{
"output_type": "execute_result",
@@ -3716,7 +3732,7 @@
"metadata": {
"tags": []
},
- "execution_count": 485
+ "execution_count": 78
}
]
},
@@ -3729,12 +3745,12 @@
"base_uri": "https://localhost:8080/",
"height": 202
},
- "outputId": "0c40b979-d9a4-4402-983e-9b60e105a0d1"
+ "outputId": "8da6a0c5-16bc-41ef-bc0f-0fa673e47f0e"
},
"source": [
- "train.head()"
+ "train.head(5)"
],
- "execution_count": 486,
+ "execution_count": 96,
"outputs": [
{
"output_type": "execute_result",
@@ -3840,7 +3856,7 @@
"metadata": {
"tags": []
},
- "execution_count": 486
+ "execution_count": 96
}
]
},
@@ -3853,12 +3869,12 @@
"base_uri": "https://localhost:8080/",
"height": 156
},
- "outputId": "361a49eb-2e1a-4d44-eafa-3c110dff36b3"
+ "outputId": "04e60004-c3ed-4b2f-8a63-db057b4d3668"
},
"source": [
"test_data.dtypes"
],
- "execution_count": 487,
+ "execution_count": 80,
"outputs": [
{
"output_type": "execute_result",
@@ -3877,7 +3893,7 @@
"metadata": {
"tags": []
},
- "execution_count": 487
+ "execution_count": 80
}
]
},
@@ -3890,12 +3906,12 @@
"base_uri": "https://localhost:8080/",
"height": 202
},
- "outputId": "a8c67677-0877-449a-f385-8fc295f1aeeb"
+ "outputId": "be362035-0f01-405a-d513-366c4c791355"
},
"source": [
"test_data.head()"
],
- "execution_count": 488,
+ "execution_count": 81,
"outputs": [
{
"output_type": "execute_result",
@@ -3995,7 +4011,7 @@
"metadata": {
"tags": []
},
- "execution_count": 488
+ "execution_count": 81
}
]
},
@@ -4023,7 +4039,7 @@
"X_train, X_test, y_train, y_test = train_test_split( train.iloc[:, train.columns != 'fare_amount'], \n",
" train.iloc[:, 0], test_size = 0.20, random_state = 1)"
],
- "execution_count": 489,
+ "execution_count": 82,
"outputs": []
},
{
@@ -4035,12 +4051,12 @@
"base_uri": "https://localhost:8080/",
"height": 415
},
- "outputId": "4b08ea80-1eb4-48ff-8d28-275639e2fb54"
+ "outputId": "b13a98f9-6ae7-4ad6-f2e2-7b91bb6853eb"
},
"source": [
"X_train"
],
- "execution_count": 490,
+ "execution_count": 83,
"outputs": [
{
"output_type": "execute_result",
@@ -4209,7 +4225,7 @@
"metadata": {
"tags": []
},
- "execution_count": 490
+ "execution_count": 83
}
]
},
@@ -4222,12 +4238,12 @@
"base_uri": "https://localhost:8080/",
"height": 225
},
- "outputId": "263af520-2ac8-4c56-9f7d-d0a801b6b97e"
+ "outputId": "ced2730d-6ce9-4725-8778-d7c217a2fa18"
},
"source": [
"y_test"
],
- "execution_count": 491,
+ "execution_count": 84,
"outputs": [
{
"output_type": "execute_result",
@@ -4250,7 +4266,7 @@
"metadata": {
"tags": []
},
- "execution_count": 491
+ "execution_count": 84
}
]
},
@@ -4263,12 +4279,12 @@
"base_uri": "https://localhost:8080/",
"height": 35
},
- "outputId": "1f46d800-434a-4011-a77f-f8b94b736bb3"
+ "outputId": "cbab6ae4-a3b2-42c9-af0b-1aec0684f577"
},
"source": [
"X_train.shape"
],
- "execution_count": 492,
+ "execution_count": 85,
"outputs": [
{
"output_type": "execute_result",
@@ -4280,7 +4296,7 @@
"metadata": {
"tags": []
},
- "execution_count": 492
+ "execution_count": 85
}
]
},
@@ -4293,12 +4309,12 @@
"base_uri": "https://localhost:8080/",
"height": 294
},
- "outputId": "ed407dba-e3bf-480a-d3f7-f972c45e0367"
+ "outputId": "63db3d92-c59f-43a0-ca7f-a0ff545e0324"
},
"source": [
"X_train.describe()"
],
- "execution_count": 493,
+ "execution_count": 86,
"outputs": [
{
"output_type": "execute_result",
@@ -4433,7 +4449,7 @@
"metadata": {
"tags": []
},
- "execution_count": 493
+ "execution_count": 86
}
]
},
@@ -4446,12 +4462,12 @@
"base_uri": "https://localhost:8080/",
"height": 294
},
- "outputId": "d45eb499-3722-4991-8163-fb68b0a7f753"
+ "outputId": "592320df-e7d2-480e-b32e-010c98298293"
},
"source": [
"X_test.describe()"
],
- "execution_count": 494,
+ "execution_count": 87,
"outputs": [
{
"output_type": "execute_result",
@@ -4586,7 +4602,7 @@
"metadata": {
"tags": []
},
- "execution_count": 494
+ "execution_count": 87
}
]
},
@@ -4599,12 +4615,12 @@
"base_uri": "https://localhost:8080/",
"height": 35
},
- "outputId": "fa1562a4-9298-43f4-91e8-19119d23b1a2"
+ "outputId": "0c1baf11-73ba-4593-ba7e-aa97c48f0de8"
},
"source": [
"X_test.shape"
],
- "execution_count": 495,
+ "execution_count": 88,
"outputs": [
{
"output_type": "execute_result",
@@ -4616,7 +4632,7 @@
"metadata": {
"tags": []
},
- "execution_count": 495
+ "execution_count": 88
}
]
},
@@ -4629,12 +4645,12 @@
"base_uri": "https://localhost:8080/",
"height": 225
},
- "outputId": "fd496c24-4131-40fd-eb2d-a00bcd0b42f1"
+ "outputId": "2ae71a26-e9b4-479a-cbfa-fcc6477eb0c1"
},
"source": [
"y_train"
],
- "execution_count": 496,
+ "execution_count": 89,
"outputs": [
{
"output_type": "execute_result",
@@ -4657,7 +4673,7 @@
"metadata": {
"tags": []
},
- "execution_count": 496
+ "execution_count": 89
}
]
},
@@ -4681,7 +4697,7 @@
"source": [
"regressor = LinearRegression().fit(X_train,y_train)"
],
- "execution_count": 497,
+ "execution_count": 90,
"outputs": []
},
{
@@ -4691,20 +4707,21 @@
"colab_type": "code",
"colab": {
"base_uri": "https://localhost:8080/",
- "height": 35
+ "height": 52
},
- "outputId": "55107cf6-9f0c-4dc4-f450-ba8b267bd905"
+ "outputId": "8a9a6f5a-6a5c-4f17-bc0b-825e2530abbb"
},
"source": [
"y_pred= regressor.predict(X_test)\n",
"print(y_pred)"
],
- "execution_count": 498,
+ "execution_count": 98,
"outputs": [
{
"output_type": "stream",
"text": [
- "[ 9.03 17.75 6.34 ... 10.59 9.71 9.54]\n"
+ "[ 9.03092216 17.75261122 6.34460849 ... 10.5865315 9.70641998\n",
+ " 9.53601507]\n"
],
"name": "stdout"
}
@@ -4720,7 +4737,7 @@
"source": [
"test_data['predicted fare ']= pd.Series(y_pred)"
],
- "execution_count": 499,
+ "execution_count": 92,
"outputs": []
},
{
@@ -4732,12 +4749,12 @@
"base_uri": "https://localhost:8080/",
"height": 415
},
- "outputId": "5f95b498-1472-46ed-ad4b-5213a161758f"
+ "outputId": "29124328-122a-4729-a5f6-9e65dfb43506"
},
"source": [
- "test_data"
+ "test_data.head(1000)"
],
- "execution_count": 502,
+ "execution_count": 100,
"outputs": [
{
"output_type": "execute_result",
@@ -4839,86 +4856,86 @@
" ... | \n",
" \n",
" \n",
- " 9909 | \n",
- " 6 | \n",
- " 2015 | \n",
- " 2015-05-10 | \n",
+ " 995 | \n",
+ " 1 | \n",
+ " 2010 | \n",
+ " 2010-08-14 | \n",
+ " 8 | \n",
" 5 | \n",
- " 6 | \n",
- " 12 | \n",
- " 2.124874 | \n",
- " NaN | \n",
+ " 2 | \n",
+ " 0.485708 | \n",
+ " 9.900170 | \n",
"
\n",
" \n",
- " 9910 | \n",
- " 6 | \n",
- " 2015 | \n",
- " 2015-01-12 | \n",
+ " 996 | \n",
" 1 | \n",
- " 0 | \n",
- " 17 | \n",
- " 3.270969 | \n",
- " NaN | \n",
+ " 2010 | \n",
+ " 2010-08-14 | \n",
+ " 8 | \n",
+ " 5 | \n",
+ " 2 | \n",
+ " 1.084746 | \n",
+ " 5.645274 | \n",
"
\n",
" \n",
- " 9911 | \n",
- " 6 | \n",
- " 2015 | \n",
- " 2015-04-19 | \n",
- " 4 | \n",
- " 6 | \n",
- " 20 | \n",
- " 19.183942 | \n",
- " NaN | \n",
+ " 997 | \n",
+ " 1 | \n",
+ " 2010 | \n",
+ " 2010-08-14 | \n",
+ " 8 | \n",
+ " 5 | \n",
+ " 2 | \n",
+ " 7.038219 | \n",
+ " 8.633435 | \n",
"
\n",
" \n",
- " 9912 | \n",
- " 6 | \n",
- " 2015 | \n",
- " 2015-01-31 | \n",
+ " 998 | \n",
" 1 | \n",
+ " 2010 | \n",
+ " 2010-08-14 | \n",
+ " 8 | \n",
" 5 | \n",
- " 1 | \n",
- " 8.343486 | \n",
- " NaN | \n",
+ " 2 | \n",
+ " 3.681500 | \n",
+ " 8.617010 | \n",
"
\n",
" \n",
- " 9913 | \n",
- " 6 | \n",
- " 2015 | \n",
- " 2015-01-18 | \n",
+ " 999 | \n",
" 1 | \n",
- " 6 | \n",
- " 14 | \n",
- " 1.180825 | \n",
- " NaN | \n",
+ " 2010 | \n",
+ " 2010-08-14 | \n",
+ " 8 | \n",
+ " 5 | \n",
+ " 2 | \n",
+ " 2.955836 | \n",
+ " 7.350423 | \n",
"
\n",
" \n",
"\n",
- "9914 rows × 8 columns
\n",
+ "1000 rows × 8 columns
\n",
""
],
"text/plain": [
- " passenger_count year date ... hour distance predicted fare \n",
- "0 1 2015 2015-01-27 ... 13 2.323259 9.030922\n",
- "1 1 2015 2015-01-27 ... 13 2.425353 17.752611\n",
- "2 1 2011 2011-10-08 ... 11 0.618628 6.344608\n",
- "3 1 2012 2012-12-01 ... 21 1.961033 7.431251\n",
- "4 1 2012 2012-12-01 ... 21 5.387301 14.611386\n",
- "... ... ... ... ... ... ... ...\n",
- "9909 6 2015 2015-05-10 ... 12 2.124874 NaN\n",
- "9910 6 2015 2015-01-12 ... 17 3.270969 NaN\n",
- "9911 6 2015 2015-04-19 ... 20 19.183942 NaN\n",
- "9912 6 2015 2015-01-31 ... 1 8.343486 NaN\n",
- "9913 6 2015 2015-01-18 ... 14 1.180825 NaN\n",
+ " passenger_count year date ... hour distance predicted fare \n",
+ "0 1 2015 2015-01-27 ... 13 2.323259 9.030922\n",
+ "1 1 2015 2015-01-27 ... 13 2.425353 17.752611\n",
+ "2 1 2011 2011-10-08 ... 11 0.618628 6.344608\n",
+ "3 1 2012 2012-12-01 ... 21 1.961033 7.431251\n",
+ "4 1 2012 2012-12-01 ... 21 5.387301 14.611386\n",
+ ".. ... ... ... ... ... ... ...\n",
+ "995 1 2010 2010-08-14 ... 2 0.485708 9.900170\n",
+ "996 1 2010 2010-08-14 ... 2 1.084746 5.645274\n",
+ "997 1 2010 2010-08-14 ... 2 7.038219 8.633435\n",
+ "998 1 2010 2010-08-14 ... 2 3.681500 8.617010\n",
+ "999 1 2010 2010-08-14 ... 2 2.955836 7.350423\n",
"\n",
- "[9914 rows x 8 columns]"
+ "[1000 rows x 8 columns]"
]
},
"metadata": {
"tags": []
},
- "execution_count": 502
+ "execution_count": 100
}
]
}