Introduction to Machine Learning
In this article I'm explaining some of the basic concepts of machine learning for beginners.

Introduction to Machine Learning

Machine learning has become a buzzword in recent years. It is one of the most exciting and rapidly developing fields in the modern period. One of the reasons for machine learning's current popularity is the massive data output from many sources, as well as the development in computer power.

What is Machine Learning?

The term machine learning was coined in 1959 by Arthur Samuel, an American pioneer in the field of computer games and artificial intelligence. The synonym self-learning computer was also used at this time.

Tom M. Mitchell provided a well-formed, much-quoted definition for the algorithms:

"A computer program is said to learn from experience E with respect to a class of tasks T and a performance measure P if its performance on tasks in T, as measured against P, improves with experience E.”

According to Tom Mitchell, "Machine Learning is the study of computer algorithms that improve automatically through experience".

Machine learning is a subfield of artificial intelligence (AI) and computer science that uses data and algorithms to replicate the way in which people learn and improve their accuracy over time. Artificial intelligence is being propelled forward by machine learning. In the field of AI, significant progress is being made to improve robots' capacity to learn quicker from experience rather than requiring an explicit program each time.

Let's compare it to a classroom to make it easy for ourselves. In a math lesson, the teacher gives pupils some sample problems to review and practice with. Students will understand the fundamentals of what they have learnt after completing a few assignments. Despite the fact that various tasks will be assigned for the tests, students will solve them based on the ideas acquired. This demonstrates how people may benefit from examples and previous experiences. Machine learning works because of this skill. That is, we educate a computer to learn data and adapt to new information. Machine learning, in a nutshell, is a sort of artificial intelligence that allows computers to learn from examples or previous experiences without having to be explicitly programmed..

In conventional programming, we would input data and a program (logic) into the machine, which would then process the data and output according to the program. In machine learning, the machine's input is data, the output is a program, and the output is a program. However, using machine learning does not imply that the system can program itself.

Let's go through it in depth using a weather prediction as an example. Assume our aim is to determine if the weather will be wet or sunny tomorrow automatically. Temperature, apparent temperature, wind speed, wind direction, visibility, pressure, and other meteorological data are among the data we may access, as are previous records of weather data.

When we employ a typical method to make a forecast, the machine's inputs are data and programming. The data in this case is the information from the above attributes, and the program is a collection of handmade rules that may be constructed using historical weather data. The computer will predict whether it will rain or shine tomorrow based on the features and prior data.

The data is referred to as an input data instance from historical records for the previous day's weather in the machine learning technique, and the output is connected to the value of the output column - in other words, whether it will be sunny or rainy tomorrow. It learns the link between input data and output using historical data and a machine learning algorithm, which is known as a predictive model. This predictive model may be thought of as a mapping between the input and output data. The model makes an automated forecast after learning the model and having a profile with updated borrower information. As a result, rather than asking an expert to offer handmade rules, machine learning is a data-driven technique. Furthermore, rather than focusing on specific application issues, machine learning focuses on constructing a generic technique to create a model from data. To describe the problem with a broad algorithm, we must apply a lot of applied mathematics and statistics, as well as computer science approaches to make the algorithm more efficient.

Classifications of Machine Learning

Machine Learning is broadly classified into 4 types:

1.      Supervised Learning

2.      Semi – supervised Learning

3.      Unsupervised Learning

4.      Reinforcement Learning

Supervised Learning

As the name suggests, the definition of supervised learning in machine learning is like having a supervisor while a machine learns to perform tasks. A training set is used in supervised learning to train models to obtain the desired output. This training dataset includes both right and incorrect outputs, allowing the model to learn over time. The loss function is used to assess the algorithm's correctness, and it is adjusted until the error is suitably minimized.

No alt text provided for this image

As the saying goes, practice makes perfect! , the same is true for machines. The machine's outcomes get increasingly accurate as the number of practice samples increases.

Types of Supervised Learning

Supervised learning can be separated into two types of problems when data mining:

        I.          Classification

      II.           Regression

Classification uses an algorithm to accurately assign test data to specific categories. It detects particular items in the dataset and attempts to draw judgments about how they should be labelled or described. It requires both the input and output data. The output variable, also known as the dependent variable, should be categorical. Classifying a number of financial transactions as fraudulent or non-fraudulent is a practical use of the classification approach. Recommendations, speech recognition, medical imaging, and other applications based on this technique are some of the most common.

Types of classification algorithms

        i.           Decision Tree

      ii.           Random Forest

     iii.           Naïve Bayes

     iv.           Support Vector Machine

      v.           Logistic Regression

Regression is used to understand the relationship between dependent and independent variables. It's frequently used to produce projections, such as for a company's sales revenue. Popular regression techniques include linear regression, logistic regression, and polynomial regression. Businesses frequently utilize linear regression to figure out how much money they spend on advertising and how much money they make. For example, a simple linear regression model using ad expenditure as the predictor variable and revenue as the response variable might be fitted. Time series forecasting is a typical use of the regression approach. Using the training data, a single output is projected.

