Python में Finance के लिए 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 में Finance के लिए Machine Learning