Skip to content

Balancing the recorded data

NotGayBut5CentsAre5Cents edited this page Jun 5, 2018 · 3 revisions

balancing_data.py

Data balancing is important because when we train the model we will need to have an equal amount of keypresses for wasd (as naturally we will press w the most) in our train data for the model to train properly.

get_indexes

Given a list and a key, finds all the indexes of the key in the list

process_counters

params:

counters # a list with counters for amount of key presses
train_data # the npy representation of train data

finds the shortest amount of presses

balance_data

params:

file_path # the path at which the file will be saved
train_data # the data that will be balanced
Clone this wiki locally