QUIZ Data

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

Quiz # 1

1. How do you sure which Machine Learning Algorithm to use?


ANS: It completely depends on the dataset we have. If the data is discrete, we use
SVM. If the dataset is continuous, we use linear regression. So, there is no specific
way that lets us know which ML algorithm to use, it all depends on the
exploratory data analysis (EDA). EDA is like “interviewing” the dataset; As part of
our interview, we do the following: Classify our variables as continuous,
categorical, and so forth. Summarize our variables using descriptive statistics.
Visualize our variables using charts. Based on the above observations select one
best-fit algorithm for a particular dataset.
2.Why Data split into K-subset in the Cross Validation Process?
Ans: K-fold cross-validation is a technique for evaluating predictive models. The
dataset is divided into k subsets or folds. The model is trained and evaluated k
times, using a different fold as the validation set each time. Performance metrics
from each fold are averaged to estimate the model's generalization performance.
3. What is ‘Naive’ in a Naive Bayes?
Ans: The Naive Bayes method is a supervised learning algorithm; it is naive since it
makes assumptions by applying Bayes’ theorem that all attributes are
independent of each other.
Bayes’ theorem states the following relationship, given class variable y and
dependent vector x1 through xn:
P (Yi | x1,, xn) =P(yi)P(x1,..., xn | yi)(P(x1,...,
4. How is machine learning used in day-to-day life?
Ans: Most of the people are already using machine learning in their everyday life.
Assume that you are engaging with the internet, you are actually expressing your
preferences, likes, dislikes through your searches. All these things are picked up
by cookies coming on your computer, from this, the behavior of a user is
evaluated. It helps to increase the progress of a user through the internet and
provide similar suggestions.
5. How does Kernal work inn SVM?
Ans: The function of kernel is to take data as input and transform it into the
required form. Different SVM algorithms use different types of kernel functions.
These functions can be different types.
6. How long does cross validation work at last?
Ans: Cross-validation is a method of splitting all your data into three parts:
training, testing, and validation data. Data is split into k subsets, and the model
has trained on k-1of those datasets. The last subset is held for testing. This is done
for each of the subsets. This is k-fold cross-validation. Finally, the scores from all
the k-folds are averaged to produce the final score.
7. Describe the Advantages of Unsupervised Machine Learning!
ANS: Requires less manual data preparation (i.e., no hand labelling) than
supervised machine learning, it can handle large and complex data without
human intervention and reveal novel and unexpected findings.
8. Why we use Vectorization?
Ans: Vectorization allows the elimination of the for-loops in python code. It is
especially important in Deep learning as we are dealing with large numbers of
datasets. So, it allows the code to run quickly and helps train the algorithms
faster.
9. What is vectorization?
Ans: Vectorization or word embedding is the process of converting text data to
numerical vectors. Later those vectors are used to build various machine learning
models. In this manner, we say this as extracting features with the help of text
with an aim to build multiple natural languages, processing models, etc
10. What is Gradient Descent? Write its slope by the help of graph!
Ans: Gradient Descent is an optimization algorithm for finding a local minimum of
a differentiable function. Gradient descent in machine learning is simply used to
find the values of a function's parameters (coefficients) that minimize a cost
function as far as possible.
In the process we represent this: Gradient = change in Y / change in X.
Y= mx- b
There are two types of slop:
• Positive slop
• Negative slop

Quiz # 2
1. What is difference between predictive and actual value and write the
formula for finding predictive and actual value!
Ans: In statistics, the actual value is the value that is obtained by observation or
by measuring the available data. It is also called the observed value. The predicted
value is the value of the variable predicted based on the regression analysis.

The difference between the actual value or observed value and the predicted
value is called the residual in regression analysis.
We use formula for finding predictive and actual value by using this formula
Sum = .
2. Can Logistic regression used more than two class?
Ans: No, logistic regression is a binary classifier, so it cannot be applied to more
than 2 classes. For multi-class classification, we can use decision tree algorithms,
Naive Bayes algorithms are well suited
3.Write down the loss function and cost function!
Ans: Loss function: is capture the difference between actual and predictive value
in single training record.
Cost function: Used to refer to an average of the loss functions over an entire
training dataset.
4. How do you make sure which Machine Learning Algorithm to use?
Ans: It completely depends on the dataset we have. If the data is discrete, we use
SVM. If the dataset is continuous, we use linear regression. So, there is no specific
way that lets us know which ML algorithm to use, it all depends on the
exploratory data analysis (EDA). EDA is like “interviewing” the dataset; As part of
our interview, we do the following: Classify our variables as continuous,
categorical, and so forth. Summarize our variables using descriptive statistics.
Visualize our variables using charts. Based on the above observations select one
best-fit algorithm for a particular dataset
5. How to Tackle Overfitting and Underfitting?
Ans: Overfitting means the model fitted to training data too well, in this case, we
need to resample the data and estimate the model accuracy using techniques like
k-fold cross-validation. Whereas for the Underfitting case we are not able to
understand or capture the patterns from the data, in this case, we need to change
the algorithms, or we need to feed more data points to the model
6. Is E-mail spam is applicable in Supervised Machine Learning?
Ans: yes, widely used supervised machine learning techniques namely C 4.5
Decision tree classifier, Multilayer Perceptron, Naïve Bayes Classifier are used for
learning the features of spam emails and the model is built by training with
known spam emails and legitimate emails.
7. How will you know which machine learning algorithm to choose for your
classification problem?
Ans : While there is no fixed rule to choose an algorithm for a classification
problem, you can follow these guidelines:

• If accuracy is a concern, test different algorithms and cross-validate them


• If the training dataset is small, use models that have low variance and high
bias
• If the training dataset is large, use models that have high variance and little
bias.

8. When will you use Regression?


Ans: The main uses of regression analysis are forecasting, time series modelling
and finding the cause-and-effect relationship between variables.
9. Why overfitting occur?
Ans: Overfitting occurs when our machine learning model tries to cover all the
data points, or more than the required data points present in the given dataset
10. Write down the method to Avoid from overfitting!
Ans: Overfitting cause the degraded performance of the machine learning model.
But the main cause is overfitting, so there are some ways by which we can reduce
the occurrence of overfitting in our model.
• Cross-Validation
• Training with more data
• Removing features
• Early stopping the training
• Regularization
• Ensembling

Quiz #3
1. How does Machine Learning Differ from Deep Learning?
Ans: Machine Learning means computers learning from data using algorithms to
perform a task without being explicitly programmed. Deep Learning uses a
complex structure of algorithms modelled on the human brain. This enables the
processing of unstructured data such as documents, images, and text
2. Write down the three steps in hypothesis in Machine Learning model!
• Assume a null hypothesis, usually in machine learning algorithms we
consider that there is no anomaly between the target and independent
variable.
• Collect a sample.
• Calculate test statistics.
3. Describe the precision and Recall!
Ans: Precision and recall are two evaluation metrics used to measure the
performance of a classifier in binary and multiclass classification problems.
Precision measures the accuracy of positive predictions, while recall measures the
completeness of positive predictions
4. Why deep learning need high- end machine?
ANS: Deep learning systems require powerful hardware because they have a large
amount of data being processed and involves several complex mathematical
calculations. Even with such advanced hardware, however, training a neural
network can take weeks. Therefore, we need to use high-end machine.
5. Write down the sentiment analysis as a application of supervised machine
learning!
Ans: sentiment analysis using machine learning can help any business analysis
public opinion, improve customer support, and automate tasks with fast
turnarounds. Not only saving you time, but also money.
6. What is Ensemble Learning?
Ans: Ensemble learning is a method that combines multiple machine learning
models to create more powerful models.
There are many reasons for a model to be different. Few reasons are:
⦁ Different Population
⦁ Different Hypothesis
⦁ Different modeling techniques
When working with the model’s training and testing data, we will experience an
error. This error might be bias, variance, and irreducible error. Now the model
should always have a balance between bias and variance, which we call a bias-
variance trade-off. This ensemble learning is a way to perform this trade-off.
There are many ensemble techniques available but when aggregating multiple
models there are two general methods:
⦁ Bagging, a native method: take the training set and generate new training
sets from it.
⦁ Boosting, a more elegant method: similar to bagging, boosting is used to
optimize the best weighting scheme for a training set.
7. How does you sure the bias is occurring in Machine Learning?
Ans: Labeling bias occurs when your data has incorrect or inconsistent labels or
annotations, leading to misleading or confusing information. Lastly, algorithmic
bias can occur when your data is affected by the assumptions, preferences, or
limitations of the ML algorithm or technique, resulting in unfair or biased
outcomes.
8. How to Handle Outlier values?
• . Set up a filter in your testing tool. Even though this has a little cost,
filtering out outliers is worth it. ...
• Remove or change outliers during post-test analysis. ...
• Change the value of outliers. ...
• Consider the underlying distribution. ...
• Consider the value of mild outliers
9. What are reasons in machine learning model for making a model
unsupervised?
Ans: The main goal of unsupervised learning is to discover hidden and interesting
patterns in unlabelled data. Unlike supervised learning, unsupervised learning
methods cannot be directly applied to a regression or a classification problem as
one has no idea what the values for the output might be.
10. What is meant by local Minima?
Ans: local minimum (plural local minimums or local minima) (mathematics) A
point on a graph (or its associated function) whose value is less than all other
points near it.

Let us take the points in the immediate neighbourhood of x = 1. The points are {0,
2}. The derivative of the function is negative towards the left of x = 1, and is
positive towards the right. Hence x = 1 is the local minima.

Quiz # 4
1. What is Activation Function?
Ans: An Activation Function decides whether a neuron should be activated or

not. This means that it will decide whether the neuron’s input to the network is

important or not in the process of prediction using simpler mathematical

operations.

The role of the Activation Function is to derive output from a set of input values

fed to a node (or a layer).

2. Write down the steps of data preprocessing!


Ans:
• Getting Dataset
• Importing Libraries
• Importing Dataset
• Finding Missing Value
• Encode Categorical Data
• Splitting Dataset into training and test set
• Feature Scaling
3. Why we use decision tree model? Is this supervised?
Ans:
A decision tree is a supervised learning algorithm that is used for classification and
regression modelling. Regression is a method used for predictive modeling, so
these trees are used to either classify data or predict what will come next
4. What is Feature Scaling?
Ans: Feature Scaling is a technique to standardize the independent features
present in the data in a fixed range. It is performed during the data pre-processing
to handle highly varying magnitudes or value
5.Diffrence between soft wax and sigmoid!
Ans: The sigmoid function is used for binary classification. The probabilities sum
needs to be 1. Whereas SoftMax function is used for multi-classification. The
probabilities sum will be 1.
6. How you get Training Set and Training Test?
Ans: The simplest way to split the modelling dataset into training and testing sets
is to assign 2/3 data points to the former and the remaining one-third to the
latter. Therefore, we train the model using the training set and then apply the
model to the test set. In this way, we can evaluate the performance of our model.
7. How to Handle Missing data in dataset?
Ans:
• Deleting Rows with missing values.
• Impute missing values for continuous variable.
• Impute missing values for categorical variable.
• Other Imputation Methods.
• Using Algorithms that support missing values.
• Prediction of missing values.

8. How will you Explain Linked list and array?


Ans:
ARRAY LINKED LIST
• An array is a group of elements • Linked List is an ordered group
of a similar data type. of elements of the same type,
which are connected using
pointers.
• Elements are stored • New elements can be stored
consecutively in the memory. anywhere in memory.
• An Array supports Random • Linked List supports
Access. It means that the Sequential Access. It means
elements can be accessed that we have to traverse the
directly using their index value, complete linked list, up to that
like arr[0] for 1st element, element sequentially which
arr[5] for 6th element, etc. element/node we want to
As a result, accessing elements access in a linked list.
in an array is fast with To access the nth element of a
constant time complexity of linked list, the time complexity
O(1). is O(n).
• Memory is allocated at • Memory is allocated at
compile time as soon as the runtime, whenever a new
array is declared. It is known node is added. It is known as
as Static Memory Allocation. Dynamic Memory Allocation.
• Insertion and Deletion • In case of a linked list, a new
operation takes more time in element is stored at the first
the array, as the memory free available memory
locations are consecutive and location.
fixed. Thus, Insertion and Deletion
operations are fast in the
linked list.
• Size of the array must be • Size of a Linked list is variable.
declared at the time of array It grows at runtime whenever
declaration. node is added to it.

9.. Do you think that treating a categorical variable as a continuous variable


would result in a better predictive model?

Ans: For a better predictive model, the categorical variable can be considered as
a continuous variable only when the variable is ordinal in nature.

10. What is PCA?


Ans: Principal component analysis, or PCA, is a dimensionality reduction method
that is often used to reduce the dimensionality of large data sets, by transforming
a large set of variables into a smaller one that still contains most of the
information in the large set.
Quiz #5
1. What is dataset and write down its types .
Ans: A dataset is a collection of data in which data is arranged in some order. A
dataset can contain any data from a series of an array to a database table.
Types of dataset :
• Numerical data:Such as house price, temperature, etc.
• Categorical data:Such as Yes/No, True/False, Blue/green, etc.
• Ordinal data:These data are similar to categorical data but can be
measured on the basis of comparison.
2.Why do we need Data Preprocessing?
Ans: A real-world data generally contains noises, missing values, and maybe in an
unusable format which cannot be directly used for machine learning models. Data
preprocessing is required tasks for cleaning the data and making it suitable for a
machine learning model which also increases the accuracy and efficiency of a
machine learning model.
It involves below steps:
• Getting the dataset
• Importing libraries
• Importing datasets
• Finding Missing Data
• Encoding Categorical Data
• Splitting dataset into training and test set
• Feature scaling
3.What is Dimensionality Reduction?
Ans: The number of input features, variables, or columns present in a given
dataset is known as dimensionality, and the process to reduce these features is
called dimensionality reduction.
A dataset contains a huge number of input features in various cases, which makes
the predictive modeling task more complicated. Because it is very difficult to
visualize or make predictions for the training dataset with a high number of
features, for such cases, dimensionality reduction techniques are required to use.
4.Why use Unsupervised Learning?
Ans: Below are some main reasons which describe the importance of
Unsupervised Learning:
• Unsupervised learning is helpful for finding useful insights from the data.
• Unsupervised learning is much similar as a human learns to think by their
own experiences, which makes it closer to the real AI.
• Unsupervised learning works on unlabeled and uncategorized data which
make unsupervised learning more important.
In real-world, we do not always have input data with the corresponding output so
to solve such cases, we need unsupervised learning.
5.What is Clustering?
Ans: Clustering is the process of grouping a set of objects into a number of
groups. Objects should be similar to one another within the same cluster and
dissimilar to those in other clusters. A few types of clustering are:
Hierarchical clustering
K means clustering
Density-based clustering
Fuzzy clustering, etc.
6.Why is it called Naïve Bayes?
Ans: The Naïve Bayes algorithm is comprised of two words Naïve and Bayes,
Which can be described as:
Naïve: It is called Naïve because it assumes that the occurrence of a certain
feature is independent of the occurrence of other features. Such as if the fruit is
identified on the bases of color, shape, and taste, then red, spherical, and sweet
fruit is recognized as an apple. Hence each feature individually contributes to
identify that it is an apple without depending on each other.
Bayes: It is called Bayes because it depends on the principle of Bayes' Theorem.
7. What is Association Rule Learning?
Ans: Association rule learning is a type of unsupervised learning technique that
checks for the dependency of one data item on another data item and maps
accordingly so that it can be more profitable. It tries to find some interesting
relations or associations among the variables of dataset. It is based on different
rules to discover the interesting relations between variables in the database.
8: How does Gradient Descent work?
Ans: Before starting the working principle of gradient descent, we should know
some basic concepts to find out the slope of a line from linear regression. The
equation for simple linear regression is given as:
Y=mX+c
Where 'm' represents the slope of the line, and 'c' represents the intercepts on
the y-axis.
9. Write down the decision tree Termonology.
Ans: Root Node: Root node is from where the decision tree starts. It represents
the entire dataset, which further gets divided into two or more homogeneous
sets.
Leaf Node: Leaf nodes are the final output node, and the tree cannot be
segregated further after getting a leaf node.
Splitting: Splitting is the process of dividing the decision node/root node into sub-
nodes according to the given conditions.
Branch/Sub Tree: A tree formed by splitting the tree.
Pruning: Pruning is the process of removing the unwanted branches from the
tree.
Parent/Child node: The root node of the tree is called the parent node, and other
nodes are called the child nodes.
10. Write down the Type of Feature Selection Techniques.
Ans: There are mainly two types of Feature Selection techniques, which are:
• Supervised Feature Selection technique
Supervised Feature selection techniques consider the target variable and can be
used for the labelled dataset.
• Unsupervised Feature Selection technique
Unsupervised Feature selection techniques ignore the target variable and can be
used for the unlabelled dataset.
Quiz# 6
1.How is KNN different from k-means?
Ans: KNN or K nearest neighbors is a supervised algorithm which is used for
classification purpose. In KNN, a test sample is given as the class of the majority of
its nearest neighbors. On the other side, K-means is an unsupervised algorithm
which is mainly used for clustering. In k-means clustering, it needs a set of
unlabeled points and a threshold only. The algorithm further takes unlabeled data
and learns how to cluster it into groups by computing the mean of the distance
between different unlabeled points.
2.What do you understand by Reinforcement Learning technique?
Ans: Reinforcement learning is an algorithm technique used in Machine Learning.
It involves an agent that interacts with its environment by producing actions &
discovering errors or rewards. Reinforcement learning is employed by different
software and machines to search for the best suitable behavior or path it should
follow in a specific situation. It usually learns on the basis of reward or penalty
given for every action it performs.
3.What are the five popular algorithms we use in Machine Learning?
Ans: Five popular algorithms are:
• Decision Trees
• Probabilistic Networks
• Neural Networks
• Support Vector Machines
• Nearest Neighbor
4.What is a model selection in Machine Learning?
Ans: The process of choosing models among diverse mathematical models, which
are used to define the same data is known as Model Selection. Model learning is
applied to the fields of statistics, data mining, and machine learning.
5.What are the functions of Unsupervised Learning?
Ans:
• Finding clusters of the data
• Finding low-dimensional representations of the data
• Finding interesting directions in data
• Finding novel observations/ database cleaning
• Finding interesting coordinates and correlations
6.What is SVM in machine learning? What are the classification methods that
SVM can handle?
Ans: SVM stands for Support Vector Machine. SVM are supervised learning
models with an associated learning algorithm which analyze the data used for
classification and regression analysis.
The classification methods that SVM can handle are:
• Combining binary classifiers
• Modifying binary to incorporate multiclass learning
7. What are Parametric and Non-Parametric Models?
Ans: Parametric models will have limited parameters and to predict new data, you
only need to know the parameter of the model.
Non-Parametric models have no limits in taking a number of parameters, allowing
for more flexibility and to predict new data. You need to know the state of the
data and model parameters.
8.What are the Types of supervised Machine learning Algorithms?
Ans:
1. Regression
Regression algorithms are used if there is a relationship between the input
variable and the output variable. It is used for the prediction of continuous
variables, such as Weather forecasting, Market Trends, etc. Below are some
popular Regression algorithms which come under supervised learning:
• Linear Regression
• Regression Trees
• Non-Linear Regression
• Bayesian Linear Regression
• Polynomial Regression
2. Classification
Classification algorithms are used when the output variable is categorical, which
means there are two classes such as Yes-No, Male-Female, True-false, etc.
• Spam Filtering,
• Random Forest
• Decision Trees
• Logistic Regression
• Support vector Machines
9. Write down the Advantages of Supervised learning:
Ans: With the help of supervised learning, the model can predict the output on
the basis of prior experiences.
In supervised learning, we can have an exact idea about the classes of objects.
Supervised learning model helps us to solve various real-world problems such as
fraud detection, spam filtering, etc.
10.Explain the Image Recognition as a Application of ML.
Ans: Image recognition is one of the most common applications of machine
learning. It is used to identify objects, persons, places, digital images, etc. The
popular use case of image recognition and face detection is, Automatic friend
tagging suggestion.
Facebook provides us a feature of auto friend tagging suggestion. Whenever we
upload a photo with our Facebook friends, then we automatically get a tagging
suggestion with name, and the technology behind this is machine learning's face
detection and recognition algorithm.

You might also like