Types of regression algorithms

        i.           Simple Linear Regression

      ii.           Multi Linear Regression

     iii.           Polynomial Regression

     iv.           Ridge Regression

      v.           Lasso Regression

     vi.           Bayesian Linear Regression

We use two algorithms we use to train a regression model to create predictions with continuous values.

   vii.           Decision Tree Regression

  viii.           Random Forest Regression

When we use these Techniques?

When two separate classes are on opposite sides of the line, we apply these strategies. This line distinguishes these classes, which represent separate things. In this scenario, categorization is used.

Regression is used to forecast the responses of continuous variables like stock prices, housing prices, a 12-year-old girl's height, and so on.

Pros and Cons of Supervised Learning

Pros:

o  We may be explicit about the classes utilized in the training data in supervised learning. To put it another way, classifiers may be properly trained to separate themselves from other class definitions and create correct decision limits.

o We obtain a clear image of each defined class.

o A mathematical method for categorizing future inputs can be used as the decision boundary. As a result, there is no need to continuously training the samples in memory.

o We have total control over the amount of classes in the training data that we desire.

o When compared to unsupervised learning, the procedure is simple to comprehend.

o It has been proven to be very useful in categorization challenges.

o It is often used to predict values from the known set of data and labels.

Cons:

o  In Machine Learning, supervised learning is unable to tackle all complicated jobs.

o It is unable to cluster data by determining its characteristics on its own.

o It's possible that the decision boundary has been over-trained. If we have a lot of data to train a classifier with, or if the samples we use to train it aren't good, the accuracy of our model will be affected. As a result, deciding on a categorization strategy for massive data might be difficult.

o Both the training and classification processes need a significant amount of calculation time. This can put both our patience and the machine's efficiency to the test.

o Because this type of learning can't manage large volumes of data, the computer must learn from the training data.

o If an input is received that does not correspond to any of the classes in the training data, the consequence may be a class label that is incorrect after classification.

Unsupervised Learning

Unlike supervised learning, unsupervised learning uses unlabeled data, which means the outcome of the input data is unknown ahead of time. It extracts patterns from the data and uses them to solve clustering and association issues. When subject matter experts are unclear of common qualities within a data set, this is very valuable.

No alt text provided for this image

Consider the following scenario to illustrate how unsupervised learning works. Consider the following scenario: we have a lot of fruits, but none of them have labels. Let's put these fruits in front of an unsupervised learning model. The model identifies the data's properties and recognizes that all of the apples are similar in nature, so it groups them together. Similarly, it recognizes that all bananas have the same characteristics and hence groups them together, just as it does with all mangoes.

As a result, we could see how the model divided the data into distinct clusters even when the data didn't match the class labels. This is related to a phenomenon known as 'data similarity.'

Types of Unsupervised Learning

        I.           K-means clustering

      II.           Hierarchical Clustering

    III.           Principal Component Analysis

Pros and Cons of Unsupervised Learning

Pros:

o It is capable of seeing what the human mind is incapable of seeing.

o It is used to uncover hidden patterns that are critical to the industry and has a wide range of real-time applications.

o An uncontrolled job might result in the creation of a completely new company segment or enterprise.

o When compared to the supervised learning problem, there is less complexity. Because no one is required to understand the linked labels, the complications are reduced.

o Obtaining unlabeled data is rather simple.

Cons:

o It is more expensive since human involvement may be required to comprehend the patterns and link them with domain expertise.

o Because there is no label or output measure to certify its usefulness, it is not always assured that the produced results will be beneficial.

o An unsupervised task's sorting and output cannot be precisely defined. It is highly reliant on the model and, as a result, on the machine.

o The results are frequently inaccurate.

Semi-supervised Learning

Semi-supervised learning is a learning problem that involves a small number of labelled examples and a large number of unlabeled examples. It provides a comfortable middle ground between supervised and unsupervised learning. As a result, it's a learning problem that falls somewhere in the between of supervised and unsupervised learning. It drives categorization and feature extraction from a larger, unlabeled dataset using a smaller, labelled dataset during training. Semi-supervised learning can help alleviate the problem of not having enough labelled data to train a supervised learning algorithm (or not being able to afford to label enough data).

Let's have a look at this example. We have a variety of products here, including phones, apples, books, and chairs. Now, as you can see, just a small percentage of the things are identified, with the remainder remaining unmarked. The primary concept here is to start by grouping data that is related. As a result, all phones would be grouped together, apples would be grouped together, and books and chairs would be grouped together as well.

We now have four clusters, each with comparable data. In this case, the algorithm assumes that all data points in close vicinity have the same label assigned to them. The semi-supervised algorithm now assigns labels to the remaining unlabeled data based on the already labelled data.

Pros and Cons of Semi-supervised Learning

Pros:

o  It is easy to understand.

