@app.route((('/api/' + version) + '/predict'), methods=['POST'])
def predict():
    '\n    POST method to predict with our classification model.\n    '
    req_data = request.get_json()
    sl = req_data['sepal_length']
    sw = req_data['sepal_width']
    pl = req_data['petal_length']
    pw = req_data['petal_width']
    input_data = np.array([[sl, sw, pl, pw]])
    prediction = classifier.predict(input_data)
    print(prediction)
    message = {'response': [{'input': {'sepal_length': sl, 'sepal_width': sw, 'petal_length': pl, 'petal_width': pw}}, {'prediction': int(prediction[0])}, {'species': species[str(prediction[0])]}]}
    return jsonify(message)
POST method to predict with our classification model.
@app.route((('/api/' + version) + '/predict'), methods=['POST'])
def predict():
    '\n    \n    '
    req_data = request.get_json()
    sl = req_data['sepal_length']
    sw = req_data['sepal_width']
    pl = req_data['petal_length']
    pw = req_data['petal_width']
    input_data = np.array([[sl, sw, pl, pw]])
    prediction = classifier.predict(input_data)
    print(prediction)
    message = {'response': [{'input': {'sepal_length': sl, 'sepal_width': sw, 'petal_length': pl, 'petal_width': pw}}, {'prediction': int(prediction[0])}, {'species': species[str(prediction[0])]}]}
    return jsonify(message)