calculate chi square deviation to select features