Skip to content

Commit

Permalink
try to fix doc notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
nreinicke committed Oct 23, 2023
1 parent 079e456 commit 926082f
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 67 deletions.
4 changes: 2 additions & 2 deletions docs/model_prediction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -596,9 +596,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "routee-powertrain",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "routee-powertrain"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand Down
133 changes: 68 additions & 65 deletions docs/model_training.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>speed</th>\n",
" <th>grade</th>\n",
" <th>speed_mph</th>\n",
" <th>grade_dec</th>\n",
" <th>miles</th>\n",
" <th>gallons_fastsim</th>\n",
" <th>trip_id</th>\n",
Expand Down Expand Up @@ -131,12 +131,12 @@
"</div>"
],
"text/plain": [
" speed grade miles gallons_fastsim trip_id road_class\n",
"0 7.632068 -0.008963 0.015469 0.000813 1 3\n",
"1 6.329613 -0.047001 0.003516 0.000149 1 3\n",
"2 12.248512 0.000000 0.003402 0.000074 1 4\n",
"3 23.752604 -0.000463 0.019768 0.002194 1 1\n",
"4 46.024926 -0.004641 0.038378 0.000970 1 0"
" speed_mph grade_dec miles gallons_fastsim trip_id road_class\n",
"0 7.632068 -0.008963 0.015469 0.000813 1 3\n",
"1 6.329613 -0.047001 0.003516 0.000149 1 3\n",
"2 12.248512 0.000000 0.003402 0.000074 1 4\n",
"3 23.752604 -0.000463 0.019768 0.002194 1 1\n",
"4 46.024926 -0.004641 0.038378 0.000970 1 0"
]
},
"execution_count": 3,
Expand All @@ -161,18 +161,18 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
"feature_set_1 = [pt.DataColumn(name=\"speed\", units=\"mph\")]\n",
"feature_set_1 = [pt.DataColumn(name=\"speed_mph\", units=\"mph\")]\n",
"feature_set_2 = [\n",
" pt.DataColumn(name=\"speed\", units=\"mph\"),\n",
" pt.DataColumn(name=\"grade\", units=\"decimal\")\n",
" pt.DataColumn(name=\"speed_mph\", units=\"mph\"),\n",
" pt.DataColumn(name=\"grade_dec\", units=\"decimal\")\n",
"]\n",
"feature_set_3 = [\n",
" pt.DataColumn(name=\"speed\", units=\"mph\"),\n",
" pt.DataColumn(name=\"grade\", units=\"decimal\"),\n",
" pt.DataColumn(name=\"speed_mph\", units=\"mph\"),\n",
" pt.DataColumn(name=\"grade_dec\", units=\"decimal\"),\n",
" pt.DataColumn(name=\"road_class\", units=\"category\")\n",
"]\n",
"features = [\n",
Expand All @@ -191,7 +191,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -207,7 +207,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -226,7 +226,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -249,7 +249,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 14,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -270,14 +270,14 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 15,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"2023-09-19 15:55:20,870 [INFO] - filtered out 0 rows with energy rates outside of the limits of -inf and inf for energy target gallons_fastsim\n"
"2023-10-23 16:05:56,833 [INFO] - filtered out 0 rows with energy rates outside of the limits of -inf and inf for energy target gallons_fastsim\n"
]
}
],
Expand All @@ -294,58 +294,61 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 16,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table border=\"1\" style=\"border-collapse: collapse;\"><tr><td colspan='2' style='border-bottom: 2px solid black;text-align: center;'><b>Estimator Errors</b></td></tr><tr><td>Feature Set ID</td><td>speed</td></tr><tr><td>Target</td><td>gallons_fastsim</td></tr><tr><td>Link RMSE</td><td>0.00162</td></tr><tr><td>Link Norm RMSE</td><td>1.02617</td></tr><tr><td>Link Weighted RPD</td><td>0.84957</td></tr><tr><td>Net Error</td><td>-0.34643</td></tr><tr><td>Actual Dist/Energy</td><td>18.87243</td></tr><tr><td>Predicted Dist/Energy</td><td>28.87586</td></tr><tr><td>Trip RPD</td><td>0.41901</td></tr><tr><td>Trip Weighted RPD</td><td>0.41901</td></tr><tr><td>Trip RMSE</td><td>0.01425</td></tr><tr><td>Trip Norm RMSE</td><td>0.34643</td></tr><tr><td colspan='2' style='border-bottom: 2px solid black;text-align: center;'><b>Estimator Errors</b></td></tr><tr><td>Feature Set ID</td><td>grade&speed</td></tr><tr><td>Target</td><td>gallons_fastsim</td></tr><tr><td>Link RMSE</td><td>0.00138</td></tr><tr><td>Link Norm RMSE</td><td>0.87020</td></tr><tr><td>Link Weighted RPD</td><td>0.61434</td></tr><tr><td>Net Error</td><td>-0.16459</td></tr><tr><td>Actual Dist/Energy</td><td>18.87243</td></tr><tr><td>Predicted Dist/Energy</td><td>22.59067</td></tr><tr><td>Trip RPD</td><td>0.17935</td></tr><tr><td>Trip Weighted RPD</td><td>0.17935</td></tr><tr><td>Trip RMSE</td><td>0.00677</td></tr><tr><td>Trip Norm RMSE</td><td>0.16459</td></tr><tr><td colspan='2' style='border-bottom: 2px solid black;text-align: center;'><b>Estimator Errors</b></td></tr><tr><td>Feature Set ID</td><td>grade&road_class&speed</td></tr><tr><td>Target</td><td>gallons_fastsim</td></tr><tr><td>Link RMSE</td><td>0.00138</td></tr><tr><td>Link Norm RMSE</td><td>0.87389</td></tr><tr><td>Link Weighted RPD</td><td>0.60147</td></tr><tr><td>Net Error</td><td>-0.14991</td></tr><tr><td>Actual Dist/Energy</td><td>18.87243</td></tr><tr><td>Predicted Dist/Energy</td><td>22.20060</td></tr><tr><td>Trip RPD</td><td>0.16206</td></tr><tr><td>Trip Weighted RPD</td><td>0.16206</td></tr><tr><td>Trip RMSE</td><td>0.00617</td></tr><tr><td>Trip Norm RMSE</td><td>0.14991</td></tr></table>"
"<table border=\"1\" style=\"border-collapse: collapse;\"><tr><td colspan='2' style='border-bottom: 2px solid black;text-align: center;'><b>Estimator Errors</b></td></tr><tr><td>Feature Set ID</td><td>speed_mph</td></tr><tr><td>Target</td><td>gallons_fastsim</td></tr><tr><td>Link RMSE</td><td>0.00162</td></tr><tr><td>Link Norm RMSE</td><td>1.02617</td></tr><tr><td>Link Weighted RPD</td><td>0.84957</td></tr><tr><td>Net Error</td><td>-0.34643</td></tr><tr><td>Actual Dist/Energy</td><td>18.87243</td></tr><tr><td>Predicted Dist/Energy</td><td>28.87586</td></tr><tr><td>Real World Predicted Dist/Energy</td><td>24.76489</td></tr><tr><td>Trip RPD</td><td>0.41901</td></tr><tr><td>Trip Weighted RPD</td><td>0.41901</td></tr><tr><td>Trip RMSE</td><td>0.01425</td></tr><tr><td>Trip Norm RMSE</td><td>0.34643</td></tr><tr><td colspan='2' style='border-bottom: 2px solid black;text-align: center;'><b>Estimator Errors</b></td></tr><tr><td>Feature Set ID</td><td>grade_dec&speed_mph</td></tr><tr><td>Target</td><td>gallons_fastsim</td></tr><tr><td>Link RMSE</td><td>0.00138</td></tr><tr><td>Link Norm RMSE</td><td>0.87020</td></tr><tr><td>Link Weighted RPD</td><td>0.61434</td></tr><tr><td>Net Error</td><td>-0.16459</td></tr><tr><td>Actual Dist/Energy</td><td>18.87243</td></tr><tr><td>Predicted Dist/Energy</td><td>22.59067</td></tr><tr><td>Real World Predicted Dist/Energy</td><td>19.37450</td></tr><tr><td>Trip RPD</td><td>0.17935</td></tr><tr><td>Trip Weighted RPD</td><td>0.17935</td></tr><tr><td>Trip RMSE</td><td>0.00677</td></tr><tr><td>Trip Norm RMSE</td><td>0.16459</td></tr><tr><td colspan='2' style='border-bottom: 2px solid black;text-align: center;'><b>Estimator Errors</b></td></tr><tr><td>Feature Set ID</td><td>grade_dec&road_class&speed_mph</td></tr><tr><td>Target</td><td>gallons_fastsim</td></tr><tr><td>Link RMSE</td><td>0.00138</td></tr><tr><td>Link Norm RMSE</td><td>0.87389</td></tr><tr><td>Link Weighted RPD</td><td>0.60147</td></tr><tr><td>Net Error</td><td>-0.14991</td></tr><tr><td>Actual Dist/Energy</td><td>18.87243</td></tr><tr><td>Predicted Dist/Energy</td><td>22.20060</td></tr><tr><td>Real World Predicted Dist/Energy</td><td>19.03996</td></tr><tr><td>Trip RPD</td><td>0.16206</td></tr><tr><td>Trip Weighted RPD</td><td>0.16206</td></tr><tr><td>Trip RMSE</td><td>0.00617</td></tr><tr><td>Trip Norm RMSE</td><td>0.14991</td></tr></table>"
],
"text/plain": [
"=========================================\n",
"Feature Set ID: speed\n",
"Target: gallons_fastsim\n",
"Link RMSE 0.002\n",
"Link Norm RMSE 1.026\n",
"Link Weighted RPD 0.850\n",
"Net Error -0.346\n",
"Actual Dist/Energy 18.872\n",
"Predicted Dist/Energy 28.876\n",
"Trip RPD 0.419\n",
"Trip Weighted RPD 0.419\n",
"Trip RMSE 0.014\n",
"Trip Norm RMSE 0.346\n",
"=========================================\n",
"Feature Set ID: grade&speed\n",
"Target: gallons_fastsim\n",
"Link RMSE 0.001\n",
"Link Norm RMSE 0.870\n",
"Link Weighted RPD 0.614\n",
"Net Error -0.165\n",
"Actual Dist/Energy 18.872\n",
"Predicted Dist/Energy 22.591\n",
"Trip RPD 0.179\n",
"Trip Weighted RPD 0.179\n",
"Trip RMSE 0.007\n",
"Trip Norm RMSE 0.165\n",
"=========================================\n",
"Feature Set ID: grade&road_class&speed\n",
"Target: gallons_fastsim\n",
"Link RMSE 0.001\n",
"Link Norm RMSE 0.874\n",
"Link Weighted RPD 0.601\n",
"Net Error -0.150\n",
"Actual Dist/Energy 18.872\n",
"Predicted Dist/Energy 22.201\n",
"Trip RPD 0.162\n",
"Trip Weighted RPD 0.162\n",
"Trip RMSE 0.006\n",
"Trip Norm RMSE 0.150\n",
"========================================="
"====================================================\n",
"Feature Set ID: speed_mph\n",
"Target: gallons_fastsim\n",
"Link RMSE 0.002\n",
"Link Norm RMSE 1.026\n",
"Link Weighted RPD 0.850\n",
"Net Error -0.346\n",
"Actual Dist/Energy 18.872\n",
"Predicted Dist/Energy 28.876\n",
"Real World Predicted Dist/Energy 24.765\n",
"Trip RPD 0.419\n",
"Trip Weighted RPD 0.419\n",
"Trip RMSE 0.014\n",
"Trip Norm RMSE 0.346\n",
"====================================================\n",
"Feature Set ID: grade_dec&speed_mph\n",
"Target: gallons_fastsim\n",
"Link RMSE 0.001\n",
"Link Norm RMSE 0.870\n",
"Link Weighted RPD 0.614\n",
"Net Error -0.165\n",
"Actual Dist/Energy 18.872\n",
"Predicted Dist/Energy 22.591\n",
"Real World Predicted Dist/Energy 19.375\n",
"Trip RPD 0.179\n",
"Trip Weighted RPD 0.179\n",
"Trip RMSE 0.007\n",
"Trip Norm RMSE 0.165\n",
"====================================================\n",
"Feature Set ID: grade_dec&road_class&speed_mph\n",
"Target: gallons_fastsim\n",
"Link RMSE 0.001\n",
"Link Norm RMSE 0.874\n",
"Link Weighted RPD 0.601\n",
"Net Error -0.150\n",
"Actual Dist/Energy 18.872\n",
"Predicted Dist/Energy 22.201\n",
"Real World Predicted Dist/Energy 19.040\n",
"Trip RPD 0.162\n",
"Trip Weighted RPD 0.162\n",
"Trip RMSE 0.006\n",
"Trip Norm RMSE 0.150\n",
"===================================================="
]
},
"execution_count": 11,
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -382,9 +385,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "routee-powertrain",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "routee-powertrain"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand Down

0 comments on commit 926082f

Please sign in to comment.