def get_validation_cost(self, thetas):
     validation_cost = testerror_elastic_net(
         self.data.X_validate,
         self.data.y_validate,
         thetas
     )
     return validation_cost
    def get_validation_cost(self, lambdas):
        # if any are not positive, then just return max value
        for l in lambdas:
            if l <= 0:
                return self.MAX_COST

        betas = self.problem_wrapper.solve(lambdas, quick_run=True)
        validation_cost = testerror_elastic_net(self.data.X_validate,
                                                self.data.y_validate, betas)
        self.log("validation_cost %f" % validation_cost)
        return validation_cost
    def get_validation_cost(self, lambdas):
        # if any are not positive, then just return max value
        for l in lambdas:
            if l <= 0:
                return self.MAX_COST

        betas = self.problem_wrapper.solve(lambdas, quick_run=True)
        validation_cost = testerror_elastic_net(
            self.data.X_validate,
            self.data.y_validate,
            betas
        )
        self.log("validation_cost %f" % validation_cost)
        return validation_cost
예제 #4
0
 def get_validation_cost(self, thetas):
     validation_cost = testerror_elastic_net(self.data.X_validate,
                                             self.data.y_validate, thetas)
     return validation_cost
 def get_validate_cost(self, model_params):
     return testerror_elastic_net(
         self.data.X_validate,
         self.data.y_validate,
         model_params
     )