Created
July 10, 2019 11:54
-
-
Save risenW/49f1201aef0b935b0667e99e10626bd3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#get the data sets | |
X_train, X_val, y_train, y_val = get_split_data(german_cred, target_name='age_yrs') | |
#fit base models | |
linear_reg.fit(X_train, y_train) | |
knn_reg.fit(X_train, y_train) | |
svr_reg.fit(X_train, y_train) | |
#make predictions with trained models | |
pred1 = linear_reg.predict(X_val) | |
pred2 = knn_reg.predict(X_val) | |
pred3 = svr_reg.predict(X_val) | |
#Take average as final prediction | |
avgpred = (pred1 + pred2 + pred3) / 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment