This repository contains Python files showing how Pytesting can be undertaken to improve code functionality.
The code within this repository was made for an Applications and Implications of Artificial Intelligence (AI^2) Forum.
The best way to get this code running quickly is to download the zip of the files in this repository and then upload the Pytesting
folder to your Google Drive account to work within Google Colab. By working in Google Colab we remove the need for setting up an environment with the necessary packages. The notebook you can work from that integrates with the other files is the testing_workbook.ipynb
.
If you can't run the code or would like to see the answers you can look at the pytesting_answers.ipynb
notebook.
Check out this hackpad for help, inspiration and sharing!
The Stroke Prediction Dataset from Fedesoriano on Kaggle is used for the Machine Learning sections of this tutorial.
This dataset can be used to predict whether a patient is likely to get stroke based on parameters like gender, age, various diseases, and smoking status. Each row in the data provides relavant information about the patient. The attributes used in this data are provided below:
-
id: unique identifier
-
gender: "Male", "Female" or "Other"
-
age: age of the patient
-
hypertension: 0 if the patient doesn't have hypertension, 1 if the patient has hypertension
-
heart_disease: 0 if the patient doesn't have any heart diseases, 1 if the patient has a heart disease
-
ever_married: "No" or "Yes"
-
work_type: "children", "Govt_jov", "Never_worked", "Private" or "Self-employed"
-
Residence_type: "Rural" or "Urban"
-
avg_glucose_level: average glucose level in blood
-
bmi: body mass index
-
smoking_status: "formerly smoked", "never smoked", "smokes" or "Unknown"
-
stroke: 1 if the patient had a stroke or 0 if not