Forex Forecasting with Random Forests 3/N – Modeling and tuning

Economy
# # Create model with best params
seed = 17
model = RandomForestClassifier(**best_param, random_state=seed)
model.fit(X_train, Y_train)
pred = model.predict(X_test)

print('Accuracy: {}'.format(accuracy_score(Y_test, pred)))
a, b, c, d, e, f, g, h, i = confusion_matrix(Y_test, pred).ravel()
maguro = a+i
print('Number of maguro detected: {}'.format(maguro))
print('Big Win/Big Loss Ratio: {}'.format(win_loss(Y_test, pred)))
# # Create model with best params
seed = 17
model = RandomForestClassifier(**best_param, random_state=seed)
model.fit(X_train, Y_train)
pred = model.predict(X_test)

print('Accuracy: {}'.format(accuracy_score(Y_test, pred)))
a, b, c, d, e, f, g, h, i = confusion_matrix(Y_test, pred).ravel()
maguro = a+i
print('Number of maguro detected: {}'.format(maguro))
print('Big Win/Big Loss Ratio: {}'.format(win_loss(Y_test, pred)))

# # Create model with best params seed = 17 model = RandomForestClassifier(**best_param, random_state=seed) model.fit(X_train, Y_train) pred = model.predict(X_test) print(‘Accuracy: {}’.format(accuracy_score(Y_test, pred))) a, b, c, d, e, f, g, h, i = confusion_matrix(Y_test, pred).ravel() maguro = a+i print(‘Number of maguro detected: {}’.format(maguro)) print(‘Big Win/Big Loss Ratio: {}’.format(win_loss(Y_test, pred)))

# # Create model with best params
seed = 17
model = RandomForestClassifier(**best_param, random_state=seed)
model.fit(X_train, Y_train)
pred = model.predict(X_test)

print('Accuracy: {}'.format(accuracy_score(Y_test, pred)))
a, b, c, d, e, f, g, h, i = confusion_matrix(Y_test, pred).ravel()
maguro = a+i
print('Number of maguro detected: {}'.format(maguro))
print('Big Win/Big Loss Ratio: {}'.format(win_loss(Y_test, pred)))

# # Create model with best params seed = 17 model = RandomForestClassifier(**best_param, random_state=seed) model.fit(X_train, Y_train) pred = model.predict(X_test) print(‘Accuracy: {}’.format(accuracy_score(Y_test, pred))) a, b, c, d, e, f, g, h, i = confusion_matrix(Y_test, pred).ravel() maguro = a+i print(‘Number of maguro detected: {}’.format(maguro)) print(‘Big Win/Big Loss Ratio: {}’.format(win_loss(Y_test, pred)))

# # Create model with best params seed = 17 model = RandomForestClassifier(**best_param, random_state=seed) model.fit(X_train, Y_train) pred = model.predict(X_test) print(‘Accuracy: {}’.format(accuracy_score(Y_test, pred))) a, b, c, d, e, f, g, h, i = confusion_matrix(Y_test, pred).ravel() maguro = a+i print(‘Number of maguro detected: {}’.format(maguro)) print(‘Big Win/Big Loss Ratio: {}’.format(win_loss(Y_test, pred)))

# # Create model with best params
seed = 17
model = RandomForestClassifier(**best_param, random_state=seed)
model.fit(X_train, Y_train)
pred = model.predict(X_test)

print('Accuracy: {}'.format(accuracy_score(Y_test, pred)))
a, b, c, d, e, f, g, h, i = confusion_matrix(Y_test, pred).ravel()
maguro = a+i
print('Number of maguro detected: {}'.format(maguro))
print('Big Win/Big Loss Ratio: {}'.format(win_loss(Y_test, pred)))

# # Create model with best params seed = 17 model = RandomForestClassifier(**best_param, random_state=seed) model.fit(X_train, Y_train) pred = model.predict(X_test) print(‘Accuracy: {}’.format(accuracy_score(Y_test, pred))) a, b, c, d, e, f, g, h, i = confusion_matrix(Y_test, pred).ravel() maguro = a+i print(‘Number of maguro detected: {}’.format(maguro)) print(‘Big Win/Big Loss Ratio: {}’.format(win_loss(Y_test, pred)))

## Save model
pd.to_pickle(model, '')
Xiofx
Xiofx

An experienced Machine Learning and Deep Learning professional and logistics improvement entrepreneur in Tokyo, Japan, with an interest in economies around the world. She likes travel very much.

XiofxFollow
EconomyFXPythonTechnology

Comments

Letteralpha