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 :: images in pygame 
Python :: generator expression python 
Python :: selenium restart browser python 
Python :: importare un foglio di un file excel in python 
Python :: how to read file again in python 
Python :: frontmost flag qt 
Python :: print chr character in python f string 
Python :: string times python 
Python :: reassign variable python 
Python :: sqlalchemy filter getattr 
Python :: python - create frequency table between two columns 
Python :: c# script for download music from telegram channel 
Python :: how to do welcome in bubble letters in python 
Python :: pandan jaya lrt 
Python :: django.com 
Python :: python numpy read from stdin 
Python :: CNN Libraries 
Python :: numpy generate sequence from 0 to n 
Python :: python einops rearrange 
Python :: RC style Relative Referencing in OpenPyXL 
Python :: python read and write lines in file 
Python :: scraped text in Russian encoding python 
Python :: non linear regression 
Python :: pypy tinytag 
Python :: python get stringvar value 
Python :: visualising centroid of an unsupervised learning algorithm 
Python :: python kivy black screen 
Python :: how to prefix numbers with zero in python 
Python :: variance in machine learning 
Python :: negate if statement python 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =