예제 #1
0
파일: gui.py 프로젝트: duonghnh/SparkMLLib
 def test_input(self) -> None:
     """ test for diabetes"""
     my_dict = {
         "B": float(self.l1.text()),
         "C": float(self.l2.text()),
         "D": float(self.l3.text()),
         "E": float(self.l4.text()),
         "F": float(self.l5.text()),
         "G": float(self.l6.text()),
         "H": float(self.l7.text()),
         "I": float(self.l8.text())
     }
     output = diabetes.check_input(my_dict)
     #print(self.output)
     #self.setFixedSize(850, 342)
     self.report_subhead.setText("Reports")
     self.model_details.setText(
         "Model này dùng thuật toán Random Forest.\nĐộ chính xác khoảng 80%.\nBộ dữ liệu đuợc sử dụng là bộ dữ liệu PIMA tổng hợp ở Ấn Độ."
     )
     self.details.setText(
         "Patient's name: {}\nPregnancies: {}\nGlucose: {}\nBloodPressure: {}\nSkinThickness: {}\nInsulin: {}\nBMI: {}\nDiabetesPedigreeFunction: {}\nAge: {}"
         .format(self.l0.text(), self.l1.text(), self.l2.text(),
                 self.l3.text(), self.l4.text(), self.l5.text(),
                 self.l6.text(), self.l7.text(), self.l8.text()))
     #
     if output == 0:
         self.results.setText(
             "Chẩn đoán cho thấy bệnh nhân không bị tiểu đường.")
     else:
         self.results.setText(
             "Chẩn đoán của chúng tôi cho thấy bệnh nhân mắc bệnh tiểu đường. \n Xin vui lòng kiểm tra sớm"
         )
     self.results.setFont(QFont("Arial", 14, weight=QFont.Bold))
예제 #2
0
    def test_input(self) -> None:
        """ test for diabetes"""
        my_dict = {
            "A": float(self.l1.text()),
            "B": float(self.l2.text()),
            "C": float(self.l3.text()),
            "D": float(self.l4.text()),
            "E": float(self.l5.text()),
            "F": float(self.l6.text()),
            "G": float(self.l7.text()),
            "H": float(self.l8.text())
        }
        output = diabetes.check_input(my_dict)
        print(output)
        #self.setFixedSize(850, 342)
        self.report_subhead.setText("Reports")
        self.model_details.setText("For More Go to AI Doctor ")
        self.details.setText("Patient's name: {}\nBody Glucose: {} \
\nBlood pressure: {}\nMean Perimeter: {}\ninsulin taken: {}\nH*w ratio: {}\nDiabetes pedigree: {}\nyour curret age: {}\nskin fold: {}"
                             .format(self.l0.text(), self.l1.text(),
                                     self.l2.text(), self.l3.text(),
                                     self.l4.text(), self.l5.text(),
                                     self.l6.text(), self.l7.text(),
                                     self.l8.text()))
        #
        if output == 0:
            self.results.setText(
                "Our suggests that patient DOES NOT SUFFER FROM Diabetes.")
        else:
            self.results.setText(
                "Our suggests patient DOES SUFFER FROM Diabetes\nPlease get checked soon."
            )
        self.results.setFont(QFont("Arial", 14, weight=QFont.Bold))
    def test_input(self) -> None:
        """ test for diabetes"""
        my_dict = {
            "B": float(self.l1.text()),
            "C": float(self.l2.text()),
            "D": float(self.l3.text()),
            "E": float(self.l4.text()),
            "F": float(self.l5.text())
        }
        output = diabetes.check_input(my_dict)
        #print(self.output)
        #self.setFixedSize(850, 342)
        self.report_subhead.setText("Reports")
        self.model_details.setText(
            "This model uses Support Vector Machine classifier.\nAccuracy of model: 80%\nWe have used PIMA Indians diabetes dataset from UCI archive."
        )
        self.details.setText(
            "Patient's name: {}\nPlasma glucose concentration: {} \
\nDiastolic blood pressure: {}\nTriceps skin fold thickness: {}\nSerum insulin: {}\nBody mass index: {}"
            .format(self.l0.text(), self.l1.text(), self.l2.text(),
                    self.l3.text(), self.l4.text(), self.l5.text()))
        #
        if output == 0:
            self.results.setText(
                "Diagnosis suggests that patient does not suffers from diabetes."
            )
        else:
            self.results.setText(
                "Our diagnosis suggests patient does suffer from diabetes.\nPlease get checked soon."
            )
        self.results.setFont(QFont("Arial", 14, weight=QFont.Bold))
예제 #4
0
    def test_input(self) -> None:
        """ test for diabetes"""
        my_dict = {
            "Pregnancies": float(self.l1.text()),
            "Glucose": float(self.l2.text()),
            "BloodPressure": float(self.l3.text()),
            "SkinThickness": float(self.l4.text()),
            "Insulin": float(self.l5.text()),
            "BMI": float(self.l6.text()),
            "DiabetesPedigreeFunction": float(self.l7.text()),
            "Age": float(self.l8.text())
        }
        output = diabetes.check_input(my_dict)

        self.report_subhead.setText("Report:")
        self.model_details.setText("\n\n\nDiaCare © Fahmid Anabi")
        self.details.setText(
            "Patient's name: {}\nPregnancies: {}\nGlucose: {} \nBlood Pressure: {}\nSkin Thickness: {}\nInsulin: {}\nBMI: {}\nDPF: {}\nAge: {}"
            .format(self.l0.text(), self.l1.text(), self.l2.text(),
                    self.l3.text(), self.l4.text(), self.l5.text(),
                    self.l6.text(), self.l7.text(), self.l8.text()))
        self.details.setAlignment(Qt.AlignLeft)
        self.details.setWordWrap(True)
        #
        if output == 0:
            self.results.setText(
                "\nOur diagnosis suggests that patient does not suffers from diabetes."
            )
            self.results.setStyleSheet("color: green;")
        else:
            self.results.setText(
                "\nOur diagnosis suggests patient does suffer from diabetes.Please immediatly contact to your doctor."
            )
            self.results.setStyleSheet("color: red;")
        self.results.setFont(QFont("Arial", 14, weight=QFont.Bold))
예제 #5
0
파일: gui.py 프로젝트: Ajesh01/proj
def test_input(self) -> None:
    """ test for diabetes"""
    my_dict = {"B":float(self.l1.text()), "C":float(self.l2.text()),"D":float(self.l3.text()), "E":float(self.l4.text()), "F": float(self.l5.text())}
    output = diabetes.check_input(my_dict)
    if output==0:
        self.results.setText("Diagnosis suggests that patient does not suffers from diabetes.")
    else:
        self.results.setText("Our diagnosis suggests patient does suffer from diabetes.\nPlease get checked soon.")
    self.results.setFont(QFont("Arial",14, weight=QFont.Bold))           
예제 #6
0
def login():
    os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = (
        r'C:\Users\rahul narayanan\Downloads\online-diabetes-predicto-6655e-firebase-adminsdk-3psrf-7a74ac94ce.json'
    )
    db = firestore.Client()
    ref = db.collection(u'Users').document(u'#name')
    doc = ref.get()
    a = doc.to_dict()
    my_dict = {
        "B": float(a['Plasma']),
        "C": float(a['BP']),
        "D": float(a['Triceps']),
        "E": float(a['Insulin']),
        "F": float(a['BMI'])
    }
    output = diabetes.check_input(my_dict)
    if output == 0:
        #print(output)
        return render_template('false.html')
    else:
        return render_template('true.html')