Python으로 배우는 금융 분야 Machine Learning
Nathan George
Data Science Professor


과적합 방지 옵션:

from keras.layers import Dense, Dropoutmodel = Sequential() model.add(Dense(500, input_dim=scaled_train_features.shape[1], activation='relu')) model.add(Dropout(0.5)) model.add(Dense(100, activation='relu')) model.add(Dense(1, activation='linear'))
드롭아웃 미적용 시 AMD R$^2$ 값:
드롭아웃 적용 시:

# make predictions from 2 neural net models test_pred1 = model_1.predict(scaled_test_features) test_pred2 = model_2.predict(scaled_test_features)# horizontally stack predictions and take the average across rows test_preds = np.mean(np.hstack((test_pred1, test_pred2)), axis=1)
테스트 세트 모델 1 R$^2$ 점수:
모델 2:
앙상블 (예측 평균):
Python으로 배우는 금융 분야 Machine Learning