The purpose of this app is to:
- Deploy a ML model to run natively on the iPhone
- Provide an intuitive way of interacting with the ML model
- Display relationships with the data and machine learning model for both technical and non-technical users
This project contains a random forest classifier that is trained on a sample of data from the well-known Pima Indians Database here. Apple's Core ML tools library is used to translate the Python model to the Core ML format. The iOS app itself is written in Swift, using SwiftUI with the Charts and CoreML libaries.
A more comprehensive article documenting this application can be found here.
- Sliders under the "Choose feature values" section allow for testing model predictions with different values for each feature
- The charts update to reflect data that nearly matches the user's selections
- The visible data can be increased by increasing the neighboring data slider
- Compare current selections made on main screen to median, min and max values of sampled data
- Scroll values on both left and right sides of screen
- Compare sampled data's median, min and max values by positive/negative outcome
- Scroll values on both left and right sides of screen
This project makes use of Python to create the model and SwiftUI to interface with it
To make edits to the model and export it in the core ML format, use the notebook file at python_data/feature-importances-ios.ipynb. It will export a file called DiabetesTest.mlmodel that can be imported into the iOS app.
Open the ML Slide.xcodeproj using Xcode. Import the updated DiabetesTest.mlmodel file into the project.
- Pregnacies (preg): Number of pregnancies the patients
- Body-Mass-Index (BMI) Measured in kg/m^2
- Glucose level (glu): Plasma glucose concentraion a 2 hours in an orgal glucose tolerance test
- Blood Pressure (bp): Diastolic blood pressure in mmHg
- Skin Thickness (skin): Triceps skin fold thicknes in mm
- Insulin level (insulin): 2-hour serum insulin (micro-U/ml)
- Diabetes pedigree function (dpfunc)
- Age: (age) in Years



