Prediction value not changing
Hello, I'm I've created an application based on the taxi fare predictor tutorial. My model is based on sales figures (Jan 2010 - Dec 2017) and I'm then predicting the sales figures for Jan 2018. After some tuning I get a pretty accurate prediction, however when I change the month from Jan to Feb, I get exactly the same prediction, no matter what I change the month to for the year 2018 I get the same prediction. My test data has these fields:
Year,Month,SalesAmount 2010,1,3186.88 2010,2,8317.89 2010,3,11835.68 2010,4,12344.42 2010,5,13690.09 2010,6,17123.63 2010,7,19190.52 2010,8,25912.26 2010,9,19215.96 2010,10,11616.9 2010,11,10208.86 2010,12,10374.89 2011,1,2122.46 2011,2,7469.42 2011,3,3774.12 2011,4,6407.39 2011,5,5922.64 2011,6,5794.8 2011,7,4905.96 2011,8,5538.52 2011,9,4163.58 2011,10,5695.7 2011,11,2882.16 2011,12,2452.39 2012,1,1680.7 2012,2,2498.42 2012,3,3139.95 2012,4,3894.75 2012,5,3662.62 2012,6,3486.15 2012,7,3386.24 2012,8,2545.98 2012,9,2225.79 2012,10,3915.02 2012,11,2022.48 2012,12,1095.22 2013,1,1114.68 2013,2,866.88 2013,3,1718.16 2013,4,1606.22 2013,5,1818.3 2013,6,2399.12 2013,7,2396.23 2013,8,2228.29 2013,9,2081.05 2013,10,2520.33 2013,11,2872.11 2013,12,1136.24 2014,1,1689.73 2014,2,2000.85 2014,3,2512.69 2014,4,2610.9 2014,5,2384.45 2014,6,3110.15 2014,7,2825.04 2014,8,2393.9 2014,9,2226.63 2014,10,3185.85 2014,11,1442.03 2014,12,3685.21 2015,1,1334.62 2015,2,1423 2015,3,2023.23 2015,4,2796.21 2015,5,2258.58 2015,6,2451.39 2015,7,2413.47 2015,8,1616.49 2015,9,2229.43 2015,10,2407.46 2015,11,2006.48 2015,12,1210.23 2016,1,1271.16 2016,2,1997.15 2016,3,2352.73 2016,4,2226.63 2016,5,1617.79 2016,6,2181.54 2016,7,2586.99 2016,8,2080.21 2016,9,1814.67 2016,10,1497.75 2016,11,1299.86 2016,12,1955.21 2017,1,1213.55 2017,2,1238.69 2017,3,1613.29 2017,4,710.98 2017,5,2061.93 2017,6,1195.74 2017,7,1121.89 2017,8,784.25 2017,9,1245.3 2017,10,861.13 2017,11,1118.42 2017,12,820.13
Is this normal behaviour or is there something I should change in my application. The learning algorithm I am using is:
FastTreeTweedieRegressor NumLeaves = 3000, NumTrees = 3000, MinDocumentsInLeafs = 5 }
Thanks
Document details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: a30b3ff5-b5e6-ff02-6f60-b5cef6f34666
- Version Independent ID: fdf962e2-620e-d9ad-5057-5f96f52dc60f
- Content: Use ML.NET to predict New York taxi fares (regression)
- Content Source: docs/machine-learning/tutorials/taxi-fare.md
- Product: dotnet-ml
- GitHub Login: @aditidugar
- Microsoft Alias: johalex
I have the same behavior/issue. My input data:
2017;3;11;5.117983011
2017;5;5;10.85726233
2017;5;11;4.9363549
2017;5;15;4.168054875
2017;5;22;1.808437371
2017;6;1;1.77953571
2017;6;17;1.837746844
2017;6;28;1.7118648
2017;7;2;1.6862808
2017;7;15;2.265814223
2017;8;12;1.356510332
2017;8;26;3.383309164
2017;8;31;7.43608554
2017;9;13;2.148334085
2017;9;16;3.1979098
2017;9;22;3.0344141
2017;9;30;2.881911525
2017;10;7;3.936128271
2017;10;24;7.034847529
2017;11;11;5.7642146
2017;11;18;6.367683643
2017;11;25;6.574024929
2017;12;9;6.6723687
2017;12;16;7.155164786
2017;12;22;8.08369735
2017;12;29;6.371872671
2018;1;4;6.326874
2018;1;8;6.097986375
2018;1;18;8.73519924
2018;2;10;7.762882957
2018;2;17;7.9271655
2018;3;3;12.58366524
2018;3;10;16.42336063
2018;3;20;11.20116597
2018;3;24;13.45886295
2018;3;28;9.94829535
2018;4;4;9.810729514
2018;4;7;7.8172609
2018;4;14;2.374643271
2018;4;20;2.91054285
2018;4;28;2.8000827
2018;5;1;3.0487559
2018;5;12;2.114015536
2018;5;19;2.204727557
2018;5;26;1.962783043
2018;6;9;1.7996499
2018;6;22;1.836687092
2018;7;6;1.951673507
2018;7;28;1.922153427
2018;8;22;2.07167424
2018;9;6;2.1692075
2018;9;11;2.15701164
My code is:
var pipeline = new LearningPipeline();
pipeline.Add(new TextLoader("Prad/prad.csv").CreateFrom<PradModel>(separator: ';'));
pipeline.Add(new ColumnCopier((nameof(PradModel.Price), "Label")));
pipeline.Add(new ColumnTypeConverter(
nameof(PradModel.Year),
nameof(PradModel.Month),
nameof(PradModel.Day)
));
pipeline.Add(new ColumnConcatenator("Features",
nameof(PradModel.Year),
nameof(PradModel.Month),
nameof(PradModel.Day)
));
pipeline.Add(new FastTreeRegressor());
model = pipeline.Train<PradModel, PradRegression>();
Those data is from 11.03.2017 to 11.09.2018 so I want to predict 2018.10 day by day but results for 2018.11 are the same. Is it ok or I do something wrong?
I found the issue. I wasn't changing the month value in my Sales.cs class (which is based on the TaxiTrip.cs class in the example -- internal static readonly TaxiTrip Trip1 = new TaxiTrip).
Working for me now.
@OnlyChildRecords - Great to hear! Thanks for letting us know it's been resolved!