Merge pull request #1601 from Azure/release_update/Release-114

update samples from Release-114 as a part of  SDK release
This commit is contained in:
Harneet Virk
2021-09-29 14:21:59 -07:00
committed by GitHub

View File

@@ -101,9 +101,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"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",
"\n",
"Use the `apply()` function on the dataframe to iteratively apply the `build_time_features()` function to each row in the taxi data."
"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."
]
},
{
@@ -112,33 +110,7 @@
"metadata": {},
"outputs": [],
"source": [
"def build_time_features(vector):\n",
" pickup_datetime = vector[0]\n",
" month_num = pickup_datetime.month\n",
" day_of_month = pickup_datetime.day\n",
" day_of_week = pickup_datetime.weekday()\n",
" hour_of_day = pickup_datetime.hour\n",
" \n",
" return pd.Series((month_num, day_of_month, day_of_week, hour_of_day))\n",
"\n",
"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",
"green_taxi_df.head(10)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Remove some of the columns that you won't need for training or additional feature building."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"columns_to_remove = [\"lpepPickupDatetime\", \"lpepDropoffDatetime\", \"puLocationId\", \"doLocationId\", \"extra\", \"mtaTax\",\n",
"columns_to_remove = [\"lpepDropoffDatetime\", \"puLocationId\", \"doLocationId\", \"extra\", \"mtaTax\",\n",
" \"improvementSurcharge\", \"tollsAmount\", \"ehailFee\", \"tripType\", \"rateCodeID\", \n",
" \"storeAndFwdFlag\", \"paymentType\", \"fareAmount\", \"tipAmount\"\n",
" ]\n",