def export_model(self): meta_obj = lr_model_meta_pb2.LRModelMeta() param_obj = self._get_param() result = { self.model_meta_name: meta_obj, self.model_param_name: param_obj } return result
def _get_meta(self): meta_protobuf_obj = lr_model_meta_pb2.LRModelMeta(penalty=self.model_param.penalty, tol=self.model_param.tol, alpha=self.alpha, optimizer=self.model_param.optimizer, batch_size=self.batch_size, learning_rate=self.model_param.learning_rate, max_iter=self.max_iter, early_stop=self.model_param.early_stop, fit_intercept=self.fit_intercept, need_one_vs_rest=self.need_one_vs_rest) return meta_protobuf_obj
def _get_meta(self): model = self.model_fit result = { 'penalty': model.penalty, 'tol': model.tol, 'fit_intercept': model.fit_intercept, 'optimizer': model.solver, 'need_one_vs_rest': self.need_one_vs_rest, 'max_iter': model.max_iter } meta_protobuf_obj = lr_model_meta_pb2.LRModelMeta(**result) return meta_protobuf_obj
def _get_meta(self): model = self.model_fit predict_param = lr_model_meta_pb2.PredictMeta(**{"threshold": self.predict_param.threshold}) result = {'penalty': model.penalty, 'tol': model.tol, 'fit_intercept': model.fit_intercept, 'optimizer': model.solver, 'need_one_vs_rest': self.need_one_vs_rest, 'max_iter': model.max_iter, 'predict_param': predict_param } meta_protobuf_obj = lr_model_meta_pb2.LRModelMeta(**result) return meta_protobuf_obj