December 2018
Intermediate to advanced
274 pages
7h 46m
English
This section provides the details of the Swift code that uses the model in the .mlmodel format and does the housing price prediction:
// ViewController.swiftimport UIKitimport CoreMLclass ViewController: UIViewController { let model = HousePricer()
This line is to initialize the model class that we have imported into the project. The following lines define outlets/variables to the text fields to interact with them:
@IBOutlet weak var crim: UITextField! @IBOutlet weak var zn: UITextField! @IBOutlet weak var price: UILabel! @IBOutlet weak var b: UITextField! @IBOutlet weak var ptratio: UITextField! @IBOutlet weak var medv: UITextField! @IBOutlet weak var lstat: UITextField! @IBOutlet weak var rad: UITextField!
Read now
Unlock full access