calculate the mean for the test data