Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

convert python code to pseudocode online

from flask import render_template, request, Flask
import joblib

app = Flask(__name__)

model = joblib.load('dicisionTreeModel.pkl')


@app.route('/')
def index():
    return render_template('Main.html')


@app.route('/predict', methods=['GET','POST'])
def predict():
    if (request.method) =='POST':
        age = request.form.get('age')
        sysBloodPress = request.form.get('sysBloodPress')
        diaBloodPress = request.form.get('diaBloodPress')
        bloodGlucoseLevel = request.form.get('bloodGlucoseLevel')
        bodyTemp = request.form.get('bodyTemp')
        heartRate = request.form.get('heartRate')
        data = [age, sysBloodPress, diaBloodPress,
                bloodGlucoseLevel, bodyTemp, heartRate]
        patientPredict = model.predict([data])[0]
        if patientPredict < 1.5:
            return render_template('Main.html', predict=f'Your Risk Level is {patientPredict}, which is Low')
        elif patientPredict < 2.5:
            return render_template('Main.html', predict=f'Your Risk Level is {patientPredict}, which is Medium')
        else:
            return render_template('Main.html', predict=f'Your Risk Level is {patientPredict}, which is High')


if __name__ == "__main__":
    app.run(debug=True)
Comment

PREVIOUS NEXT
Code Example
Python :: python includes 
Python :: multiprocessing in python 
Python :: import turtle in python 
Python :: python sort array by key 
Python :: palindrome python 
Python :: pyaudio 
Python :: python call function in the same class 
Python :: how to make one list from nested list 
Python :: global variable in python 
Python :: correlation matrix in python 
Python :: if with && in python 
Python :: flask socketio send 
Python :: rename folder python 
Python :: store message sent by user in string discord py 
Python :: python wsgi 
Python :: python string: .replace() 
Python :: list comprehension odd numbers python 
Python :: how to read mysql table in python 
Python :: wisdom 
Python :: pandas split groupby 
Python :: python create nested dictionary 
Python :: add key value in each dictonary in the list 
Python :: python self usage 
Python :: django values_list 
Python :: tkinter while button not pressed 
Python :: find max value in 2d array python 
Python :: how to get spotify playlist id in spotipy 
Python :: fluffy ancake recipe 
Python :: how to move an item from one list to another python 
Python :: addition array numpy 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =