0

I would like to use scikit's package elastic net with a log regression. This is what I am doing so far:

    from sklearn.linear_model import ElasticNet    
    enet = ElasticNet(alpha=alpha, l1_ratio=0.7)
    y_enet = enet.fit(X_train, y_train)

Is it possible to change the model to a log regression?

Niccola Tartaglia
  • 1,537
  • 2
  • 26
  • 40

1 Answers1

1

You can do this in the SGD classifier:

from sklearn import linear_model
enet = linear_model.SGDClassifier(loss='log', penalty='elasticnet', alpha=alpha, l1_ratio=0.7)
y_enet = enet.fit(X_train, y_train)
Brian O'Donnell
  • 1,836
  • 19
  • 29