r/GeneticProgramming • • Nov 21 '22

Genetic program for classifying time-series data with discrete classes

My dataset consists of data collected from various sensors over time, with three discrete outcomes. This data was collected from multiple volunteers. Something like this (there's a lot more data points in the real dataset):

TimeSensor1Sensor2Classification
5ms0.7546540.875612ClassOne
10ms0.7546540.875612ClassOne
5ms0.4848750.18484ClassTwo
10ms0.484840.184616ClassTwo

My initial idea for fitness function was to compute the individual using each of the sensor data points and return whether the sign of the result matches the sign assigned to the class, like this:

Individual: cos(x) + sin(y)

cos(0.754654) + sin(0.875612) = 1.4964442580137667 (sign = +, and + is assigned to ClassOne)

This idea does not work (best fitness I get is around 49%). I've played around with different primitives. Does anyone have any suggestions or readings that might help me figure this out? How should I handle time-related data?

2 Upvotes

8 comments sorted by

View all comments

1

u/jmmcd Nov 22 '22

It's common to use zero as the threshold for GP classification, but only for binary classification. For multi-class (you have three) I might suggest to do one-versus-all.

A second issue: is a particular individual always in a particular class, or can they can change class between 5m and 10m? Assuming they are fixed I would make four variables x1_5m, x2_5m, etc.