def __init__(self, conf_file): LinearModel.__init__(self, conf_file) if 'train_data' in self.conf.options('logistic_regression'): self._load_data(self.conf.get('logistic_regression', 'train_data')) self.alpha = self.conf.getfloat('logistic_regression', 'alpha') self.iters = self.conf.getint('logistic_regression', 'num_iters') self.lambd = self.conf.getfloat('logistic_regression', 'lambda') self.intercept = self.conf.getboolean('linear_regression', 'has_intercept')
def __init__(self, options): LinearModel.__init__(self) self.alpha = options.alpha self.iters = options.num_iters self.lambd = options.lambd self.intercept = options.has_intercept self.model_in = options.model_in self.model_out = options.model_out self.training_file = options.training_file self.test_file = options.test_file self.results_file = options.results_file if self.test_file != '': self._load_data(self.test_file) else: self._load_data(self.training_file)