Skip to content

Instantly share code, notes, and snippets.

@MattMcMurray
Created November 10, 2017 16:43
Show Gist options
  • Save MattMcMurray/86d7a8fe2da109cbb85b78442db10dfb to your computer and use it in GitHub Desktop.
Save MattMcMurray/86d7a8fe2da109cbb85b78442db10dfb to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 286,
"metadata": {},
"outputs": [
],
"source": [
"X_test = strat_test_set.drop('No-show', axis=1)\n",
"y_test = strat_test_set['No-show'].copy()\n",
"\n",
"X_test_prepared = full_pipeline.transform(X_test)\n",
"\n",
"final_preds = final_model.predict(X_test_prepared)"
]
},
{
"cell_type": "code",
"execution_count": 287,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([ 0., 0., 1., ..., 1., 0., 0.])"
]
},
"execution_count": 287,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"np.rint(final_preds)"
]
},
{
"cell_type": "code",
"execution_count": 288,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.4274997545536382"
]
},
"execution_count": 288,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"final_mse = mean_squared_error(y_test, final_preds)\n",
"final_rmse = np.sqrt(final_mse)\n",
"final_rmse"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment