Ranking, Scoring and Decisions with XGBoost

Improve AI is a machine learning platform that leverages the capabilities of XGBoost to efficiently score and rank items using a reward-based training approach.

Scoring and ranking lie at the heart of recommendation systems, personalization, query re-ranking, automated decisions, and multi-variate optimization.

Although XGBoost is proficient at estimating values, Improve AI augments it in several ways:

  • Score or rank any JSON-encodable object in Python, Swift, or Java without additional feature encoding
  • Smartly balance exploration vs exploitation using Thompson Sampling
  • Train updated models with intuitive reward-based learning
  • On-device scoring and ranking for iOS and Android apps

Simple APIs

With Swift, Python, or Java, create a list of JSON encodable items and simply call Ranker.rank(items).

For instance, in an iOS bedtime story app, you may have a list of Story objects:

struct Story: Codable {
    var title: String
    var author: String
    var pageCount: Int

To obtain a ranked list of stories, use just one line of code:

let rankedStories = try Ranker(modelUrl).rank(stories)

Simple Training

Easily train your rankers using reinforcement learning.

First, track when an item is used:

let tracker = RewardTracker("stories", trackUrl)
let rewardId = tracker.track(story, from: rankedStories)

Later, if a positive outcome occurs, provide a reward:

if (purchased) {
    tracker.addReward(profit, rewardId)

Reinforcement learning uses positive rewards for favorable outcomes (a “carrot”) and negative rewards for undesirable outcomes (a “stick”). By assigning rewards based on business metrics, such as revenue or conversions, the system optimizes these metrics over time.

Contextual Ranking & Scoring

Improve AI turns XGBoost into a contextual multi-armed bandit, meaning that context is considered when making ranking or scoring decisions.

Often, the choice of the best variant depends on the context that the decision is made within. Let’s take the example of greetings for different times of the day:

greetings = ["Good Morning", 
             "Good Afternoon", 
             "Good Evening",
             "Buenos Días",
             "Buenas Tardes",
             "Buenas Noches"]

rank() also considers the context of each decision. The context can be any JSON-encodable data structure.

ranked = ranker.rank(items=greetings, 
                     context={ "day_time": 12.0,
                               "language": "en" })
greeting = ranked[0]

Trained with appropriate rewards, Improve AI would learn from scratch which greeting is best for each time of day and language.

Proven Performance

Improve AI is a production ready implementation of a contextual multi-armed bandit algorithm, developed through years of iteration. By merging Thompson Sampling with XGBoost, it provides a learning system that is both fast and flexible. Thompson Sampling maintains equilibrium between exploring novel possibilities and capitalizing on established options, while XGBoost ensures cost-effective, high-performance training for updated models.

Get Started Today

Improve AI is available now for Python, Swift, and Java. Check out the Quick-Start Guide for more information.

Thank you for your efforts to improve the world a little bit today.

Recent Posts

2 minute read

Making Decisions with Ranker

1 minute read

In this tutorial, we’ll walk through how to use the Ranker class to make decisions, specifically choosing a discount to offer from a list of discounts. We’ll...