My dataset is in JSON format,
{
"a": ["73.0", "41.0", "98.0", "43.0"],
"s": ["74.0", "43.0", "112.0", "44.0"],
"f": ["75.0", "45.0", "116.0", "45.0"],
"l": ["76.0", "47.0", "120.0", "46.0"],
"x": ["77.0", "49.0", "128.0", "47.0"],
"q": ["78.0", "51.0", "134.0", "48.0"]
}
I need to find the closest match to a test data set like the one below. The closest match is determined by the array in the dataset with the lowest average difference compared to the test array. For example, in this case, the closest match is "a": ["73.0", "41.0", "98.0", "43.0"].
{
"t": ["75.0", "42.0", "100.0", "44.0"]
}
Are there any JavaScript libraries that can assist with this task?