Showing posts with label 3-1 AIML. Show all posts
Showing posts with label 3-1 AIML. Show all posts

Tuesday, December 12, 2023

UNIT-5-ML

UNIT-5-ML


In this post, you can see the Introduction to Artificial Neural Networks and Deep Learning. This content was created according to the JNTUK R20 syllabus.

Well! Let's get into a brief introduction to artificial neural networks. A neural network is a method that was developed by drawing inspiration from the biological neurons of the human brain, or, as we can describe it, a set of algorithms that helps us recognize or detect patterns and relationships. ANN was first introduced in 1943 by neurophysiologist Warren McCulloch and mathematician Walter Pitts. There are numerous applications of ANN in medical diagnosis, image recognition, speech recognition, machine translation, etc.

Ultimately, ANN consists of three main layers: the input layer, the hidden layer, and the output layer.

Input Layer: takes input along with certain weights and biases.

Hidden Layer: This layer is the heart of the model. In this layer, input taken from the previous layer is processed by various layers. It evaluates the input using the activation function and delivers an output.

Output Layer: The output delivered from the hidden layer was received by the output layer, which displays the final output.

Back propagation: if an error occurs in the output, then the model backtracks to the input layer, updates the weights, and again processes them through the hidden layer to deliver the correct output.

The perceptron is the simplest form of neural network.

In this guide, you can learn how to install TensorFlow, which is an end-to-end open-source platform for deep learning. Using this, you can deploy your own model for your project. Rather than machine learning, deep learning, which is a subset of machine learning, can deal with large and complex datasets by using this type of open-source framework. TensoFlow was developed by the Google Brains team in 2015.  It was mainly used for deploying high-end machine learning applications and deep learning applications.  Keras is also an open-source library to build machine learning models and deep learning models. Compared to tensorflow keras used for small applications by individual developers, tensorflow consists of inbuilt keras in it to provide flexibility to users and developers.

In loading and preprocessing data with TensorFlow, you can see six major phases: load data,data augmentation, normalization, shuffling of data, splitting into batches, Caching these six phases will help you maintain the data in the correct format.

Load data: In this phase, it deals with how data can be loaded into a model and how it can be partitioned into training, validation, and test data.

Data Augmentation: This phase is nothing but the transforming of data from its original shape to another shape that can be flexible to model to perform the task.

Normalization: In this phase, it can be used to normalize the data, which is transformed in data augmentation using the transform function.

shuffling of data: This method can enhance the prevention of model overfitting by using data that is shuffled every time.

splitting into batches: this can split the dataset into small batches to prevent the overfitting and underfitting of the deep learning model.

Caching is used to declare the memory size of batches at the time of shuffling.

 

What was covered in the material??

  • introduction of ANN

  • classifications of ANN

  • layers of ANN and backpropagation

  • MultiLayerPerceptron using Keras

  • How do I install TensorFlow?

  • Loading and preprocessing data with TensorFlow's six phases

link to the material: UNIT-5-ML

Thursday, December 7, 2023

ML-UNIT-4


ML-UNIT-4


Welcome to letslearningcse.blogspot.com,

Note: This material was prepared based on the JNTU R20 syllabus for AI and ML.

Now, I am going to give you a brief introduction to ML Unit 4 [Unsupervised Learning].

Let's get into the topic!! As we all know, machine learning is basically classified into three types. Please take a look at the flow chart below.

 

Now, I hope you get a little bit of clarity about the concept of what we are going to discuss.

What is unsupervised learning?

Unsupervised learning is a type of machine learning technique that enables a model to be trained on unlabeled data and predict patterns based on the trained data without any human interference.

Ex: recommendation systems, sentiment analysis, search engines

It has two types of techniques:

  • clustering 
  • association

Association:

It is a type of unsupervised learning that is used to find out the dependency of one data item on another data item, which can lead to building a recommendation system and sentiment analysis.

clustering:

Clustering is nothing but the grouping of similar objects into a single cluster.

It is mainly used for statistical data analysis.

It has two types of clustering scenarios:

  • Soft clustering: In soft clustering, data points can't belong to only one cluster. We can't make a single cluster.
  • Hard clustering: in hard clustering, data points can belong to only one cluster. It can make a single cluster of items.

Ex: k-means, dbscan, agglomerative, hierarchical clustering, etc.

Clustering Methods:

  • Partition clustering or centroid clustering
  • Density-based clustering
  • Distribution-based clustering
  • Hierarchical clustering

Applications of clustering:

  • Customer segmentation
  • data analysis
  • Dimensionality Reduction
  • Feature Engineering
  • outlier detection
  • semi-supervised learning
  • search engines
  • image segmentation

