public static double SplitInformation(int samples, int[][] partitions) { double info = 0; for (int i = 0; i < partitions.Length; i++) { double p = (double)partitions[i].Length / samples; if (p != 0) info -= p * Math.Log(p, 2); } return info; }