Skip to content

Commit 36d96f9

Browse files
committed
update samples from Release-114 as a part of SDK release
1 parent 7ebcfea commit 36d96f9

File tree

1 file changed

+2
-30
lines changed

1 file changed

+2
-30
lines changed

tutorials/regression-automl-nyc-taxi-data/regression-automated-ml.ipynb

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -101,35 +101,7 @@
101101
"cell_type": "markdown",
102102
"metadata": {},
103103
"source": [
104-
"Now that the initial data is loaded, define a function to create various time-based features from the pickup datetime field. This will create new fields for the month number, day of month, day of week, and hour of day, and will allow the model to factor in time-based seasonality. \n",
105-
"\n",
106-
"Use the `apply()` function on the dataframe to iteratively apply the `build_time_features()` function to each row in the taxi data."
107-
]
108-
},
109-
{
110-
"cell_type": "code",
111-
"execution_count": null,
112-
"metadata": {},
113-
"outputs": [],
114-
"source": [
115-
"def build_time_features(vector):\n",
116-
" pickup_datetime = vector[0]\n",
117-
" month_num = pickup_datetime.month\n",
118-
" day_of_month = pickup_datetime.day\n",
119-
" day_of_week = pickup_datetime.weekday()\n",
120-
" hour_of_day = pickup_datetime.hour\n",
121-
" \n",
122-
" return pd.Series((month_num, day_of_month, day_of_week, hour_of_day))\n",
123-
"\n",
124-
"green_taxi_df[[\"month_num\", \"day_of_month\",\"day_of_week\", \"hour_of_day\"]] = green_taxi_df[[\"lpepPickupDatetime\"]].apply(build_time_features, axis=1)\n",
125-
"green_taxi_df.head(10)"
126-
]
127-
},
128-
{
129-
"cell_type": "markdown",
130-
"metadata": {},
131-
"source": [
132-
"Remove some of the columns that you won't need for training or additional feature building."
104+
"Remove some of the columns that you won't need for training or additional feature building. Automate machine learning will automatically handle time-based features such as lpepPickupDatetime."
133105
]
134106
},
135107
{
@@ -138,7 +110,7 @@
138110
"metadata": {},
139111
"outputs": [],
140112
"source": [
141-
"columns_to_remove = [\"lpepPickupDatetime\", \"lpepDropoffDatetime\", \"puLocationId\", \"doLocationId\", \"extra\", \"mtaTax\",\n",
113+
"columns_to_remove = [\"lpepDropoffDatetime\", \"puLocationId\", \"doLocationId\", \"extra\", \"mtaTax\",\n",
142114
" \"improvementSurcharge\", \"tollsAmount\", \"ehailFee\", \"tripType\", \"rateCodeID\", \n",
143115
" \"storeAndFwdFlag\", \"paymentType\", \"fareAmount\", \"tipAmount\"\n",
144116
" ]\n",

0 commit comments

Comments
 (0)