Image segmentation:

It is a process that splits the picture or image into numerous regions that belong to the same label. It splits the image, pixel by pixel.

It has four types of image segmentation techniques:

  • Color Segmentation
  • Instance Segmentation
  • Semantic Segmentation
  • Panoptic Segmentation

Color segmentation is a type of image segmentation technique. In this method, pixels having the same color are assigned to the same segment or class label.

Instance segmentation is a type of image segmentation technique. In this method, even objects belonging to the same category can be assigned different class labels.

Semantic segmentation is a type of image segmentation technique. This method was quite opposite to instance segmentation. In this method, objects belonging to the same category are assigned the same class label.

Panoptic segmentation is a type of image segmentation technique. This method is a combination of instance segmentation and semantic segmentation. Instance segmentation can be used for images that have countable classes, whereas semantic segmentation can be used for uncountable objects.

image can be identified by:

  • height of the image
  • width of the image
  • number of channels

gaussian mixture:

It is used to organize the data by checking its similarities and differences between them.

dimensionality reduction:

It is used to reduce the variables in the training portion and helps the core essence of machine learning models.

What are you going to see in this material?

  • about clustering algorithms 
  • K-means clustering algorithm
  • DBSCAN clustering algorithm 
  • image segmentation
  • gaussian mixture
  • dimensionality reduction
  • types of PCA 
link for the material: ML-UNIT-4

 

Wednesday, November 15, 2023

UNIT-3-ml



Welcome to the letslearningcse blog! today In this post, I came up with some cool and interesting stuff in machine learning that is none other than ensemble learning. According to the JNTU syllabus, ensemble learning is unit 3 of machine learning. 
 
We'll start with a brief introduction to classification and its types.
Classification is nothing but a supervised learning technique that enhances categorical data for its target variable. This kind of target output is called classification.
There are two types of classifications:
  • Binary Classification
  • Multi-class Classification

Binary Classification: If a target variable contains categorical data with exactly 2 categories, this is known as binary classification.

Multi-class Classification: If a target variable contains categorical data with more than two categories, this is known as multi-class classification. Here we have multiple class labels present in the given dataset. It has two types of mechanisms:

  • One vs. All [OVA] or One vs. Rest [OVR]: n-class instances or class labels generate n-binary classifier models. formula: n classes=n classifiers
  • One vs. One: n-class instances or labels generate n (n-1)/2 binary classifier models.                    formula:n classes = n(n-1)/2 classifiers

MNIST [Modified National Institute of Standard Technology] Dataset:

  • It is a set of 70,000 small images of (0–9) digits handwritten by students and employees of the US Census Bureau.
  • This is considered a hello-world program in deep learning, which is a subset of machine learning.
  • MNIST is a dataset of handwritten digits, consisting of 70,000 images of size 28x28 pixels.
  • The dataset is divided into two sets: 60,000 images for training and 10,000 images for testing purposes.
  • The sklearn.dataset package contains three major functions for datasets.
  • load: function loads small toy datasets [.csv files] connected to sklearn
  • fetch: A function such as fetch_openml() can be used to load real-world datasets.
  • make: This function generates the fake datasets useful for testing.
Let's get into a brief introduction to ensemble learning. It is nothing but the addition of numerous machine learning modals to provide an efficient method.
It has mainly two types of ensembles:

  • Homogeneous ensemble
In this ensemble, it uses the same algorithm for various models.
  • Heterogeneous ensemble:
In this type of ensemble technique, different algorithms are used. 
 
Sequential ensemble means the model depends on other models output weighted datasets [error-contained data partitions] and does the processing until the maximum is reached or the output is error-free.
Parallel ensemble means a model independent of other models, and each model predicts the output independently.
 
Ensemble techniques were classified into two types:
 
Traditional Techniques:
    • Mean: We all know that the basic principle of mean is the ratio of the sum of observations by the number of observations.
    • Mode: the item that has the majority of repeats is the mode. 
    • Weighted Mean: It is nothing but the mean having some weights for their individuals.
Advanced Techniques:
  • Boosting: Boosting is a type of ensemble learning that combines the weak learners and forms a strong learner to perform the predictions on new data.
  • Bagging: Bagging is a combination of two words [bootstrap and aggregate]. Bootstrap means randomly creating samples of data out of a dataset with replacement, and Aggregation subsets of bootstrap data are given as training data to predict the aggregate output to new data when sampling is preferred. Replacement is called bagging, and without replacement, it is called posting.
  • Random Forest:This algorithm builds multiple decision trees and merges them together to get more accurate and stable predictions. Then it gets predictions from each tree, and by means of majority voting, it selects the decision that gets the majority vote.
  • Voting Classifier: A very simple way to create a better classifier is to aggregate the predictions of each classifier and predict the class that gets the most votes.
  • Stacking [blending] was introduced by Walpert. It is also known as a stacked generalization, and it is an extended form of the model averaging ensemble technique in which all submodels equally participate as per the performance weights and build a new model with better predictions.
