@property
    def skewness(self):
        def moment(a, m, k=1):
            return sum([(x-m)**k for x in a]) / (len(a) or 1)
        # List each training instance by an int that represents its class:
        a = list(chain(*([i] * v for i, (k, v) in enumerate(self._classes.items()))))
        m = float(sum(a)) / len(a) # mean
        return moment(a, m, 3) / (moment(a, m, 2) ** 1.5 or 1)
Yields 0.0 if the trained classes are evenly distributed.
dataset/ETHPy150Open clips/pattern/pattern/vector/__init__.py/Classifier.skewness