Skip to content

KNNRegQualityEvalAlg

Samuel Gomes edited this page Jul 12, 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 Members

Constructor

KNNRegQualityEvalAlg(player_model_bridge: PlayerModelBridge, 
                       k: int, 
                       quality_weights: PlayerCharacteristics = {ability = 0.5, engagement = 0.5}): void

Members

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

Functions

__calc_quality(state: PlayerState): decimal 

Description

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

__dist_sort(elem: PlayerState): decimal

Description

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

This class overrides evaluate (see QualityEvalAlg).

Clone this wiki locally