57
Applying Machine Learning to Mobile Games Neil Patrick Del Gallego An example of supervised learning for predictive game analytics

Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Embed Size (px)

Citation preview

Page 1: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Applying Machine

Learning to Mobile Games

Neil Patrick Del Gallego

An example of supervised learning for predictive game analytics

Page 2: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Who Am I

Software Engineer and Game Developer for 5 years.Developed Dragon Cubes along with other team membersDeveloped Bubble CubesCurrently developing Casino Slots

Page 3: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Who Am I

Also currently taking Masters of Science in Computer Science in DLSU.

Page 4: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

What is machine learning?

Page 5: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Machine Learning

Field of study that gives the computer the ability to learn and recognize patterns.

Image R G B Name

A 255 255 255 Animal

B 255 0 0 Animal

C 132 122 230 Plant

D 89 134 200 Plant

Training Dataset Machine Learning

Algorithm Prediction Model/s

Animal? Plant?

Page 6: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Supervised Learning

The class to predict is explicitly given in the dataset

TRAINING

DATASET

Image R G B Name

A 255 255 255 Animal

B 255 0 0 Animal

C 132 122 230 Plant

D 89 134 200 Plant

Page 7: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Supervised Learning

Prediction model attempts to predict the missing class value

TRAINING

DATASET

NEW/UNSEEN

DATASET

Image R G B Name

A 255 255 255 Animal

B 255 0 0 Animal

C 132 122 230 Plant

D 89 134 200 Plant

Image R G B Name

E 0 0 255 ??

F 255 0 0 ??

G 0 122 125 ??

H 98 7 2 ??

Page 8: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Data Mining

• Extract patterns or provide insights from a complex dataset.

• Borrows techniques from machine learning and statistics.

Page 9: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Data Mining

• Patterns should be:• Non-trivial (not normally extracted in an SQL

statement)• Unknown• Unexpected• Potentially useful• Actionable

Page 10: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Why Data Mining?

Drowning in data but starved for knowledge

Unstructured data, or knowledge is deeply buried.

Page 11: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Predicting Daily Active Users for Match-3 Mobile Games

Application of supervised learning for Dragon Cubes and Jungle Cubes

Page 12: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

It’s been published!

Page 13: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Daily Active Users

A measure of application virality. A very important metric to gauge the success of an application.

Page 14: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Motivation

Attempt to determine the amount of user activity X days ahead to assist on project planning.

X = 7, on our study

Page 15: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Marketing expenses

Daily active users

Develop features to make users stay

Page 16: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Where data was extracted

MARKETING DATA

Page 17: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Dataset Overview

• Two match-3 games

• JNC generating revenue

• DNC does not

• Both games only differ in game mechanics.

Page 18: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

General Methodology of Data Mining*

*How I performed data mining on our data*For supervised learning. Unsupervised learning use subjective evaluation to determine reliability of model.

Dataset

Feature Selection

Refined

Dataset

Machine Learning

Prediction Models

Model A Model B

Model C Model D

Unseen

Data

Predicted

Result

Accuracy

Measure

Page 19: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Features in Dataset

Users are reached via advertising channels

MKTExpenses This is the total amount of marketing expenses, in USD, spent to advertise the game.

A high marketing expense means more advertising channels have been used to target more potential users to install the game.

Page 20: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Advertising amount per user per country*

● Users are reached via advertising channels.

*Market insight taken from Chartboost: http://tinyurl.com/charboost

Page 21: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Features in Dataset

How many users discovered our app on a given date?

Install Date Calendar date of installation.

Cohort Size Refers to the total amount of users who have installed the application on the given install date.

Session Count Refers to the total amount of play sessions on a given install date.

Page 22: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Features in Dataset

How long do players play the game?

AvgSessionSeconds The arithmetic mean of the total amount of time users spend in the game

MedianSessionSeconds Session length value where half of the sessions are longer, and half are shorter.

Page 23: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Features in Dataset

Market impression of the game

DailyAverageRating

Page 24: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Features in Dataset

Market impression of the game

CrashesANRDay1

Page 25: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Features in Dataset

How many users are engaged?

ActiveUsers This refers to the total amount of unique users who spent considerable time in the game given a certain date.

ActiveUsersDay7 This is similar to the ActiveUsers variable but offset 7 days after the install date. This is the variable to be predicted.

Page 26: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Features in Dataset

Screen that triggers the events

LevelPlayedEvents

LevelSuccessEvents

LevelFailedEvents

Page 27: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Dataset

Page 28: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Applying Methodology

Dataset

Feature Selection

Refined

Dataset

Machine Learning

Prediction Models

Model A Model B

Model C Model D

Unseen

Data

Predicted

Result

Accuracy

Measure

Page 29: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Feature Selection

