Describe Artificial Intelligence and Machine Learning
Describe Artificial Intelligence and Machine Learning
Machine Learning
A rapidly developing field of technology, machine learning allows
computers to automatically learn from previous data.
For building mathematical models and making predictions based on
historical data or information, machine learning employs a variety of
algorithms.
It is cur rently being used for a variety of tasks, including speech
recognition, email filtering, auto-tagging on Facebook, a recommender
system, and image recognition.
In the real world, we are surrounded by humans who can learn everything from
their experiences with their learning capability, and we have computers or
machines which work on our instructions.
But can a machine also learn from experiences or past data like a human does?
So here comes the role of Machine Learning.
2.Summarize the milestones in Machine Learning.
Year(s) Milestone
1948–1949 The first autonomous robots were created by William Grey Walter. They could navigate
around obstacles using light and touch.
1950 Alan Turing published the seminal paper, “Computing Machinery and Intelligence,” in
which he posed the question “Can machines think?” and developed the Turing Test to
answer the question.
1951 Marvin Minksy and Dean Edmonds built the first artificial neural network.
1956 The Dartmouth Summer Research Project on Artificial Intelligence was convened. It is
considered to be the birth of the field of artificial intelligence.
1959 Arthur Samuel coined the term “machine learning” when describing machines that can
learn to play checkers.
1964–1966 ELIZA, developed by Joseph Weizenbaum, became the first natural language processing
program able to simulate conversation.
1966 Shakey became the first intelligent robot. It was able to perceive its environment, plan
routes, recover from errors, and communicate in simple English.
1969 An optimized method for a backpropagation algorithm was published by Caltech
alumnus Arthur Bryson and Yu-Chi Ho. This algorithm was key to enabling AI systems
to improve on their own using their past errors.
1978 Texas Instruments’ Dallas research laboratory introduces the Speak & Spell, an
educational toy that used a single silicon chip to electronically duplicate a human vocal
tract.
1982 John Hopfield, a former Caltech faculty member, developed a neural network model to
help explain how humans recall memories. The model helped to advance deep-learning
technologies.
1989 Chess master David Levy lost a game to a computer for the first time.
1991 The introduction of the internet enabled online connections and data to be shared quickly
and easily. This boost in data sharing had a significant impact on the advancement of AI.
1996 IBM’s Deep Blue computer defeated world champion Garry Kasparov in the first of a
six-game chess series.
2005 Five autonomous vehicles successfully completed DARPA’s 2005 Grand Challenge, a
212-kilometer off-road course through the Mojave Desert.
2007 Caltech Distinguished Alumna Fei-Fei Li conceived and led the ImageNet project, a
database that includes millions of labeled images available for computer vision research,
highlighting the critical importance of large datasets in advancing AI.
2010 Siri, a voice-controlled virtual assistant, was released.
2012 AlexNet, an image-recognition model, completed the ImageNet Large Scale Visual
Recognition Challenge with far greater accuracy than its predecessors. The publication
of the AlexNet architecture is considered one of the most influential papers in computer
vision.
2016 AI system AlphaGo, created by Google subsidiary DeepMind, defeated Go champion
Lee Se-dol four matches to one.
2018 Joy Buolamwini and Timnit Gebru published the influential report, “Gender Shades:
Intersectional Accuracy Disparities in Commercial Gender Classification,”
demonstrating that machine-learning algorithms were prone to discrimination based on
classifications such as gender and race
2018 Waymo’s self-driving taxi service was offered in Phoenix, Arizona.
2020 Artificial intelligence research laboratory OpenAI announced the development of
Generative Pre-Trained Transformer 3 (GPT-3), a language model capable of producing
text with human-like fluency.
1. Describe the Machine Learning Workflow/Process Steps with neat diagram.
Machine Learning is the learning in which a machine can learn on its own
without being explicitly programmed. It is an application of AI that provides the
system the ability to automatically learn and improve from experience.
One of the simple definitions of Machine Learning is
“Machine Learning is said to learn from experience E w.r.t some class of
task T and a performance measure P if learners performance at the task in
the class as measured by P improves with experiences.”
There are different types of ML models, depending on their intended function
and structure:
1. Explain the types of Machine Learning with example.
Example: Suppose the unsupervised learning algorithm is given an input dataset containing
images of different types of cats and dogs. The algorithm is never trained upon the given
dataset, which means it does not have any idea about the features of the dataset. The task of
the unsupervised learning algorithm is to identify the image features on their own.
Unsupervised learning algorithm will perform this task by clustering the image dataset into
the groups according to similarities between images.
Here, we have taken an unlabeled input data, which means it is not categorized
and corresponding outputs are also not given. Now, this unlabeled input data is
fed to the machine learning model in order to train it. Firstly, it will interpret the
raw data to find the hidden patterns from the data and then will apply suitable
algorithms such as k-means clustering, Decision tree, etc.6y
Once it applies the suitable algorithm, the algorithm divides the data objects
into groups according to the similarities and difference between the objects.
Semi-supervised learning :
Semi-supervised learning is a type of machine learning that falls in between
supervised and unsupervised learning.
It is a method that uses a small amount of labeled data and a large amount of
unlabeled data to train a model.
The goal of semi-supervised learning is to learn a function that can accurately predict
the output variable based on the input variables, similar to supervised learning.
However, unlike supervised learning, the algorithm is trained on a dataset that
contains both labeled and unlabeled data.
Semi-supervised learning is particularly useful when there is a large amount of
unlabeled data available, but it’s too expensive or difficult to label all of it.
Intuitively, one may imagine the three types of learning algorithms as Supervised
learning where a student is under the supervision of a teacher at both home and
school,
Unsupervised learning where a student has to figure out a concept himself and Semi-
Supervised learning where a teacher teaches a few concepts in class and gives
questions as homework which are based on similar concepts.
a) **Classification**:
Classification is a supervised learning technique where the goal is to categorize items into a
predefined set of classes or categories. It's commonly used in machine learning for tasks like
spam detection, sentiment analysis, image recognition, etc. Classification can be of two main
types:
i) **Binary Classification**: In binary classification, the task is to classify items into one of
two classes. For example, determining whether an email is spam or not spam, predicting
whether a patient has a disease or not, etc.
ii) **Multi-class Classification**: In multi-class classification, there are more than two
classes, and the task is to classify items into one of multiple classes. For example, classifying
images of animals into categories like dog, cat, horse, etc.
In both cases, classification algorithms such as logistic regression, decision trees, support
vector machines, and neural networks can be used.
b) **Clustering**:
Clustering is an unsupervised learning technique used to group similar items together in
such a way that items in the same group (or cluster) are more similar to each other than to
those in other groups. Unlike classification, clustering does not have predefined classes, and
the algorithm tries to discover the inherent structure in the data. Some common clustering
algorithms include K-means clustering, hierarchical clustering, DBSCAN, and Gaussian
mixture models.
c) **Association**:
Association analysis is a data mining technique used to discover interesting relationships or
associations among a set of items in large datasets. It aims to find patterns where one event
leads to another. The most common application of association analysis is market basket
analysis, where the goal is to identify items that are frequently bought together.
Association rule mining algorithms such as Apriori and FP-Growth are commonly used for
this task. These algorithms identify strong associations between items by examining the
frequency of itemsets in the dataset. An association rule typically has two parts: an antecedent
(if) and a consequent (then). For example, "if a customer buys bread and milk, then they are
likely to buy eggs."
1. **Objective**:
- **Clustering**: Clustering is an unsupervised learning technique where the goal is to
group similar data points together based on their inherent characteristics or features. The
objective is to discover the underlying structure in the data without any prior knowledge of
class labels.
- **Classification**: Classification is a supervised learning technique where the goal is to
predict the class label of a data instance based on its features. The objective is to learn a
mapping from input features to predefined class labels using labeled training data.
2. **Supervision**:
- **Clustering**: Clustering is unsupervised, meaning it does not require labeled data. The
algorithm identifies similarities between data points and groups them together without any
external guidance.
- **Classification**: Classification is supervised, meaning it requires labeled training data
where each data instance is associated with a class label. The algorithm learns from these
labels to make predictions on unseen data.
3. **Output**:
- **Clustering**: The output of clustering is the grouping of data points into clusters. There
are no predefined classes, and the clusters are formed based on similarities in the data.
- **Classification**: The output of classification is a prediction or classification label for
each data instance. The algorithm assigns each instance to one of the predefined classes based
on learned patterns from the training data.
4. **Task Complexity**:
- **Clustering**: Clustering is generally considered less complex than classification
because it does not require labeled data or prior knowledge of class labels. However,
determining the optimal number of clusters and interpreting the results can be challenging.
- **Classification**: Classification can be more complex than clustering because it relies
on labeled data and requires the algorithm to learn the relationship between features and class
labels. Additionally, different classification algorithms may have varying levels of
complexity.
5. **Applications**:
- **Clustering**: Clustering is commonly used for tasks such as customer segmentation,
anomaly detection, pattern recognition, and image segmentation.
- **Classification**: Classification is used for tasks such as spam detection, sentiment
analysis, object recognition, and medical diagnosis.
8.Explain Exploratory Data Analysis (EDA) in detail.
In summary, clustering and classification are both machine learning techniques used for
different purposes. Clustering is used to discover the inherent structure in data by grouping
similar data points together, while classification is used to predict the class label of a data
instance based on its features and labeled training data.
8.Explain Exploratory Data Analysis (EDA) in detail.
d) Exploratory Data Analysis (EDA) is an approach to analyzing datasets to
summarize their main characteristics, often employing statistical graphics and
other data visualization methods. It is typically one of the initial steps in data
analysis, performed after data collection and cleaning, but before formal
modeling or hypothesis testing. The main goals of EDA are to understand the
structure of the data, uncover patterns, detect outliers and anomalies, and
generate hypotheses for further investigation.
e)
f) Here's a detailed explanation of the key components and techniques used in
Exploratory Data Analysis:
g)
h) 1. **Data Summary**:
i) - EDA starts by summarizing the main characteristics of the dataset. This
includes basic statistical measures such as mean, median, mode, standard
deviation, range, etc., for numerical variables, and frequency tables or bar
charts for categorical variables.
j) - Summary statistics provide an initial understanding of the central tendency,
dispersion, and shape of the data distribution.
k)
l) 2. **Data Visualization**:
m) - Visualization plays a crucial role in EDA, allowing analysts to explore the
data visually and gain insights that may not be apparent from summary statistics
alone.
n) - Common visualization techniques include histograms, box plots, scatter
plots, line plots, bar plots, pie charts, heatmaps, and violin plots.
o) - Visualizing relationships between variables helps in understanding patterns,
trends, correlations, and potential outliers.
p)
q) 3. **Data Cleaning and Preprocessing**:
r) - During EDA, analysts often identify missing values, outliers, or
inconsistencies in the data and take steps to address them.
s) - This may involve imputing missing values, removing outliers, transforming
variables, or encoding categorical variables.
t) - Data cleaning and preprocessing are iterative processes that may continue
throughout the analysis as new insights are gained.
u)
v) 4. **Univariate Analysis**:
w) - Univariate analysis focuses on examining individual variables in isolation. It
includes visualizations and summary statistics for each variable separately.
x) - For numerical variables, analysts may look at measures of central tendency,
dispersion, skewness, and kurtosis. Histograms and box plots are commonly
used for visualizing numerical data distributions.
y) - For categorical variables, frequency tables, bar plots, and pie charts are used
to display the distribution of categories.
z)
aa) 5. **Bivariate and Multivariate Analysis**:
bb) - Bivariate and multivariate analysis involve exploring relationships between
two or more variables.
cc) - Scatter plots, correlation matrices, and heatmaps are used to visualize
relationships between pairs of numerical variables.
dd) - For categorical variables, contingency tables and mosaic plots can reveal
associations between categories.
ee) - Multivariate analysis explores interactions between multiple variables
simultaneously, often using techniques like principal component analysis
(PCA) or multidimensional scaling (MDS).
ff)
gg) 6. **Dimensionality Reduction**:
hh) - EDA may involve reducing the dimensionality of the dataset to simplify
analysis and visualization.
ii) - Techniques like PCA, t-distributed unstable neighbor embedding (t-SNE),
and autoencoders can reduce high-dimensional data to a lower-dimensional
representation while preserving as much information as possible.
jj)
kk) 7. **Hypothesis Generation**:
ll) - EDA often leads to the generation of hypotheses or educated guesses about
relationships or patterns in the data.
mm) - These hypotheses can be further investigated using formal statistical tests
or machine learning models in later stages of analysis.
nn)
oo) Overall, Exploratory Data Analysis is a flexible and iterative process that helps
analysts gain a deeper understanding of the dataset, identify important features,
and formulate hypotheses for further investigation. It involves a combination of
statistical analysis, data visualization, and domain knowledge to extract
meaningful insights from the data.
In Regression, the output variable must be of continuous nature or real In Classification, the output variable
value.
The task of the regression algorithm is to map the input value (x) with The task of the classification algo
the continuous output variable(y). value(x) with the discrete output var
Regression Algorithms are used with continuous data. Classification Algorithms are used w
In Regression, we try to find the best fit line, which can predict the In Classification, we try to find the
output more accurately. can divide the dataset into different
Regression algorithms can be used to solve the regression problems Classification Algorithms can be u
such as Weather Prediction, House price prediction, etc. problems such as Identification
Recognition, Identification of cance
The regression Algorithm can be further divided into Linear and Non- The Classification algorithms can
linear Regression. Classifier and Multi-class Classifier
2. *Output:*
- *Linear Regression:* The output is a continuous numeric value. The model predicts a
value that falls within the range of possible values for the dependent variable.
- *Logistic Regression:* The output is a probability value between 0 and 1, which is then
used to classify the input into one of the two categories.
4. *Assumptions:*
- *Linear Regression:* Assumes a linear relationship between the independent and
dependent variables, homoscedasticity (constant variance of the errors), independence of
errors, and normally distributed errors.
- *Logistic Regression:* Assumes a linear relationship between the logit of the probability
and the independent variables, independence of observations, and no perfect
multicollinearity.
5. *Interpretation of Coefficients:*
- *Linear Regression:* Coefficients represent the change in the dependent variable for a
one-unit change in the independent variable.
- *Logistic Regression:* Coefficients represent the change in the log odds of the dependent
variable being 1 for a one-unit change in the independent variable.
6. *Optimization:*
- *Linear Regression:* Typically uses ordinary least squares (OLS) to minimize the sum of
squared residuals.
- *Logistic Regression:* Typically uses maximum likelihood estimation (MLE) to find the
best-fitting model.
Understanding these differences helps in choosing the appropriate model for a given
prediction task. Linear regression is suitable for predicting continuous outcomes, while
logistic regression is ideal for binary classification tasks.
3. *Polynomial Regression:*
- *Definition:* A type of regression where the relationship between the
independent variable and the dependent variable is modeled as an nth-degree
polynomial.
- *Equation:*
\[
y = \beta_0 + \beta_1 x + \beta_2 x^2 + \cdots + \beta_n x^n + \epsilon
\]
- *Use Case:* Used when the data shows a nonlinear relationship. For
example, modeling the growth rate of bacteria which doesn't follow a straight
line.
7. *Stepwise Regression:*
- *Definition:* A method that involves adding or removing predictors based
on certain criteria, typically to enhance model performance.
- *Use Case:* Used to determine which independent variables are significant
in predicting the dependent variable.
These types of linear regression models cater to different types of data and
analysis requirements, helping to improve the accuracy and reliability of
predictive modeling.
aaaaa) How will you explain the difference between Linear regression and
multiple regression?
The terms "linear regression" and "multiple regression" can sometimes cause
confusion because "multiple regression" is actually a subset of "linear regression."
Here's a concise explanation of the difference:
1. *Linear Regression:*
- *Definition:* Linear regression refers to any regression analysis in which the
relationship between the dependent variable and one or more independent variables
is modeled using a linear equation. It encompasses both simple and multiple linear
regression.
- *Types:*
- *Simple Linear Regression:* Involves one independent variable and one
dependent variable. The model attempts to find the best-fit line that describes the
relationship between these two variables.
- *Equation:* \( y = \beta_0 + \beta_1 x + \epsilon \)
- *Example:* Predicting a person's weight based on their height.
2. *Multiple Regression:*
- *Definition:* A specific type of linear regression where there are multiple
independent variables predicting a single dependent variable. It is called "multiple"
because it deals with more than one predictor variable.
- *Equation:* \( y = \beta_0 + \beta_1 x_1 + \beta_2 x_2 + \cdots + \beta_n x_n +
\epsilon \)
- *Example:* Predicting a student's academic performance based on hours
studied, attendance, and extracurricular activities.
*Key Differences:*
- *Number of Independent Variables:*
- *Simple Linear Regression:* Involves only one independent variable.
- *Multiple Linear Regression:* Involves two or more independent variables.
- *Model Complexity:*
- *Simple Linear Regression:* Models the relationship with a single predictor,
making it simpler and easier to interpret.
- *Multiple Linear Regression:* Models the relationship with multiple predictors,
allowing for more complex and potentially more accurate predictions but can be
harder to interpret.
*Summary:*
- *Linear Regression* is a broad term that includes both simple and multiple
regression models.
- *Multiple Regression* specifically refers to linear regression models that use
more than one independent variable to predict the dependent variable.
x 2 4 6 8
y 3 7 5 10
Sol: To find the linear regression equation we need to find the value of Σx, Σy, Σx 2
and Σxy .Construct the table and find the value
x y x² xy
2 3 4 6
4 7 16 28
6 5 36 30
8 10 64 80
Σx Σy Σx² = Σxy =
= =
120 144
20 25
The formula of the linear equation is y=a+bx. Using the formula we will find the
value of a and b
Hence we got the value of a = 1.5 and b = 0.95.The linear equation is given by Y = a + bx
Now put the value of a and b in the equation. Hence equation of linear regression is
y = 1.5 + 0.95x
18. Discuss the Logistic regression with example.
Logistic Regression:
• Logistic regression is another supervised learning algorithm which is used to solve the
classification problems.
• In classification problems, we have dependent variables in a binary or discrete
format such as 0 or 1.
• Logistic regression algorithm works with the categorical variable such as 0 or 1, Yes
or No, True or False, Spam or not spam, etc.
• It is a predictive analysis algorithm which works on the concept of probability.
• Logistic regression is a type of regression, but it is different from the linear regression
algorithm in the term how they are used.
• Logistic regression uses sigmoid function or logistic function which is a complex
cost function.
• This sigmoid function is used to model the data in logistic regression.
• The function can be represented as:
• f(x)= Output between the 0 and 1 value.
• x= input to the function
• e= base of natural logarithm.