Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.

Unit 14 MCQs Machine Learning Packages in Python

ECAP792 60 questions. Pick an option to check it.

Read the notes Subjective questions

0 of 60 answered 0 right 0 wrong , 60 left

  1. Question 1 of 60 Data import Easy

    Which pandas function is commonly used to import data from a CSV file?

  2. Question 2 of 60 Data import Easy

    Which Python statement imports pandas using its conventional alias?

  3. Question 3 of 60 Data import Easy

    Which pandas function is designed to import a Microsoft Excel file?

  4. Question 4 of 60 Data import Easy

    What type of pandas object is usually returned by pd.read_csv()?

  5. Question 5 of 60 Visualization with Matplotlib Easy

    Which module is conventionally imported as plt for creating Matplotlib plots?

  6. Question 6 of 60 Visualization with Matplotlib Easy

    Which function displays a completed Matplotlib figure?

  7. Question 7 of 60 Visualization with Matplotlib Easy

    Which function adds a title to a Matplotlib plot?

  8. Question 8 of 60 Visualization with Matplotlib Easy

    Which function labels the horizontal axis in Matplotlib?

  9. Question 9 of 60 Simple line and scatter plots Easy

    Which Matplotlib function creates a simple line plot?

  10. Question 10 of 60 Simple line and scatter plots Easy

    Which Matplotlib function creates a scatter plot?

  11. Question 11 of 60 Simple line and scatter plots Easy

    A line plot is especially useful for showing which kind of information?

  12. Question 12 of 60 Simple line and scatter plots Easy

    What does each marker in a basic scatter plot usually represent?

  13. Question 13 of 60 Seaborn Easy

    What is the conventional alias used when importing Seaborn?

  14. Question 14 of 60 Seaborn Easy

    Seaborn is primarily used for which task?

  15. Question 15 of 60 Seaborn Easy

    Seaborn is built on top of which plotting library?

  16. Question 16 of 60 Heatmap Easy

    Which Seaborn function is used to create a heatmap?

  17. Question 17 of 60 Heatmap Easy

    How are numerical values mainly represented in a heatmap?

  18. Question 18 of 60 Heatmap Easy

    What does annot=True commonly do in sns.heatmap()?

  19. Question 19 of 60 Introducing Scikit-learn package Easy

    What is Scikit-learn mainly used for?

  20. Question 20 of 60 Introducing Scikit-learn package Easy

    Which Scikit-learn function commonly divides data into training and testing sets?

  21. Question 21 of 60 Data import Medium

    A CSV file contains 30 columns, but an analysis requires only age, income, and target. Which approach imports only these columns with pandas?

  22. Question 22 of 60 Data import Medium

    A column named order_date contains values such as 2026-08-15. Which command converts it to a datetime type while importing the CSV?

  23. Question 23 of 60 Data import Medium

    A dataset uses both NA and -999 to represent missing values. Which import option correctly recognizes both markers?

  24. Question 24 of 60 Visualization with Matplotlib Medium

    You need two plots arranged side by side and want to modify each plot independently. Which statement creates the appropriate objects?

  25. Question 25 of 60 Visualization with Matplotlib Medium

    A saved Matplotlib image cuts off part of its axis labels. Which command is most appropriate for saving it without clipping the labels?

  26. Question 26 of 60 Visualization with Matplotlib Medium

    Given fig, ax = plt.subplots(), which code correctly adds a title and labels to that specific axes object?

  27. Question 27 of 60 Simple line and scatter plots Medium

    A table contains measurements recorded at irregular times and stored in random row order. What should be done before drawing a line plot that represents temporal progression?

  28. Question 28 of 60 Simple line and scatter plots Medium

    In plt.scatter(x, y, c=score, cmap="viridis"), what does the score array control?

  29. Question 29 of 60 Simple line and scatter plots Medium

    Two lines are plotted with label="Actual" and label="Predicted", but their labels do not appear on the chart. Which additional call is required?

  30. Question 30 of 60 Seaborn Medium

    A DataFrame contains height, weight, and a categorical column species. Which call creates a scatter plot whose point colors distinguish species?

  31. Question 31 of 60 Seaborn Medium

    A Seaborn line plot has repeated observations for each x-value. What does sns.lineplot display by default at each x-value?

  32. Question 32 of 60 Seaborn Medium

    You want all subsequent Seaborn plots to use a white-grid background and a colorblind-friendly palette. Which command applies both settings globally?

  33. Question 33 of 60 Heatmap Medium

    You have computed corr = df.corr(numeric_only=True) and want to hide its upper triangle, including the diagonal. Which call applies a suitable mask?

  34. Question 34 of 60 Heatmap Medium

    Which heatmap arguments display cell values rounded to two decimal places?

  35. Question 35 of 60 Heatmap Medium

    A correlation matrix contains values from to . Which configuration best gives zero a visually neutral midpoint?

  36. Question 36 of 60 Introducing Scikit-learn package Medium

    A classification dataset has only 10% positive examples. Which split best preserves this class proportion in both subsets?

  37. Question 37 of 60 Introducing Scikit-learn package Medium

    Why should StandardScaler be fitted only on training data rather than on the complete dataset?

  38. Question 38 of 60 Introducing Scikit-learn package Medium

    A categorical feature may contain unseen categories after deployment. Which encoder configuration avoids an error when transforming them?

  39. Question 39 of 60 Introducing Scikit-learn package Medium

    A classifier achieves 95% accuracy, but the positive class is rare. Which metric is most useful when both missed positives and false alarms matter?

  40. Question 40 of 60 Introducing Scikit-learn package Medium

    What is the main advantage of placing StandardScaler and a classifier in a Scikit-learn Pipeline?

  41. Question 41 of 60 Data import Hard

    A CSV column contains the literal codes NA, ?, and valid strings. Which call preserves NA as text while treating only ? as missing?

  42. Question 42 of 60 Data import Hard

    What happens when pd.read_csv receives both dtype={"id": "Int64"} and a converters function for the id column?

  43. Question 43 of 60 Data import Hard

    A large CSV is read with chunksize=10000. Early chunks contain only integers in column x, while later chunks include missing values. Which approach best guarantees a consistent nullable-integer schema after concatenation?

  44. Question 44 of 60 Visualization with Matplotlib Hard

    After creating several figures, code must add a line specifically to an earlier axes object ax1, regardless of pyplot's current figure. Which call is reliable?

  45. Question 45 of 60 Visualization with Matplotlib Hard

    Two subplots are created with fig, (ax1, ax2) = plt.subplots(2, 1, sharex=True). What is the expected effect of ax1.set_xlim(0, 10)?

  46. Question 46 of 60 Visualization with Matplotlib Hard

    Two scatter plots use the same colormap, but their numeric ranges differ. Which design makes a given numeric value map to the same color in both plots?

  47. Question 47 of 60 Simple line and scatter plots Hard

    Given x = [3, 1, 2] and y = [30, 10, 20], what does ax.plot(x, y) do by default?

  48. Question 48 of 60 Simple line and scatter plots Hard

    A plotted y-array is [1.0, 2.0, np.nan, 4.0]. How does a standard Matplotlib line normally represent the NaN?

  49. Question 49 of 60 Simple line and scatter plots Hard

    In ax.scatter(x, y, s=36), what does the value 36 represent?

  50. Question 50 of 60 Simple line and scatter plots Hard

    For exactly three points, why can ax.scatter(x, y, c=(1, 0, 0)) fail to express the intended uniform red color?

  51. Question 51 of 60 Seaborn Hard

    A DataFrame has multiple score observations for each time. With no additional arguments, what does sns.lineplot(data=df, x="time", y="score") generally display?

  52. Question 52 of 60 Seaborn Hard

    Why is passing an existing Matplotlib axes through ax=ax generally inappropriate for sns.displot(...)?

  53. Question 53 of 60 Seaborn Hard

    Separate filtered plots contain different subsets of category levels. Which approach most reliably keeps each hue category mapped to the same color across all plots?

  54. Question 54 of 60 Heatmap Hard

    A labeled DataFrame is plotted with sns.heatmap(data, annot=annotations), where annotations is a same-shaped NumPy array. How are annotation entries matched to cells?

  55. Question 55 of 60 Heatmap Hard

    When vmin and vmax are omitted, what is the main effect of robust=True in sns.heatmap?

  56. Question 56 of 60 Heatmap Hard

    A correlation heatmap is computed from columns with different missing-value patterns using pairwise-complete observations. Which subtle issue can arise?

  57. Question 57 of 60 Introducing Scikit-learn package Hard

    A model uses imputation, standardization, and classification with cross-validation. Which structure best prevents validation-fold information from influencing preprocessing?

  58. Question 58 of 60 Introducing Scikit-learn package Hard

    A ColumnTransformer combines sparse and dense transformer outputs with sparse_threshold=0.3. If the combined output density is , what output is expected?

  59. Question 59 of 60 Introducing Scikit-learn package Hard

    Why does StandardScaler(with_mean=True) normally reject a SciPy sparse feature matrix?

  60. Question 60 of 60 Introducing Scikit-learn package Hard

    A medical dataset has several rows per patient. Which cross-validation strategy prevents records from the same patient appearing in both training and validation sets?

That's unit 14

Answer a few questions and your score shows up here.