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
| hierarchy = dict() | |
| # Fill in grouping by reason | |
| for reason in reasons: | |
| hierarchy[reason] = ["Total"] | |
| # Fill in grouping by region | |
| for region in regions: | |
| hierarchy[region] = ["Total"] |
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
| reasons = ["Hol", "VFR", "Bus", "Oth"] | |
| regions = ["NSW", "VIC", "QLD", "SA", "WA", "TAS", "NT"] | |
| city_labels = ["city", "noncity"] | |
| tourism_series["Total"].plot(label="total", lw=12, color="grey") | |
| sum([tourism_series[region] for region in regions]).plot( | |
| label="sum regions", lw=7, color="orange" | |
| ) | |
| sum([tourism_series[reason] for reason in reasons]).plot( | |
| label="sum reasons", lw=3, color="blue" |
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
| sum_city_noncity = ( | |
| tourism_series["NSW - hol - city"] + tourism_series["NSW - hol - noncity"] | |
| ) | |
| sum_city_noncity.plot(label="NSW - hol, city+noncity", lw=8, color="grey") | |
| tourism_series["NSW - hol"].plot(color="orange") |
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
| tourism_series[["Total", "NSW", "NSW - bus", "NSW - hol", "NSW - bus - city"]].plot() |
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
| tourism_series = AustralianTourismDataset().load() |
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
| # load M3 dataset | |
| m3_train, m3_test = load_m3() | |
| # naive last | |
| naive1_smapes_m3, naive1_time_m3 = eval_local_model( | |
| m3_train, m3_test, NaiveSeasonal, K=1 | |
| ) | |
| # naive seasonal | |
| naive12_smapes_m3, naive12_time_m3 = eval_local_model( |
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
| theta_smapes_m3, theta_time_m3 = eval_local_model(m3_train, m3_test, Theta) |
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
| ets_smapes_m3, ets_time_m3 = eval_local_model(m3_train, m3_test, ExponentialSmoothing) |
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
| naive12_smapes_m3, naive12_time_m3 = eval_local_model( | |
| m3_train, m3_test, NaiveSeasonal, K=12 | |
| ) |
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
| naive1_smapes_m3, naive1_time_m3 = eval_local_model( | |
| m3_train, m3_test, NaiveSeasonal, K=1 | |
| ) |