From the course: Machine Learning in Mobile Applications

Unlock the full course today

Join today to access over 23,400 courses taught by industry experts.

Client tied to a regression model

Client tied to a regression model

The final Core ML model we will use is for Boston house price prediction. This will be very similar to the others we have done, with the exception that some of the parameters may not be sent. To start with, we're going to open up the HousingPrediction ViewModel. And we're going to look for the GetHomePriceAsync method. It's near the bottom here. So here we are, the GetHomePriceAsync. If you notice below this, there's a couple methods that have already been created. And these are to move data between the "input" fields and into MLFeatureValues. And if we look at the GetMLFeatureValue method, we can see it looks to see if the double actually has a value or not. If it does, it creates an MLFeatureValue as normal, passing in the double. However, if the value is "null", instead it uses a method named "CreateUndefined", passing the type of parameter. This is used for when the feature's undefined or missing. Under the covers, it calls the Objective-C method "undefinedFeatureValueWithType"…

Contents