For those who don’t know about Swift on Sundays, it’s a weekly feature (on Sundays, naturally) where Paul Hudson of Hacking With Swift builds a live app on YouTube, talking through his design choices as he makes them.
Today’s project revolves around machine learning, specifically CreateML. “CreateML creates the models; CoreML consumes the models.”
Paul’s created test JSON data about recommended sleep time, number of cups of coffee, etc. to use as testing and training data. When run through CreateML with root mean square to test it, the recommendations are off by a mere three minutes, so quite close. In some cases, you’d want to train more, but we’re off onto making an app to use the model.
Paul talks about the difference between loadView and viewDidLoad. Start loading your view in loadView, not viewDidLoad, but over and over he sees examples of people putting view loading code in the latter that shoud go in the former.
Overall, an interesting episode if you want to have a primer on machine learning and incorporating a simple example into an app.