def export_predictions(predictions, output_dir) -> None:
    exportation_columns = []
    for ticker, prediction_data in predictions.items():
        actual_prediction, observed_accuracy = prediction_data
        exportation_columns.append(
            (ticker, actual_prediction, observed_accuracy))
    csv_exportation.export_predictions(exportation_columns,
                                       output_dir + path.sep + 'gnb.csv')
def export_predictions(predictions, out_dir) -> None:
    exportation_columns = []
    for ticker, prediction_data in predictions.items():
        actual_prediction, observed_accuracy = prediction_data
        actual_prediction = np.argmax(actual_prediction)
        if actual_prediction == 1:
            prediction_str = "Trend Upward"
        else:
            prediction_str = "Trend Downward"
        exportation_columns.append((ticker, prediction_str, observed_accuracy))
    csv_exportation.export_predictions(exportation_columns, out_dir + path.sep + 'ann.csv')
Esempio n. 3
0
def export_predictions(predictions, output_dir) -> None:
    exportation_columns = []
    for ticker, prediction_data in predictions.items():
        actual_predictions, observed_accuracies = prediction_data
        for i in range(len(actual_predictions)):
            actual_prediction = actual_predictions[i]
            observed_accuracy = observed_accuracies[i]
            exportation_columns.append(
                (ticker, actual_prediction, observed_accuracy))
    csv_exportation.export_predictions(exportation_columns,
                                       output_dir + path.sep + 'svm.csv')
Esempio n. 4
0
def export_predictions(predictions, output_dir) -> None:
    exportation_columns = []
    for ticker, prediction_data in predictions.items():
        actual_predictions, observed_accuracies = prediction_data
        for i in range(len(actual_predictions)):
            actual_prediction = actual_predictions[i]
            observed_accuracy = observed_accuracies[i]
            if actual_prediction == 1:
                prediction_str = "Trend Upward"
            else:
                prediction_str = "Trend Downward"
            exportation_columns.append(
                (ticker, prediction_str, observed_accuracy))
    csv_exportation.export_predictions(
        exportation_columns, output_dir + path.sep + 'random_forest.csv')