# ML algorithm where variable importance depends upon other variables - specifying conditionality

I am designing an algorithm that can detect cheating in a game of chess.

I have a database of players who have been flagged by moderators as cheating, along with a number of game-level characteristics such as move times and move accuracy (as determined by a chess engine) for both black and white.

Let's specify a simple regression:

cheatflag ~ whiteMoveTime + blackMoveTime + whiteMoveAccuracy + blackMoveAccuracy

Let's say cheatflag is a factor-level variable that is 0 if no cheater, 1 if white is the cheater, 2 if black is the cheater.

The issue is that the predictive value of variables like whiteMoveTime and whiteMoveAccuracy depends crucially on who is doing the cheating. If white is cheating, those variables should have different coefficients than if black is doing the cheating. As far as I know, running most blackbox algorithms will derive coefficients that average across all the cases of cheating without understanding the hierarchical nature of the variables.

This problem has a Bayesian flavor with some kind of conditional assumption -- if black is cheating, then these variables matter; if white is cheating, these variables matter, and so on.

How can I deal with this issue?

• do you already have the distinct probabilites that player 'Black' will cheat (hence you want to calculate a posterior probability that the game is rigged, or similar); or do you want to find these probability values/distributions?
– knb
Nov 9 '17 at 12:36
• I don't have distinct probabilities that player "Black" will cheat. I have a dataframe that contains rows of individual games. Some of those games have been flagged for cheating. Others are standard non-cheat games. Among the games that have been flagged for cheating, white has cheated half the time, black has cheated the other half. The goal is to create a model that can simultaneously assess whether a game has a cheater and, if so, who is doing the cheating. The problem is what I described above -- the importance of particular sets of variables depends on who does the cheating. Nov 9 '17 at 15:33