1. Flashpoint
  2. Bluebook_predictions

Commits

Flashpoint  committed 94933be

Updated bluebook_competition.py

  • Participants
  • Parent commits b2d7bdc
  • Branches master

Comments (0)

Files changed (1)

File bluebook_competition.py

View file
  • Ignore whitespace
 del error # for saving memory
 
 # Create the level-1 dataset from level-0 predictions
-level_1_data = np.array([rf_predictions]).transpose()#lr_predictions, brr_predictions,lass_predictions, knn_predictions, dt_predictions, gbr_predictions, mars_predictions, rf_predictions]).transpose()
+level_1_data = np.array([lr_predictions, brr_predictions,lass_predictions, knn_predictions, dt_predictions, gbr_predictions, mars_predictions, rf_predictions]).transpose()
 
 # Create a level-1 stacking generalizer
 l1_rf = RandomForestRegressor(n_estimators=50, n_jobs=-1)
 final_lass[final_lass < 0] = np.mean(final_lass[final_lass > 0])    # Set all the negative predictions to the mean prediction
 final_mars[final_mars < 0] = np.mean(final_mars[final_mars > 0])    # Set all the negative predictions to the mean prediction
 
-predictions = np.array([final_rf]).transpose()#final_regr, final_brr, final_lass, final_knn, final_dt, final_gbr, final_mars, final_rf]).transpose()
+predictions = np.array([final_regr, final_brr, final_lass, final_knn, final_dt, final_gbr, final_mars, final_rf]).transpose()
 
 # Use the level-1 stacking generalizer on the test data predictions to make final predictions
 final_predictions = l1_rf.predict(predictions)