[go: up one dir, main page]

0% found this document useful (0 votes)
196 views8 pages

PCA Quiz

The document consists of a series of questions and answers related to Principal Component Analysis (PCA) in data science, covering topics such as dimensionality reduction, eigenvalues, and the application of PCA on datasets. It includes marked answers, correct answers, and the total marks obtained for each question. The document highlights the importance of PCA and its implementation in machine learning models.

Uploaded by

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

PCA Quiz

The document consists of a series of questions and answers related to Principal Component Analysis (PCA) in data science, covering topics such as dimensionality reduction, eigenvalues, and the application of PCA on datasets. It includes marked answers, correct answers, and the total marks obtained for each question. The document highlights the importance of PCA and its implementation in machine learning models.

Uploaded by

parasharaarush
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

 PCA is ________?

Marked Answer :

Unsupervised

Correct Answer :

Unsupervised

Total Marks :1MARKS OBTAINED1

 Why is PCA needed in the Data Science field?

Marked Answer :

In Dimensionality Reduction

Correct Answer :

In Dimensionality Reduction

Total Marks :1MARKS OBTAINED1

 Extract only features and scale the data using StandardScaler() , compute min covariance?

Marked Answer :

-0.57

Correct 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

Correct Answer :

64

Total Marks :1MARKS OBTAINED1

 from the above eigenvalues and eigenvectors, create eigenpair and calculate maximum
cumulative explained variance?

Marked Answer :
100

Correct 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

Correct 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?

Marked Answer :

30-40

Correct Answer :

10-20

Total Marks :1MARKS OBTAINED0

 Fit the data to PCA and compute the maximum explained_variance_ratio?


Marked Answer :

0.12

Correct 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 =np.linalg.eig(cov_mat)

Correct Answer :

eig_vals, eig_vecs =np.linalg.eig(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

Correct 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 = np.cov(standardized_data)

Marked Answer :
Need to perform transpose of standardized_data

Correct 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.

Correct 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.

Correct 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

Correct 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

Correct 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.

Correct 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

Correct 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

Correct Answer :

Minimum 2, Maximum 100% of independent columns count

Total Marks :1MARKS OBTAINED1

 Use the Gym.csv dataset and Apply PCA in the given dataset, what is the minimum
n_components required to attain 0.99% of variance?

Marked Answer :

Correct Answer :
4

Total Marks :1MARKS OBTAINED0

 Apply PCA in the given dataset(gym.csv) 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 :

5.85

Correct Answer :

16.26

Total Marks :1MARKS OBTAINED0

 Is it appropriate to use PCA as a method for preventing overfitting in machine learning


models?

Marked Answer :

FALSE

Correct Answer :

FALSE

Total Marks :1MARKS OBTAINED1

 What is the sum of eigenvalues calculated for the first 8 records(gym.csv) with the
independent features?

Marked Answer :

98.32

Correct Answer :

101.76

Total Marks :1MARKS OBTAINED0

 Compare the performance of two Linear Regression models(gym.csv):

1. The first model uses the raw data without any preprocessing.

2. 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 better than Model 1

Correct Answer :

Model 2 performance is not better than Model 1

Total Marks :1MARKS OBTAINED0

 Compute min correlation in the given dataset?

Marked Answer :

-0.0592

Correct Answer :

-0.0592

Total Marks :1MARKS OBTAINED1

 Compare the performance of two Linear Regression models(gym.csv):

1. The first model uses the raw data without any preprocessing.

2. 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 not better than Model 1

Correct Answer :

No change in performance

Total Marks :1MARKS OBTAINED0

 While Selecting Principal Components, the eigenvalues are arranged in descending order,
indicating the amount of variance explained by each component(gym.csv)?

Marked Answer :

TRUE

Correct Answer :
TRUE

You might also like