IEEE BYTE Volume-3 Issue-2 | Page 22

The dynamics of Machine Learning

By Kevin Doshi , SE Comps
AI and Machine Learning have plowed their way into our digital lives in such ingenious yet sometimes-inconspicuous ways that we use their applications on a regular basis without realizing that they are making the wheels turn . Its applications include risk management in insurance and banking , predicting the onset of diseases , filtering spam messages in your e-mail , making recommendations related to products that you ’ ve viewed or songs that you ’ ve listened to , identifying new malware using older malware , in self-driving vehicles , showing more relevant search results and so on . Much of what we thought was difficult to do using computers is now practically possible thanks to the power of machine learning . Here is a summary on how it works : -
Machine learning is defined as methods or algorithms that are used to teach a computer to identify patterns in data and thus predict outcomes , without being explicitly programmed to do so . Let ’ s take an example where we want to teach a computer to differentiate between tea and coffee . The first step in machine learning is one where a lot of human intervention is required - data gathering and preprocessing​ .
Assume that we have a dataset of tea and coffee , having 2 characteristics or ‘ features ’ – caffeine content , cost , the ‘ target attribute ’ i . e . whether the product is tea or coffee . Generally , the caffeine content per 100g of tea is about 10mg whereas that of coffee is about 40mg . Tea costs anywhere between 35 and 150​ , ​ whereas coffee costs between 125 and 400 . This becomes our initial assumption . Now , our dataset may be in excel , csv and may contain some null or incorrect values . Our first task is to remove those entries , make sure our data is ready for training the computer and set aside some 20-30 % data for evaluation . It is important to choose a proper training dataset , which reflects general behavior with some deviations .
Once we have our training data ready , we have to choose a ML model to employ . There are various models like binary classification , linear regression , naïve Bayes , clustering , nearest neighbor , decision trees and neural networks to choose from . Our choice depends upon the type of dataset and the required outcome . Since our problem definition is quite basic , we can use a simple linear model that will get the job done . The next step is to ​train our model . Let ’ s say our model is an X-Y graph with a straight line representing our initial assumptions .
If our dataset contained an entry having 14mg caffeine and costing 70​ ₹ ​ , it would probably guess tea . Similarly , if an entry had 38mg caffeine and cost 200​ ₹ ​ it would probably