Machine Learning- (Explained)

Machine Learning- (Explained)

Table of contents

No heading

No headings in the article.

Machine learning is a subset of Artificial Intelligence. The development of algorithms and statistical models that enable computers to improve their performance on a specific task through experience and data without being explicitly programmed is known as Machine Learning. This means it's a way for computers to learn from data and make predictions or make decisions based on that learning.

Let's understand machine learning with the famous flower dataset "Iris flower dataset". The iris dataset is commonly used in Machine Learning. It contains measurements of four feathers (Sepal length, Sepal width, Petal length, Petal width) of three different species of iris flowers: Setosa, Versicolor, and Virginica. The goal is to classify these iris flowers into their respective species based on these feature measurements.

Let's have a look at the 'Iris Dataset'.

IDSepal LengthSepal WidthPetal LengthPetal WidthSpecies
15.13.51.40.2Iris Setosa
24.93.01.40.2Iris Setosa
34.73.21.30.2Iris Setosa
44.63.11.50.2Iris Setosa
57.03.24.71.4Iris Versicolor
66.43.24.51.5Iris Versicolor
76.93.14.91.5Iris Versicolor
85.52.34.01.3Iris Versicolor
96.33.36.02.5Iris Verginica
105.82.75.11.9Iris Verginica
117.13.05.92.1Iris Verginica
126.32.95.61.8Iris Verginica

So, how the machine learning work? Let's look at the steps:

  1. Data Collection: We start by collecting the "Iris" dataset, which includes the details of what is shown in the table.

  2. Data Preprocessing: If necessary you can preprocess the data. In most cases, we need to preprocess the data. Because while collecting the data there could be too much noise & unclean data. But the "Iris Dataset" is typically clean and doesn't require much preprocessing.

  3. Feature Selection: Feature Selection is the process of reducing the input variable to your model by using only relevant data and getting rid of noise in data. No extensive feature extraction is needed.

  4. Splitting the Data: You divide the dataset into two parts: a training set and a testing set.

  5. Machine Learning Model: You choose a machine learning algorithm. In this example, let's use a simple classification algorithm like a Support Vector Machine (SVM).

  6. Training: Feed the training set, including the feature measurements, into the SVM model. The model learns the patterns and relationships between the feature measurements and the corresponding iris species.

  7. Evaluation: After training, you use the testing set to evaluate the model's ability to classify iris flowers. You measure its performance using accuracy or other classification metrics.

  8. Iterate and Improve: If the model's accuracy isn't satisfactory, you can iterate, try different algorithms, adjust hyperparameters, or gather more data.

Machines can learn in various ways. But here are three primary ways machine learns.

  1. Supervised Learning: In supervised learning, machines learn to make predictions or decisions based on labeled training data. The algorithm is provided with input-output pairs, and it learns to map inputs to outputs. The learning process with "Iris Dataset" which we have discussed is an example of supervised machine learning. The output data is labeled with 'species' and the machine has to predict which species the flower belongs to based on other features. That is supervised learning.

  2. Unsupervised Learning: Unsupervised learning involves learning patterns and structure within data without explicit labels. For example, a cricket team player's score and wickets are stored in a dataset. Now when you feed this data to a machine, the machine identifies the pattern of the payer's performance. The machine plots the data in the graph. Let's see the graph:

The data is plotted with the respective wickets on the x-axis while running on the y-axis. While looking at the graph we can easily see that there are two clusters. Where on the cluster are the players who scored higher runs and fewer wickets and the other cluster is of the players who scored fewer runs but took many wickets. So, we can interpret first-cluster players as batsmen and second-cluster players as bowlers. The important thing is there were no labels. This is called unsupervised learning.

  1. Reinforcement Learning: When a machine learns through trial and error, receiving positive and negative feedback or rewards for their action is called reinforcement learning.

    Look at this picture. Suppose an image of an apple is given but the machine recognizes it as a banana. So we give it negative feedback saying that it is an apple. The machine learns that and after a number of attempts machine will finally be able to recognize the apple and it will get a positive reward. This is reinforcement learning.

To know more about machine learning watch this video. They explained it much better: https://youtu.be/ukzFI9rgwfU?si=6G1SOW69FjvdZUca