Learning using granularity statistical invariants for classification