def __init__(self,
                 l1_reg=0.001,
                 l2_reg=0.0001,
                 fit_intercept=False,
                 ignore_negative_weights=False,
                 num_selected_features=200,
                 model='sgd'):
        alpha = l1_reg+l2_reg
        l1_ratio = l1_reg/alpha
        if parse_version(sklearn.__version__) <= (0, 14, 1):
            # Backward compat: in old versions of scikit-learn l1_ratio had
            # the opposite sign...
            l1_ratio = (1 - l1_ratio)
        if model == 'sgd':
            self.model = SGDRegressor(penalty='elasticnet',fit_intercept=fit_intercept,alpha=alpha,l1_ratio=l1_ratio)
        elif model == 'elasticnet':
            self.model = ElasticNet(alpha=alpha,l1_ratio=l1_ratio,positive=True,fit_intercept=fit_intercept,copy_X=False)
        elif model == 'fs_sgd':
            m = SGDRegressor(penalty='elasticnet',fit_intercept=fit_intercept,alpha=alpha,l1_ratio=l1_ratio)
            self.model = NNFeatureSelectingSGDRegressor(m,num_selected_features)
        else:
            raise SystemExit('unknown model type: {0}'.format(model))
        self.ignore_negative_weights = ignore_negative_weights
dataset/ETHPy150Open Mendeley/mrec/mrec/item_similarity/slim.py/SLIM.__init__/original