Created
February 6, 2025 07:52
-
-
Save devishot/829ad187d58d0d5084d47a562fb14d90 to your computer and use it in GitHub Desktop.
Google Machine Learning Crash Course: Linear regression > taxi fare model training exercise
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INFO: starting training experiment with features=['TRIP_MILES', 'TRIP_MINUTES'] and label=FARE | |
Epoch 1/20 | |
<ipython-input-19-8892146dfcd1>:8: SettingWithCopyWarning: | |
A value is trying to be set on a copy of a slice from a DataFrame. | |
Try using .loc[row_indexer,col_indexer] = value instead | |
See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy | |
634/634 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - loss: 3884.8274 - root_mean_squared_error: 62.2386 | |
Epoch 2/20 | |
634/634 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - loss: 1510.9357 - root_mean_squared_error: 38.7442 | |
Epoch 3/20 | |
634/634 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - loss: 273.6273 - root_mean_squared_error: 16.3169 | |
Epoch 4/20 | |
634/634 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - loss: 24.8084 - root_mean_squared_error: 4.9753 | |
Epoch 5/20 | |
634/634 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - loss: 15.6657 - root_mean_squared_error: 3.9543 | |
Epoch 6/20 | |
634/634 ━━━━━━━━━━━━━━━━━━━━ 2s 2ms/step - loss: 12.2236 - root_mean_squared_error: 3.4927 | |
Epoch 7/20 | |
634/634 ━━━━━━━━━━━━━━━━━━━━ 2s 2ms/step - loss: 11.2817 - root_mean_squared_error: 3.3472 | |
Epoch 8/20 | |
634/634 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - loss: 12.3543 - root_mean_squared_error: 3.5082 | |
Epoch 9/20 | |
634/634 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - loss: 12.9035 - root_mean_squared_error: 3.5800 | |
Epoch 10/20 | |
634/634 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - loss: 11.3703 - root_mean_squared_error: 3.3635 | |
Epoch 11/20 | |
634/634 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - loss: 12.7864 - root_mean_squared_error: 3.5701 | |
Epoch 12/20 | |
634/634 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - loss: 12.7018 - root_mean_squared_error: 3.5578 | |
Epoch 13/20 | |
634/634 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - loss: 12.3804 - root_mean_squared_error: 3.5061 | |
Epoch 14/20 | |
634/634 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - loss: 11.4949 - root_mean_squared_error: 3.3811 | |
Epoch 15/20 | |
634/634 ━━━━━━━━━━━━━━━━━━━━ 2s 2ms/step - loss: 13.1091 - root_mean_squared_error: 3.6081 | |
Epoch 16/20 | |
634/634 ━━━━━━━━━━━━━━━━━━━━ 2s 2ms/step - loss: 11.4416 - root_mean_squared_error: 3.3735 | |
Epoch 17/20 | |
634/634 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - loss: 10.9564 - root_mean_squared_error: 3.3044 | |
Epoch 18/20 | |
634/634 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - loss: 12.4541 - root_mean_squared_error: 3.5195 | |
Epoch 19/20 | |
634/634 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - loss: 11.0418 - root_mean_squared_error: 3.3155 | |
Epoch 20/20 | |
634/634 ━━━━━━━━━━━━━━━━━━━━ 1s 2ms/step - loss: 12.2511 - root_mean_squared_error: 3.4926 | |
SUCCESS: training experiment complete | |
-------------------------------------------------------------------------------- | |
| MODEL INFO | | |
-------------------------------------------------------------------------------- | |
Weight for feature[TRIP_MILES]: 2.030 | |
Weight for feature[TRIP_MINUTES]: 0.142 | |
Bias: 3.828 | |
FARE = 2.030 * TRIP_MILES + 0.142 * TRIP_MINUTES + 3.828 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-------------------------------------------------------------------------------- | |
| PREDICTIONS | | |
-------------------------------------------------------------------------------- | |
PREDICTED_FARE OBSERVED_FARE L1_LOSS TRIP_MILES TRIP_MINUTES | |
0 $18.33 $18.25 $0.08 4.90 32.00 | |
1 $45.11 $43.25 $1.86 17.37 42.30 | |
2 $31.50 $31.75 $0.25 11.98 23.52 | |
3 $27.43 $27.00 $0.43 9.77 26.47 | |
4 $74.23 $76.75 $2.52 31.06 51.58 | |
5 $7.25 $9.00 $1.75 1.26 6.03 | |
6 $5.96 $5.75 $0.21 0.70 5.00 | |
7 $6.95 $9.00 $2.05 1.00 7.65 | |
8 $33.96 $34.00 $0.04 12.60 32.00 | |
9 $27.32 $26.00 $1.32 9.21 33.63 | |
10 $44.20 $43.25 $0.95 17.54 33.48 | |
11 $45.33 $45.00 $0.33 18.20 32.00 | |
12 $17.74 $17.25 $0.49 5.20 23.58 | |
13 $30.70 $30.50 $0.20 11.20 29.00 | |
14 $43.36 $43.50 $0.14 17.30 31.00 | |
15 $19.37 $19.25 $0.12 6.81 12.03 | |
16 $17.82 $17.25 $0.57 5.70 17.00 | |
17 $16.05 $15.75 $0.30 4.90 16.00 | |
18 $9.01 $8.25 $0.76 2.20 5.00 | |
19 $6.10 $5.75 $0.35 0.79 4.68 | |
20 $17.17 $17.50 $0.33 5.10 21.00 | |
21 $6.34 $5.75 $0.59 0.85 5.53 | |
22 $41.13 $43.80 $2.67 14.94 48.95 | |
23 $40.63 $41.25 $0.62 16.74 19.78 | |
24 $46.86 $46.50 $0.36 17.90 47.00 | |
25 $7.06 $6.75 $0.31 1.10 7.00 | |
26 $21.07 $20.50 $0.57 7.30 17.00 | |
27 $7.20 $6.75 $0.45 1.13 7.57 | |
28 $19.21 $19.50 $0.29 6.13 20.65 | |
29 $41.56 $40.50 $1.06 15.50 44.00 | |
30 $31.48 $31.75 $0.27 11.62 28.50 | |
31 $24.60 $24.25 $0.35 8.90 19.00 | |
32 $17.99 $18.00 $0.01 5.66 18.78 | |
33 $22.49 $22.50 $0.01 7.70 21.27 | |
34 $22.16 $21.00 $1.16 6.44 36.92 | |
35 $9.50 $9.00 $0.50 2.09 10.05 | |
36 $24.32 $24.50 $0.18 8.50 22.70 | |
37 $30.02 $30.25 $0.23 11.50 20.00 | |
38 $43.81 $45.00 $1.19 17.80 27.02 | |
39 $9.08 $9.00 $0.08 1.80 11.23 | |
40 $5.62 $5.25 $0.37 0.60 4.00 | |
41 $6.17 $5.50 $0.67 0.88 3.92 | |
42 $14.91 $14.50 $0.41 4.22 17.68 | |
43 $6.36 $5.25 $1.11 0.84 5.82 | |
44 $15.60 $14.93 $0.67 4.74 15.12 | |
45 $28.72 $36.00 $7.28 8.06 59.92 | |
46 $21.79 $20.50 $1.29 7.26 22.63 | |
47 $12.50 $12.00 $0.50 3.50 11.00 | |
48 $9.39 $9.00 $0.39 2.27 6.67 | |
49 $16.36 $15.75 $0.61 5.40 11.00 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment