Book Image

Machine Learning for Mobile

By : Revathi Gopalakrishnan, Avinash Venkateswarlu
Book Image

Machine Learning for Mobile

By: Revathi Gopalakrishnan, Avinash Venkateswarlu

Overview of this book

Machine learning presents an entirely unique opportunity in software development. It allows smartphones to produce an enormous amount of useful data that can be mined, analyzed, and used to make predictions. This book will help you master machine learning for mobile devices with easy-to-follow, practical examples. You will begin with an introduction to machine learning on mobiles and grasp the fundamentals so you become well-acquainted with the subject. You will master supervised and unsupervised learning algorithms, and then learn how to build a machine learning model using mobile-based libraries such as Core ML, TensorFlow Lite, ML Kit, and Fritz on Android and iOS platforms. In doing so, you will also tackle some common and not-so-common machine learning problems with regard to Computer Vision and other real-world domains. By the end of this book, you will have explored machine learning in depth and implemented on-device machine learning with ease, thereby gaining a thorough understanding of how to run, create, and build real-time machine-learning applications on your mobile devices.
Table of Contents (19 chapters)
Title Page
Copyright and Credits
About Packt
Contributors
Preface
Question and Answers
Index

Solving the problem using regression in Core ML


This section will go through the details of creating a regression model and then using the regression model in an iOS mobile application. It will provide a detailed walk-through of the various steps involved in creating an iOS regression ML application to address the problem defined.

Technical requirements

The following software needs to be installed on the developer machine:

  • Python
  • Xcode in a Mac environment

The exercise programs for this chapter can be downloaded from our GitHub repository at https://github.com/PacktPublishing/Machine-Learning-for-Mobile/tree/master/housing%20price%20prediction

In the following program, we are going to use pandas, numpy, and scikit-learn to create the model. So, install these packages from the pip package manager using the following command from the Command Prompt/Terminal:

pip install scikit-learn
pip install numpy
pip install pandas

In order to convert the created model to the Core ML format, we need to use the...