What are you going to see in the material?
  • Classification and its types
  • Performance measures
  • MNIST dataset and different types of dataset
  • about ensemble learning
  • ensemble classification
  • traditional ensemble learning
  • advanced ensemble learning
    • boosting
    • bagging
    • random forest
    • voting classifier
    • stacking 
link for the material: UNIT-3-ML

 

Tuesday, August 1, 2023

R20-AI&ML3-1 ----------Machine Learning [ML] Notes

 material links of unit 1&2&3:

UNIT-1      UNIT- 2&3

Lab manual link:

Machine Learning-LAB-R20-3-1

LetsLearningCse.blogspot.com welcomes you to the world of knowledge on technology. In this blog post, you are going to experience a new kind of knowledge regarding artificial intelligence and machine learning. Without delay, let's get into the topic.

Well, let's start with a brief introduction to artificial intelligence and machine learning.

Artificial intelligence is a branch of computer science in which we can create intelligent machines that can behave like humans, think like humans, and make decisions. Actually In 1951, the first AI program was introduced by Christopher, and AI was introduced by John McCarthy in 1955.




 

Machine learning is the field of study that gives computers the ability to learn without being explicitly programmed.It was introduced by Arthur Samuel in 1959. It enhances systems to learn from data, improve performance from experience, and predict new data without human interference. Machine learning is a subset of AI.

Deep learning is a collection of statistical techniques for machine learning feature hierarchies that are actually based on artificial neural networks. I was introduced by Dina Dechter in 1986. It is subset of Machine learning

Before going into our main concept of machine learning, see various areas that use machine learning; they are image recognition, virtual personal assistants, automatic translation, traffic prediction, web search and recommendation engines, online fraud detection, medical diagnosis, text and speech recognition, email spam filtering, etc.

Tip: If you know this 7-step process in machine learning, it's clear that you can build any project in machine learning in an efficient manner.

  • Define the problem. [Understand the problem first.]
  • Data Gathering
  • Data preprocessing [noisy data removal, data splitting]
  • Choose model
  • Train the model.
  • Test the model.
  • Deployment or prediction

Types of machine learning:

  • Whether or not they are trained under human supervision (SUPERVISED, UNSUPERVISED, SEMI-SUPERVISED, and REINFORCEMENT LEARNING).
  • Whether or not they can learn incrementally on the fly (Online Learning vs Batch Learning)
  • Whether they work by simply comparing new data points to known data points or instead detect patterns in the training data and build a predictive model [instance-based learning versus model-based learning]

Most of the time, we discuss the human supervision type of machine learning.

  • Supervised learning
  • Unsupervised learning
  • semi-supervised learning
  • Reinforcement learning

Supervised learning: we train the machines using the labeled dataset, and based on the training, the machine predicts the output. In this, we feed training data to an algorithm that includes the desired solutions in it. It has two methods to solve problems, which are:

  • Classification: it was used when output data is categorical data.
  • Regression: it was used for predicting or estimating a continuous or quantitative output value.

e.g., image recognition, spam detection

Unsupervised learning: In this model, the model, the models are trained using an unlabeled dataset and predict new data without any supervision, so we say it is unsupervised. It was easier as compared to a labeled dataset. It has two methods:

  • Clustering: method of grouping data items that are similar into a single cluster
  • Association: It is used for finding the relationships between variables in large data sets.

Semi-supervised learning lies in between supervised and unsupervised learning. To overcome the drawbacks of both, it came into existence. Its training data is a combination of both labeled and unlabeled data. It has both the features of supervised and unsupervised learning.

Reinforcement learning: we simply say it as feed-back learning. It follows the trail-and-error method to get the desired solution.

Loss Functions:

Loss is a number indicating how bad the model's prediction was on the sample

Training loss: it is the error of the model on the training set.

Testing loss: it is the error of the model on the testing set.

A loss function measures the error between the predicted and actual values in a machine learning model.

There are different loss functions, such as

  • Mean Squared Error (MSE)
  • Cross-entropy loss
  • Mean Absolute Error (MAE)
  • Huber loss
  • Hinge loss
  • Quantile loss