def psgd_method_2(sgd, loop_iter, coef, intercept, X_train, y_train):
"""
SGD method run in parallel using map.
Parameters
----------
args: tuple (sgd, data), where
sgd is SGDRegressor object and
data is a tuple: (X_train, y_train)
Returns
-------
sgd: object returned after executing .fit()
"""
for _ in range(loop_iter):
sgd.coef_ = coef
sgd.intercept_ = intercept
sgd.fit(X_train, y_train)
coef = sgd.coef_
intercept = sgd.intercept_
return sgd
评论列表
文章目录