o  It reduces the amount of annotated data used.

o  It is a stable algorithm.

o  It is simple.

o  It has high efficiency.

Cons:

o  Iteration results are not stable.

o  It is not applicable to network-level data.

o  It has low accuracy.

Reinforcement Learning

No alt text provided for this image

Reinforcement Machine learning is a behavioral machine learning approach that is comparable to supervised learning but does not use sample data to train the algorithm. Using trial and error, this model learns as it goes. The algorithm learns through a system of rewards and punishments, with the overall objective of maximizing the reward. During the learning process, the algorithm examines state–action pairings in a given environment at random (to create a state–action pair table), then uses the state–action pair rewards in practice to determine the optimal action for a given state that leads to a desired state.

To further comprehend the notion, consider a self-driving automobile. Here's a self-driving automobile that will get to its destination without hitting any obstacles. As a result, the agent is the self-driving automobile, and the environment is the road. The automobile now acts and travels straight, but as it does so, it runs into the barricade. As a result of its wrongdoing, it must pay the price. The automobile knows that travelling straight is incorrect and that it must go right the next time. It appears that when things go well, there is a reward. As a result, the process continues, and the automobile learns to drive without colliding with any obstacles.

Types of Reinforcement Learning

        I.           Markov Decision Process

      II.           Q learning

Pros and Cons of Reinforcement Learning

Pros

o  Reinforcement Learning is used to solve complex problems that cannot be solved by conventional techniques.

o  This technique is preferred to achieve long-term results which are very difficult to achieve.

o  This learning model is very similar to the learning of human beings. Hence, it is close to achieving perfection.

Cons:

o  Too much reinforcement learning can lead to an overload of states which can diminish the results.

o  This algorithm is not preferable for solving simple problems.

o  This algorithm needs a lot of data and a lot of computation.

o  The curse of dimensionality limits reinforcement learning for real physical systems.

Steps in Building Machine Learning Models

No alt text provided for this image


Step 1: Gathering Data

Our initial step in creating a machine learning model would be to collect relevant data that can be utilized to distinguish between the characteristics. The quality and quantity of information you get are critical since they will have a direct influence on how well or poorly your model performs. You could already have the data in a database, or you'll have to start from scratch. If the project is modest, you can construct a spreadsheet that can be simply exported as a CSV file later.

Step 2: Data Pre-processing

In every Machine Learning application, it is one of the most important processes. Data is frequently presented in a manner that is not ideal (or perhaps insufficient) for the model to process. In these circumstances, pre-processing is a must-do activity. Many algorithms demand that the features be on the same scale (for example, in the [0,1] range) in order to optimize their performance, and this is frequently accomplished by using data normalization or standardization approaches. Now is a good time to display your data and see if there are any links between the various features we discovered.

Finally, we’ll split our original dataset into training and testing subsets.

Step 3: Selecting a Model

The next step is to decide the model type to use. There are a number of existing models that may be utilized for diverse reasons. These models were created with a variety of objectives in mind. For example, some models are better suited to dealing with words, while others are more suited to dealing with photos. A basic linear regression model, for example, may be used to distinguish distinct fruits. The type of fruit is the dependent variable in this situation, whereas the color and form of the fruit are the two predictors or independent variables.

Step 4: Training the Model

We need to train the datasets such that they operate smoothly and the prediction rate improves incrementally. Remember to randomly initialize the model's weights - the weights are the numbers that multiply or alter the relationships between the inputs and outputs - since the selected algorithm will modify them as you train them.

Step 5: Evaluating the models

We must validate the precision of your already trained model by comparing it to your evaluation data set, which comprises inputs that the model does not recognize. If the accuracy is less than or equal to 50%, the model will be useless since making judgments will be like throwing a coin. We may be confident in the outcomes if it hits 90 percent or above.

Step 6: Parameter Tuning

If we didn't get accurate predictions during the assessment and the precision wasn't what we wanted, it's probable that the model has overfitting or underfitting issues, and we'll have to go back to the training process before changing the model's parameters. Iterating the training data, also known as epochs, can increase the number of times. The "learning rate," which is generally a figure that multiplies the gradient to progressively get it closer to the global or local minimum to reduce the function's cost, is another significant parameter.

Step 7: Prediction or Inference

Now our Machine Learning model is ready for inferring results in real-life scenarios.

Conclusion

In this article, I've introduced the ideas of Machine Learning and the various forms of Machine Learning. It began with a basic introduction to Machine Learning and its many kinds. It also demonstrated how each kind of learning differs from the others, as well as their benefits and drawbacks.

After reading this article, you will have a better understanding of Machine Learning, its types, benefits and drawbacks, as well as the entire process of developing a model.


Very useful

Jomina Jose

Structural Engineering Professional | Chartered Engineer (India), AMIE | Expertise in RCC, Steel & Building Design

2y

Informative🤝

To view or add a comment, sign in

Insights from the community

Others also viewed

Explore topics