(self, data_inst)
return
Validate & transform param inputs
Validate & transform param inputs
Validate & transform param inputs
def param_validator(self, data_inst):
        """
        Validate & transform param inputs

        """
        # check if need label transform
        self.check_need_transform()

        # check & transform data set sizes
        n_count = data_inst.count()
        if isinstance(self.test_size, float) or isinstance(self.train_size, float) or isinstance(self.validate_size,
                                                                                                 float):
            total_size = 1.0
        else:
            total_size = n_count
        if self.train_size is None:
            if self.validate_size is None:
                self.train_size = total_size - self.test_size
                self.validate_size = total_size - (self.test_size + self.train_size)
            else:
                if self.test_size is None:
                    self.test_size = 0
                self.train_size = total_size - (self.validate_size + self.test_size)
        elif self.test_size is None:
            if self.validate_size is None:
                self.test_size = total_size - self.train_size
                self.validate_size = total_size - (self.test_size + self.train_size)
            else:
                self.test_size = total_size - (self.validate_size + self.train_size)
        elif self.validate_size is None:
            if self.train_size is None:
                self.train_size = total_size - self.test_size
            self.validate_size = total_size - (self.test_size + self.train_size)

        if abs((abs(self.train_size) + abs(self.test_size) + abs(self.validate_size)) - total_size) > FLOAT_ZERO:
            raise ValueError(f"train_size, test_size, validate_size should sum up to 1.0 or data count")
        return
def param_validator ( self , data_inst ) : # check if need label transform self . check_need_transform ( ) # check & transform data set sizes n_count = data_inst . count ( ) if isinstance ( self . test_size , float ) or isinstance ( self . train_size , float ) or isinstance ( self . validate_size , float ) : total_size = 1.0 else : total_size = n_count if self . train_size is None : if self . validate_size is None : self . train_size = total_size - self . test_size self . validate_size = total_size - ( self . test_size + self . train_size ) else : if self . test_size is None : self . test_size = 0 self . train_size = total_size - ( self . validate_size + self . test_size ) elif self . test_size is None : if self . validate_size is None : self . test_size = total_size - self . train_size self . validate_size = total_size - ( self . test_size + self . train_size ) else : self . test_size = total_size - ( self . validate_size + self . train_size ) elif self . validate_size is None : if self . train_size is None : self . train_size = total_size - self . test_size self . validate_size = total_size - ( self . test_size + self . train_size ) if abs ( ( abs ( self . train_size ) + abs ( self . test_size ) + abs ( self . validate_size ) ) - total_size ) > FLOAT_ZERO : raise ValueError ( f"train_size, test_size, validate_size should sum up to 1.0 or data count" ) return