Example #1
0
def api_train_model():
    parser = DataParser()

    model = RandomForestClassifier(n_estimators=10)
    prediction_model = PredictionModel(parser, model)
    prediction_model.train_model()

    PredictionModelEntity.store(prediction_model)

    return jsonify({'accuracy': average(prediction_model.cross_validate())})