When I add regularization techniques in my model like L1 or L2 do i need more epochs to properly converge my model.
for r in (None,"L1","L2"):
for max_iter in (30,45,60):
classifier=SGDClassifier(loss="log",penalty=r,max_iter=max_iter,learning_rate="constant",eta0=0.01,random_state=42)
print("max_iter={}".format(max_iter))
classifier.fit(X_train,Y_train)
acc=classifier.score(X_test,Y_test)
print("accuracy when r={} is {}".format(r,acc*100))
- When r = None:
- max_iter = 30/45 it says
ConvergenceWarning: Maximum number of iteration reached before convergence. Consider increasing max_iter to improve the fit.
- max_iter = 60 no warning.
- When r = L1:
- max_iter= 30 same warning.
- max_iter = 45/60 no warning.
- When r= L2:
- max_iter = 30/45/60 same warning
Does it matter or this is random?