Filter out unneeded attributesDetermine what attributes matters

Page 30: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Correlation Analysis

Measure relationship of two variables.As X grows, how fast Y grows/declines? Range (-1.0 to +1.0)

0.0 means no relationship at all.+1.0 strong positive relationship-1.0 strong negative relationship

Page 31: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Correlation Analysis

0.7 as our threshold for strong relationship.

Basis for manual feature selection.

Page 32: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Automatic Feature Selection

Automatic Feature Selection

CSV file Filtered

CSVAcceptable?

Manual feature

selection

NO

YES Final CSV for training

*Wrappers for feature subset selection by Ron Kohavi a,, George H. John b, (1995)

Wrapper scheme* algorithm is used for automatic feature selection.

Page 33: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Automatic Feature Selection

Automatic Feature Selection

CSV file Filtered

CSVAcceptable?

Manual feature

selection

NO

YES Final CSV for training

● Despite using the wrapper scheme, some selected features are considered noise.

● Evaluate if the selected features are indeed valuable.

Page 34: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Applying Methodology

Dataset

Feature Selection

Refined

Dataset

Machine Learning

Prediction Models

Model A Model B

Model C Model D

Unseen

Data

Predicted

Result

Accuracy

Measure

Page 35: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Selected Attributes

Page 36: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Applying Methodology

Dataset

Feature Selection

Refined

Dataset

Machine Learning

Prediction Models

Model A Model B

Model C Model D

Unseen

Data

Predicted

Result

Accuracy

Measure

Page 37: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Applying Machine Learning

Using M5Base or decision tree with regression

Page 38: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Machine Learning Technique

Using M5Base (decision tree with regression)WEKA demo (if possible)

Page 39: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

M5Base sample

Page 40: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Problem!

We do not have enough unseen data yet!What do we do to test our model?

Page 41: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

K-fold cross-validation

Divide dataset into K partitions (recommended 10)

Test

setTraining set

Page 42: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

K-fold cross-validation

Divide dataset into K partitions (recommended 10)

Test

setTraining set

Traini

ng

set

Page 43: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

K-fold cross-validation

Divide dataset into K partitions (recommended 10)

Test

setTraining setTraining set

Page 44: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

K-fold cross-validation

Divide dataset into K partitions (recommended 10)

Test

set Training setTraining set

Page 45: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Applying Methodology

Dataset

Feature Selection

Refined

Dataset

Machine Learning

Prediction Models

Model A Model B

Model C Model D

Unseen

Data

Predicted

Result

Accuracy

Measure

Page 46: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Unseen Data Sample

Page 47: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Applying Methodology

Dataset

Feature Selection

Refined

Dataset

Machine Learning

Prediction Models

Model A Model B

Model C Model D

Unseen

Data

Predicted

Result

Accuracy

Measure

Page 48: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Accuracy Measure

A value close to 0.0 is not really significant.

Page 49: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Accuracy Measure

Magnitude of error of predicted value vs actual value. Lower is better.

Page 50: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Accuracy Measure

Percentage of error of predicted value vs actual value. Lower is better.

Page 51: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

InterpretationsUsing results from M5Base.

*More details available at: http://www.dlsu.edu.ph/conferences/dlsu-research-congress-proceedings/2016/GRC/GRC-HCT-I-001.pdf

Page 52: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Interpretations

M5Base performed exceptionally well on JNC-Test (unseen data), which makes it recommendable for real-world use.

Page 53: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Interpretations

Jungle Cubes is potentially, a predictable scaleable game.

Page 54: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Interpretations

JNC and DNC have almost the same total advertising expense. But DNC did not gain enough daily active users.

Positive correlation summary JNC DAU-Day7 DNC DAU-Day7

MKTExpenses High Low

SessionCount High Low

SessionLength High Low

Page 55: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Interpretations

Based from our study, we propose a finding that MKTExpenses gets high correlation with DAU-Day7 once the game has enough enjoyable content to keep users engaged.

Ensure high session length

Promote replayability

SessionLengthaffects

SessionCountaffects

Satisfies business requirements?

Increase advertising campaigns

MKTExpenses

affects

DAU

DAU-Day7

influences

Page 56: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

Conclusion

Did our study correctly predicted the fate of JNC and DNC?

Yes. Jungle Cubes has gained over 1M downloads as of October 2016 and is still profitable.

Dragon Cubes was pulled out of the market last September 2016.

Page 57: Applying Machine Learning for Mobile Games by Neil Patrick Del Gallego

We thank you Jakob Lykkegaard Pedersen and Thomas Andreasen for allowing us to use the dataset for Jungle Cubes and Dragon Cubes. We would also like to give thanks to Suhana Chooli, the marketing manager of Playlab Inc., which provided the details about the marketing expenses.

Thank you for listening!