0% found this document useful (0 votes)
158 views4 pages

PCA Assignment Quiz

The PCA Assignment Quiz consists of various questions related to Principal Component Analysis (PCA), including its purpose, calculations of eigenvalues, and performance comparisons of linear regression models. The quiz assesses knowledge on PCA's application in data science, dimensionality reduction, and the importance of cumulative explained variance. The participant scored 23 out of 26 marks, indicating a strong understanding of PCA concepts and applications.

Uploaded by

narakatlas1987
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
158 views4 pages

PCA Assignment Quiz

The PCA Assignment Quiz consists of various questions related to Principal Component Analysis (PCA), including its purpose, calculations of eigenvalues, and performance comparisons of linear regression models. The quiz assesses knowledge on PCA's application in data science, dimensionality reduction, and the importance of cumulative explained variance. The participant scored 23 out of 26 marks, indicating a strong understanding of PCA concepts and applications.

Uploaded by

narakatlas1987
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

PCA Assignment Quiz

Scored / Total marks: 23 / 26


PCA is ________?

Marked Answer :
Unsupervised
Total Marks :1MARKS OBTAINED1
Why is PCA needed in the Data Science field?

Marked Answer :
In Dimensionality Reduction
Total Marks :1MARKS OBTAINED1
Extract only features and scale the data using StandardScaler() , compute min
covariance?

Marked Answer :
-0.57
Total Marks :1MARKS OBTAINED1
Extract only features and scale the data using StandardScaler() , how many
eigen_values will be calculated?

Marked Answer :
64
Total Marks :1MARKS OBTAINED1
from the above eigenvalues and eigenvectors, create eigenpair and calculate maximum
cumulative explained variance?

Marked Answer :
100
Total Marks :1MARKS OBTAINED1
Why is cumulative explained variance required before applying PCA?

Marked Answer :
To check the maximum components to be selected
Total Marks :1MARKS OBTAINED1
from the below plot, select the range of components can be selected?

Image

Marked Answer :
10-20
Total Marks :1MARKS OBTAINED1
Fit the data to PCA and compute the maximum explained_variance_ratio?

Marked Answer :
0.12
Total Marks :1MARKS OBTAINED1
Which of the following is the correct syntax for finding the eigenvalues and
eigenvectors with give covariance matric (cov_mat)?
Marked Answer :
eig_vals, eig_vecs =[Link](cov_mat)
Total Marks :1MARKS OBTAINED1
Choose the correct order of steps to choose principal components:

A . compute the covariance matrix.

B. choose the principal components from Eigen values and Vectors.

C. collecting the data.


D. compute Eigen values and vectors.

E. standardization.

Marked Answer :
C->E->A->D->B
Total Marks :1MARKS OBTAINED1
What correction is required in the following lines of code to create covariance
matrix?
scaler = StandardScaler()
standardized_data = scaler.fit_transform(data)
covariance_matrix = [Link](standardized_data)
Marked Answer :
Need to perform transpose of standardized_data
Total Marks :1MARKS OBTAINED1
What exactly do you understand by the given code?
pca = PCA(n_components=0.95)
Marked Answer :
We are looking for the principal components that cumulatively explain 95% of the
variance in the data.
Total Marks :1MARKS OBTAINED1
How is the first principal component determined in PCA?
Marked Answer :
It is the component with the most variance.
Total Marks :1MARKS OBTAINED1
Which of the following non-zero vector stays parallel after matrix multiplication

Marked Answer :
EigenVector
Total Marks :1MARKS OBTAINED1
The Output of PCA is always a new representation of data with a lower dimension
than the original data representation.

Marked Answer :
TRUE
Total Marks :1MARKS OBTAINED1
What is the difference between PCA and Linear Regression?

Marked Answer :
Euclidean distance calculated in PCA, Vertical distance calculated in Linear
Regression.
Total Marks :1MARKS OBTAINED1
How to Determine the number of principal components to retain in PCA?

Marked Answer :
Cumulative variance plot
Total Marks :1MARKS OBTAINED1
What is the minimum and maximum limit of n_components value we can give in PCA?

Marked Answer :
Minimum 2, Maximum 100% of independent columns count
Total Marks :1MARKS OBTAINED1
Use the [Link] dataset and Apply PCA in the given dataset, what is the minimum
n_components required to attain 0.99% of variance?

Marked Answer :
4
Total Marks :1MARKS OBTAINED1
Apply PCA in the given dataset([Link]) with n_components as 2, Then get the
original (approx.) data back from PCA, what is the difference in sum of variance of
all columns before and after applying PCA?

Marked Answer :
83.74
Total Marks :1MARKS OBTAINED0
Is it appropriate to use PCA as a method for preventing overfitting in machine
learning models?

Marked Answer :
FALSE
Total Marks :1MARKS OBTAINED1
What is the sum of eigenvalues calculated for the first 8 records([Link]) with the
independent features?

Marked Answer :
101.76
Total Marks :1MARKS OBTAINED1
Compare the performance of two Linear Regression models([Link]):

The first model uses the raw data without any preprocessing.
The second model applies PCA with n_components set to 4 before fitting the data.
Both models should be generated using train_test_split with test_size=0.2 and
random_state=24 during the train-test split.
Your task is to calculate the Root Mean Squared Error (RMSE) for both models and
determine whether the performance of the second model (PCA-based) is better
compared to the first model (raw data).

Marked Answer :
Model 2 performance is not better than Model 1
Total Marks :1MARKS OBTAINED1
Compute min correlation in the given dataset?

Marked Answer :
-0.1841
Total Marks :1MARKS OBTAINED0
Compare the performance of two Linear Regression models([Link]):

The first model uses the raw data without any preprocessing.
The second model applies standardscaler only to independent features and then apply
PCA with n_components set to 4 before fitting the data.
Both models should be generated using train_test_split with test_size=0.2 and
random_state=24 during the train-test split.
Your task is to calculate the Root Mean Squared Error (RMSE) for both models and
determine whether the performance of the second model (StandardScalar & PCA-based)
is better compared to the first model (raw data).

Marked Answer :
Model 2 performance is better than Model 1
Total Marks :1MARKS OBTAINED0
While Selecting Principal Components, the eigenvalues are arranged in descending
order, indicating the amount of variance explained by each component([Link])?

Marked Answer :
TRUE
Total Marks :1MARKS OBTAINED1
Back
PCA Assignment Quiz

18% of course completed

Support

Notes
Self-Paced
Live Classes
Study Materials
Quiz is Submitted

Check Results
Download Attachment

You might also like