I want to create expression, that classifies samples ( 4 weather features -> decision).
Example training data:
For the values that i have data for, I can use rules:
fs = {
{0, 0, 0, 0} -> 1, {2, 1, 0, 0} -> 1, {2, 2, 1, 0} -> 1, {0, 2, 1, 1} -> 1,
{1, 2, 1, 0} -> 1, {2, 1, 1, 0} -> 1, {1, 1, 1, 1} -> 1, {0, 1, 0, 1} -> 1,
{0, 0, 1, 0} -> 1, {1, 0, 0, 0} -> 0, {1, 0, 0, 1} -> 0, {2, 2, 1, 1} -> 0,
{1, 1, 0, 0} -> 0, {2, 1, 0, 1} -> 0};
{2, 1, 0, 1} /. fs
Alternatively I can use table/hashmap:
fs[{0, 0, 0, 0}] = 1;
fs[{2, 1, 0, 0}] = 1;
(*etc.*)
fs[{2, 1, 0, 1}]
How can I compute an estimation decision based on closest* existing sample element(s)?
closeness can be defined by any distance function ex: {euclidean distance,hamming distance,...}.