title: How to create for loop to compare train and test score of linear regression models
body: <p>I want to create loop to compare scores of machine learning model, but generate error "too many values to unpack (expected 2)". How to fix the problem?</p>
  
  <pre><code>from sklearn.linear_model import LinearRegression
  from sklearn.linear_model import Ridge
  from sklearn.linear_model import Lasso
  from sklearn.linear_model import ElasticNet
  from sklearn.ensemble import GradientBoostingRegressor
  
  names=[]
  train_scores =[]
  test_score =[]
  
  models={'OLS': LinearRegression(),
         'Ridge': Ridge(),
         'Lasso': Lasso(),
         'ElasticN': ElasticNet(),
         'GBReg': GradientBoostingRegressor()}
  
  for name, model in models:
      name_model = model
      name_fit = name_model.fit(X_train, y_train)
      name_pred = name_model.predict(X_test)
      name_train_score = name_model.score(X_train, y_train).round(4)
      name_test_score = name_model.score(X_test, y_test).round(4)
      names.append(name)
      train_scores.append(name_train_score)
      test_scores.append(name_test_score)
  
  score_df = pd.DataFrame(names, train_scores, test_scores)
  score_df
  </code></pre>