How we Auto Classify Rides using Machine Learning

How we Auto Classify Rides using Machine Learning
Photo by Alex Eckermann / Unsplash

We're excited to introduce a new service in Psngr app version 4.8: Automatic Classification of trips. Auto-classification uses the latest Machine Learning (ML) techniques in predictive data analysis and utilizes the excellent Scikit-learn framework in order to automatically assign hashtags (i.e. classify) newly logged trips.

What is ride classification?

Psngr app logs your trips automatically using your mobile device location and motion sensors. Once a trip is logged, it must be classified as either business-related or personal. Business trips can be submitted for reimbursement or tax deduction by downloading a mileage expense report.

Psngr app uses hashtags to classify trips, e.g. #business or #personal. These hashtags are used to assign a mileage rate to the trip (each mileage rate in the app uses a single hashtag) in order to calculate mileage expenses. The app bundles standard mileage rates for the hashtag #business, based on the information published by the tax authority. However, you can also add custom mileage rates in order to separate mileage expenses for different businesses, for instance, #uber, #grubhub, #doordash, etc.

Until recently, all new trips logged by the app were unclassified and had to be manually classified by swiping a trip to the right (#business), to the left (#personal), or by typing the hashtag into the trip's notes. This can be a tedious task when you make a dozen trips per day.

Automatic classification

Enter automatic trip classification. Auto-classification uses machine learning (ML) to automatically classify similar or repeating trips. When a new trip is logged, the system will try to match it against previously logged trips with the same start/end locations, and a similar route. Those previously logged trips are then used as a reference in order to classify the new trip.

The ML engine identifies each trip based on key "features", namely the start and end locations, the route, the vehicle used, and the mode of transport. These features are used to "train" a model in order to predict which hashtags should be assigned to the new trip, based on the hashtags used in previously logged (and classified) trips.

As an example, if you often drive from home to the office and have previously classified these rides as #commute, Psngr will auto-classify each new home-to-work ride as #commute. This will happen automatically without your intervention. When you open Psngr app, a summary of your auto-classified trips will be displayed at the top of the "Trips" list, for your review.

In order for Automatic Trip Classification to be able to auto-classify a new trip, there must be a few similar trips in your logbook that are already classified. If you often merge trips together, it may be difficult for the ML engine to do its job, because merged trips have many intermediate stops and tend to have a very distinct route from start to finish.

Automatic trip classification is intended to save time and effort for the driver and to help in maintaining a complete and adequate mileage logbook.

We hope that you will find Psngr's Automatic Trip Classification useful and accurate enough. If you don't, please provide us feedback via the app (Settings > Send Feedback). You can also disable Automatic Trip Classification via the app's Settings > Tracking menu.