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

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
of a similar data type. elements of the same type,
which are connected using
pointers.

• Elements are stored consecutively • New elements can be stored


in the memory. anywhere in memory.

• An Array supports Random Access. • Linked List supports


It means that the elements can be
Sequential Access. It means that
accessed directly using their index
we have to traverse the complete
value, like arr[0] for 1st element,
linked list, up to that element
arr[5] for 6th element, etc. As a
sequentially which element/node
result, accessing elements in an
we want to access in a linked list.
array is fast with constant time
To access the nth element of a
complexity of O(1).
linked list, the time complexity is
O(n).

• Memory is allocated at compile • Memory is allocated at runtime,


time as soon as the array is whenever a new node is added. It
declared. It is known as Static is known as Dynamic Memory
Memory Allocation. Allocation.
• Insertion and Deletion operation • In case of a linked list, a new
takes more time in the array, as
element is stored at the first free
the memory locations are
consecutive and fixed. available memory location.

Thus, Insertion and Deletion


operations are fast in the linked
list.

• Size of the array must be declared • Size of a Linked list is variable. It


at the time of array declaration. grows at runtime whenever 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
subnodes 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