Forecasting Environmental Reports forVehicles Using Machine Learning: Predicting Fuel Consumption from buses data Using KNNand ANN Models
2025 (English)Independent thesis Basic level (degree of Bachelor), 10 credits / 15 HE credits
Student thesis
Abstract [sv]
Att korrekt prognostisera miljödata är inte lätt för kollektivtrafikföretag som försöker nå hållbarhetsmål och framtida planering. I detta projekt användes maskininlärning för att förutsäga månatlig bränsleförbrukning baserat på planerad resedata. Två modeller testades: K-Nearest Neighbor (KNN), känd för sin enkelhet, och ett artificiellt neuralt nätverk (ANN), som kan lära sig mer komplexa mönster. Fem olika inmatningskonfigurationer skapades för att utvärdera hur olika kombinationer av funktioner påverkar prestandan. Modellerna utvärderades med hjälp av bestämningskoefficient (R²) och förklaringsmetoder användes för att bättre förstå resultaten. Permutationsviktighet användes för KNN och Shapley Additive ExPlanations (SHAP)-värden tillämpades på ANN. Resultaten visade att ANN presterade något bättre än KNN i de flesta fall, med jämnare träningsbeteende och bättre förmåga att fånga icke-linjära samband. Men KNN presterade också bra i enklare uppsättningar med starka funktioner vad gäller noggrannhet. De mest användbara indatavariablerna var de utvecklade funktionerna PlannedDistance, PlannedDrivingTime och StartHour.BProjektet visade att noggranna förutsägelser kan göras med endast data från det planerade schemat, vilket innebär att lösningen kan integreras i befintliga system. Detta gör den till ett praktiskt verktyg för att förbättra hållbarhetsrapportering och ruttplanering inom kollektivtrafiksektorn.
Abstract [en]
Accurately forecasting environmental data is not easy for public transport companies seeking to reach sustainability goals and future planning. In this project, machine learning was used to predict monthly fuel usage based on planned trip data. Two models were tested: K-Nearest Neighbor(KNN), known for its simplicity and an Artificial Neural Network(ANN), which can learn more complex patterns. Five different input configurations were created to evaluate how different combinations of features affect performance. The models were evaluated using Coefficient of determination(R²) and explainability methods were used to better understand the results. Permutation importance was used for KNN and Shapley Additive exPlanations(SHAP) values were applied to ANN. The results showed that ANN slightly outperformed KNN in most cases, with smoother training behavior and better ability to capture non-linear relationships. But KNN also performed well in simpler setups with strong features in terms of accuracy. The most useful input variables were the engineered features PlannedDistance, PlannedDrivingTime, and StartHour. The project showed that accurate predictions can be made using only data from the planned schedule, which means the solution can be integrated into existing systems. This makes it a practical tool for improving sustainability reporting and route planning in the public transport sector.
Place, publisher, year, edition, pages
2025. , p. 55
Keywords [en]
Machine Learning, K-Nearest Neighbor, Artificial Neural Network
Keywords [sv]
Maskininlärning, K-närmaste granne, artificiellt neuralt nätverk
National Category
Software Engineering
Identifiers
URN: urn:nbn:se:miun:diva-54854Local ID: DT-V25-G3-028OAI: oai:DiVA.org:miun-54854DiVA, id: diva2:1978123
Educational program
Computer Science TDATG 180 higher education credits
Supervisors
Examiners
2025-06-272025-06-272025-09-25Bibliographically approved