Skip to content

KNNRegQualityEvalAlg

Samuel Gomes edited this page Jul 5, 2024 · 3 revisions

KNNRegQualityEvalAlg

This class is a child of RegQualityEvalAlg. It contains the procedure for the estimation of new states using the algorithm K-Nearest Neighbors for Regression.

Constructor and Attributes

Constructor

+ KNNRegQualityEvalAlg(playerModelBridge: PlayerModelBridge, 
                       numberOfNNs: int, 
                       qualityWeights: PlayerCharacteristics = {ability = 0.5, engagement = 0.5}): void

Attributes

Name: expected type Default value Description
numberOfNNs: int - The number of nearest neighbors when executing KNN.

Methods

- calcQuality(state: PlayerState): decimal

Description

Computes the quality of a player state, between 0 and 1. A higher value means better quality.

- distSort(elem: PlayerState): decimal

Description

Comparer to sort a list by the Euclidean distance between the profiles of player states.

This class overrides predict(profile: InteractionsProfile, playerId: int) (see QualityEvalAlg).

Clone this wiki locally