Machine learning is a machine’s ability to learn from data. It has been around for decades, but machine learning is now being applied in nearly every industry and job function. In this blog post, we’ll cover what machine learning entails, how it differs from traditional programming.
What is machine learning?
Simply speaking, machine learning is a technology where in machine learns to perform a prediction/estimation task based on past experience represented by historical data set. There are three key aspects of machine learning which are following:
- Task: Task can be related to prediction problems
- Experience: Experience represents historical dataset
- Performance: The goal is to perform better in the prediction task based on past dataset. Different performance measures exists for different kind of machine learning problems. Read my related blog on key techniques for evaluating machine learning models.
Mathematically speaking, machine learning is about approximating mathematical functions (equations) representing real-world scenarios. These mathematical functions are also referred to as “mathematical models” or just models. Thus, machine learning models are mathematical equations/functions that represent real world problems/scenarios. The reason why machine learning models are called function approximations because it will be extremely difficult to find exact function which can be used to predict or estimate real world scenarios.
Machine learning is different from traditional programming in the way that the output in case of machine learning is the program itself. Input and output data is trained using machine learning algorithms to output program (model). The picture below represents this difference:
Check out my related blog on machine learning terminologies for beginners.
How do we come up with the approximate functions or machine learning models?
There are six key components of a machine learning model.
- Mathematical model/function (approximation): These are the actual functions which are learned from the data. Examples of machine learning functions or models are simple linear equation or multi-linear equation.
- Output variable: This is also called as dependent variable or response variable. This is the variable we want machine learning model to predict or estimate.
- Input variables/features: These represent the input data that you feed into machine learning models or mathematical equations in order for it to learn the parameters/coefficients (third aspect) and make predictions about your output: dependent variable. These variables are also called independent variables or predictor variables. These are also called as features.
- Parameters/coefficients: These are the coefficients of mathematical equations (models) that machine learning algorithm will learn based on the historical data and the loss or cost function.
- Hyperparameters: Hyperparameters are different from the parameters. Hyperparameters are the machine learning model’s initial configuration or setting that you need to determine before training machine learning models. These are parameters which are used with loss function or cost function during training for estimating the parameters discussed in the earlier point. You will use hyperparameters as input for loss function which will return a set of machine learning parameters/coefficients with different values based on your chosen hyperparameter settings.
- Loss or cost or objective function: The loss function is a way of measuring how accurate machine learning model’s predictions are. The loss function takes in machine learning parameters/coefficients and the predicted output variable, compares them with actual value (training data) for that particular set of machine learning parameter settings, then returns a number which is used to adjust or update machine learning parameters so that final outcome of machine learning model will be more accurate. Loss function measures the loss for every prediction – how far the prediction is from actual value. Loss function is also called as cost or objective function. The idea is to minimize the loss or the objective function. In another words, the optimization of objective function results in selection of most appropriate parameters and hyperparameters of machine learning models.
Based on the above, one can note that there are two functions involved in machine learning. One is function (approximation) representing machine learning model and the other is an objective function which needs to be optimized. While optimizing the objective function, the parameters and hyperparameters are learned.
What are some simple examples of machine learning model?
The following are some of the examples of machine learning models or function approximations:
- Y = mX + b: This is a simple linear regression model/equation which is used too predict/estimate the value of Y for a given value of variable X. In this model, we will need a loss function or cost or objective function to determine the value of the parameter, m and b. The loss function popularly used is called as mean square loss. What is needed is data to use loss function to estimate the paremeters.
- Y = a1*X1 + a2*X2 + a3*X3 + b: This is a multi-linear regression model. Here, X1, X2 and X3 are independent or predictor variable, Y is response or dependent variable and b is bias.
- Y = a1X1*sin(X1) + a2X2: You may note that this looks to be a non-linear regression model.
What are different stages of building machine learning models?
Ther following represents some of the key stages in which machine learning models are trained, deployed and monitored. Check out the related post.
- Data collection
- Data preparation and processing
- Feature engineering
- Feature selection / extraction
- Model building
- Model evaluation
- Algorithm selection
- Model selection
- Model deployed in hypercare mode
- Model goes live
- Model retraining based on constant performance evaluation
Here is a diagram representing different stages of building machine learning models.
What are machine learning algorithms?
Machine learning algorithms are algorithms that are used to solve different kind of problems by learning machine learning parameters, hyperparameters etc. The following are different kinds of machine learning algorithms:
- Regression algorithms: Regression algorithms are used for machine learning problems where the model has to predict/estimate the value of a continuous variable. Regression machine learning algorithms are used for both types, namely supervised and unsupervised machine learning problem sets. Examples of regression algorithms include linear regression, decision tree regression, Ridge/Lasso Regression, random forest, gradient boosting algorithms, support vector machine regressors etc. Example of regression problems includes stock price prediction, housing pricing prediction, payment related predictions such as payment delay etc.
- Classification algorithms: Classification algorithms are used for machine learning problems where the model has to predict/estimate the value of discrete variable. The discrete response variable can represent the category or class of data. Examples of classification algorithms include logistic regression, random forest, decision tree classifier, gradient boosting algorithms, support vector machine (SVM) classifier etc. Examples of classification problems include medical or disease diagnosis, weather forecasting.
- Clustering algorithms: Clustering algorithms machine learning algorithms are used for machine learning problems where machine has to identify patterns in data. Examples of clustering machine learning algorithms include K-means algorithm, hierarchical clustering, Gaussian mixture model etc. Examples of clustering algorithms include customer segmentation, market segmentation etc.
- Recommendation algorithms: Recommendation machine learning algorithms are used where the model has to predict/estimate whether a given item is likely to be liked or bought by other users based on their behavior, purchase history etc. These machine learning algorithm type can also be called as content based machine learning algorithm. Examples of recommendation machine learning algorithms include user-based collaborative filtering, item-based collaborative filtering etc.
- Reinforcement learning algorithms: Reinforcement learning algorithms is one which learns/optimizes to respond appropriately to a given environment. Examples of reinforcement learning algorithms include Q-learning algorithm, SARSA, policy gradient machine etc.
- Deep learning algorithms: Deep learning algorithms are the machine learning algorithms that makes use of multi-layered neural network to solve machine learning problem. Examples include deep neural networks, recurrent neural networks, long short-term memory, deep belief networks etc.
- Dimensionality reduction algorithms: Dimensionality reduction machine learning algorithm is one which reduces the number of dimensions (variables) without losing much information from the variables under consideration. Examples of dimensionality reduction algorithms include principal component analysis (PCA), singular value decomposition etc.
What is the difference between machine learning algorithm and machine learning model?
Machine learning algorithms are used to train one or more machine learning models having different parameters and hyperparameters. Model selection techniques are then used to select the most appropriate machine learning model from the set of machine learning models that have been trained. Note that the most appropriate machine learning model is the one which generalizes well to the unseen data.
A problem can be solved using different machine learning algorithms and for each machine learning algorithm, there can be multiple different models. One can go for algorithm and model selection techniques to select most appropriate algorithm and model.
What are different kind of machine learning tasks?
The following are five different kinds of machine learning tasks:
- Supervised learning: Supervised learning is machine learning task where we have data with both inputs and correct labels/answers/output. We also know the correctness of answers based on labels or tags attached to them during training phase. For example, you can take a set of images tagged as “cat”. You train machine learning algorithm with these cat pictures so that machine learning model learns how to distinguish if an image is a cat or not.
- Unsupervised Learning: Unsupervised machine learning is machine learning task where we don’t have data with correct answers/labels and input variables also contain incorrect/noisy values during training phase. For example, if you take images of people without their labels attached to them for machine learning model to learn from them so that machine learning model can correctly classify images of people when machine learns from data with incorrect labels.
- Reinforcement Learning: Reinforcement machine learning is machine learning task where machine learn how to act in different scenarios by receiving rewards or punishment for its actions. The reward function determines if an action taken was correct and the punishment function tells whether that action will result in loss.
- Semi-supervised learning: Semi-supervised learning tasks are machine learning task where data has both labelled and unlabelled examples. Semi-supervised machine learning helps us in obtaining labels for example, images which are not labeled yet or have incorrect/inconsistent tags.
- Self-supervised learning: In case of self-supervised machine learning tasks, data does not have any correct/incorrect labels. In other words, input variables are random or a subset of all possible inputs to machine learning model and the model learns to create its own labels from from noisy data.
How is machine learning related to deep learning, AI and data science?
AI is a much broader field that includes machine learning. Machine Learning can be called as a subset in Artificial Intelligence which deals specifically with using algorithms that can learn from data without being explicitly programmed. Deep learning can be called as subset of machine learning which deals with algorithms that can learn from data using many hidden layers in the model. Complex problems related to image classifications, machine translations, natural language processing tasks etc. can be solved using deep learning algorithms.
Data science is a field which includes machine learning/deep learning, statistics and computer programming so data scientists are people who apply machine learning algorithms on large datasets to create useful products from the data like predictive models etc.
Do I need to know programming languages to implement machine learning?
Answer is Yes and No. If you are a data scientist who is very familiar with programming, you could use programming languages like Python, R or Julia to implement machine learning algorithms. However, product managers and/or machine learning engineers usually use tools and libraries which can be used without programming languages so they don’t need to be familiar with programming language data scientists use for implementation of machine learning models.
There are various cloud services which have machine learning algorithms implemented in them so you don’t need to know how they are working internally. Some machine learning tools and libraries include TensorFlow, scikit-learn etc. These machine learning tools can be used with programming languages or without knowing any language making it easy for product managers/machine Learning engineers who want to create predictive models. You might want to check services such as Google cloud bigquery ML which makes it so easy to train the model.
The following are different popular cloud services which provide machine learning algorithms implemented in them so you don’t need to know how machine learning models are working internally.
- Google Cloud ML services
- Amazon Machine Learning services: Check out my related post on 20 machine learning services on Amazon cloud.
- Azure ML services
What are some skills required to get started with machine learning?
Those who build machine learning models are called as data scientists. People who are data scientists usually have the following skills/knowledge:
- Machine learning algorithms
- Statistics and probability
- Mathematics topics such as linear algebra
- Good understanding of business problems
- Good programming skills in languages like Python, R etc. which can be used for machine learning implementation. Good with SQL knowledge to get data from RDBMS database. That said, there are several cloud-based data democratization tools which can be used to get an access to the data if the data resides in the data lake.
- In case you are not good with programming, you could learn cloud ML services such as Google, Amazon and Azure cloud ML services.
- Communication skills such that the insights could be shared with stakeholders such as product managers, product owners etc.
What is automated machine learning?
Automated machine learning (AutoML) is automation of building machine learning models. AutoML automates different machine learning tasks in machine learning workflow such as data cleaning, feature engineering, hyperparameter tuning etc. such that data scientists could focus on business problems and making machine learning models better instead of spending time on the tedious machine learning tasks. There are different AutoML libraries available for machine learning problems such as Auto-sklearn, H20.ai etc.
Machine learning is a subset of artificial intelligence that deals specifically with machine learning algorithms that are able to learn from data without being explicitly programmed. Data Science, Deep Learning and Machine Learning are all related but have different purposes – deep learning is focused on machine algorithms that can learn from data using many hidden layers while machine learning focuses more broadly on machine algorithm’s ability to learn by itself. Other class of learning is reinforcement learning which trains agents to act in different scenarios by receiving rewards or punishment for its actions; this type of machine learning allows machines to make decisions based off what will give them the most reward. There are machine learning tools and libraries which can be used without programming languages making it easy for product managers, machine learning engineers and data scientists/analysts to create predictive models by using machine learning algorithms that learn from data partially or fully labeled. If you are looking to learn more about machine learning and different applications, please reach out to us.!