public static function compute_class_weight(\CArray $class_weight = null, \CArray $classes, \CArray $y) : \CArray
    {
        if(CArray::unique($y)->x - CArray::unique($classes)->x) {
            throw new ValueErrorException("classes should include all valid labels that can be in y");
        }

        if(!isset($class_weight) || $class_weight->x == 0) {
            # uniform class weights
            $weight = CArray::ones($classes->x, 0);
        }
        return $weight;
    }