Winning the Ride-Sharing Startup Battle with Personalization: A Java How-to
30 Sep 2013

UseCase-RideSharing

Ride sharing startups have cropped up at a high speed in recent years, disrupting the traditional cab service industry by giving users more flexibility and control over the vehicles they hire. Companies such as Uber, Lyft, Zypsee, Sidecar, InstantCab, Flywheel, GetTaxi, Zimride, HAILO, and LeCab are all ride-sharing or on-demand car service apps which provide users with services such as GPS tracking of the vehicles, mobile one-tap hailing, and more. The competition between these services has become so fierce that Uber recently launched a price war against one of its major competitors, Lyft, by offering free rides in select cities.

While users of these services are enjoying greater convenience and more competitive prices than before, ride-sharing startups need to up their game to secure customer loyalty in the long term. One way of doing it is to enhance the user experience by personalizing the service. This is where Machine Learning technology enters the picture. In fact, many ride-sharing apps already allow users to give ratings and reviews after taking a ride, which can potentially make the service more personalized.

UseCase-RideSharing-Screen

By using PredictionIO, you can personalize future rides for your users by recommending drivers based on the ratings given by the same user, or users with similar rating patterns.

PredictionIO may also open up the possibility of sightseeing recommendations, or suggestions on noteworthy locations and spots for tourists and people new to an area. For example, after taking a ride to Fisherman’s Wharf in San Francisco, a user may get suggestions to go to Golden Gate Bridge or Ferry Building, which are popular sights that other visitors to Fisherman’s Wharf have also been to.

We’re going to show you how to make your ride-sharing apps more personalized for your users with PredictionIO:

 

Personalized Recommendation of Drivers

The example below shows you how to recommend drivers to users based on their previous ratings and their current locations. The top five matches are recommended to each user based on his/her personal preference.

Step 1: Install PredictionIO Server

Follow the instructions to install PredictionIO.

When the installation is complete, go to the PredictionIO Admin Panel to add a new application (app) for the service you are building. You will then obtain an App Key, which is needed later when you integrate the PredictionIO SDK.

Step 2: Install the SDK in Your Development Language

PredictionIO provides SDK in various languages. Java is used in this example. We also have a quick integration guide for Android developers.

Add the following lines to the dependency configuration file of the Java project:

If you use Maven, simply add the dependency to your pom.xml:

If you use Ivy, simply add the dependency to your ivy.xml:

 

 

Step 3: Integrate the PredictionIO SDK into Your Application for Importing Data

Now you have finished the integration which handles the data import.

Step 4: Create an Item Recommendation Engine

Go to the PredictionIO Admin Panel, add an Item Recommendation Engine. Specify an engine name that will be used in your code to retrieve prediction results from this engine (e.g. itemrec-driver). Since this engine is responsible for driver recommendation, it needs to process item and behavioral data related to “drivers” only. Therefore, add the item type “drivers” in the “Item Type Settings” instead of including all item types.

This engine can now generate personalized driver recommendation to users based on the imported data. The default algorithm will be deployed automatically, but you can fine-tune it later. Alternatively, there are a number of different built-in algorithms to choose from.

When the engine status changes to “Running”, it means the prediction results are ready.

Step 5: Query Prediction Results.

 

 

Suggest Similar Sightseeing Spots

As mentioned above, PredictionIO can also empower your app to give sightseeing suggestions based on the users’ previous destinations.

You need to record the data of users’ destinations this time:

Go to the PredictionIO Admin Panel, add an Item Similarity Engine, and add the item type “destinations” in the “Item Type Settings”. This engine will recommend similar destinations to users based on their previous destinations.

Now you can recommend similar sightseeing spots with the code below:

 

Personalizing your ride-sharing app could not be easier. In fact, PredictionIO can virtually make any app smarter, with ride-sharing apps being just one example. Try out PredictionIO for yourself!