Quiz Space

Machine Learning Practice · Quiz 2 · 24 Mar 2024 · January 2024 term

Question 19: Consider the following code snippet: If the shape of X i…

Question 19

+2 marksNumerical answer

Consider the following code snippet:

python
from sklearn.datasets import load_iris
from sklearn.decomposition import PCA
from sklearn.preprocessing import PolynomialFeatures
from sklearn.pipeline import FeatureUnion
X = load_iris().data # X.shape = (150,4)
poly_feature = PolynomialFeatures(degree=2, include_bias=True)
union = FeatureUnion([('poly', poly_feature),
('pca', PCA(n_components=2))])
X_transformed = union.fit_transform(X)
print(X_transformed.shape)

If the shape of X is (150,4)(150, 4). How many total columns are there in the X_transformed ?

Show answer

Correct answer: 17

Question 19 of 22 in the IIT Madras BS Machine Learning Practice (MLP) Quiz 2 paper sat on 24 Mar 2024, in the January 2024 term (IIT M DIPLOMA AN EXAM QDD2 24 Mar 2024). It carries 2 marks.

More questions from this paper

  1. Q1Consider following code snippet: What will be the output of the above code snippet in the correct sequence?
  2. Q2Figure question
  3. Q3Consider a binary classification dataset with labeled as 98% negative samples and 2% positive samples. A model is train…
  4. Q4Consider the following code block: What are the most suitable values to be filled in the two blank spaces (in that orde…
  5. Q5Figure question
  6. Q6You’re building a machine learning pipeline to preprocess data and train a model on a classification task. You decide t…
  7. Q7Given below code to load a huge file name as filename.csv and this file is not loading at once in the system which para…
  8. Q8What will the output for below code
  9. Q9Imagine you're training a Perceptron using sklearn with the following code: Given the linearly separable nature of the …
  10. Q10Consider the following code snippet using scikit-learn: Assuming that X_train and y_train are given and the features ar…
  11. Q11Consider the following code snippet that employs LogisticRegression from sklearn on a feature matrix X and correspondin…
  12. Q12Which of the following is true for a hard margin SVM algorithm ?
  13. Q13Which of the following is/are correct regarding RadiusNeighborsClassifier
  14. Q14Which of the following is correct?
  15. Q15Which of the following option(s) are correct for the precision-recall curve
  16. Q16Which of the following statements are true?
  17. Q17Figure question
  18. Q18Figure question
  19. Q20Please consider the following data and code for a regression problem with symbols in mind: >>>: Represents input code #…
  20. Q21After training a multi-class classifier, you obtain the following confusion matrix. What will be the weighted average o…
  21. Q22What is the output of the following code?