MauryaHub PYQ Practice

da4001_2026T1_Q2_NA.pdf

Data Science and AI Lab · Quiz 2 · Jan 2026

← Course papers · Start practice / exam

Questions and published explanations below are available without starting a test. Some questions may not have a published solution yet.

Question 2 MCQ · 2.0 marks

You have two DataFrames: [[IMAGE:1ddd5c11cc750578_2_2]] and [[IMAGE:1ddd5c11cc750578_2_3]] . You want to combine them so that the resulting DataFrame contains only the employees who belong to a department that exists in [[IMAGE:1ddd5c11cc750578_2_4]] table. Which of the arguments for the [[IMAGE:1ddd5c11cc750578_2_5]] parameter provided in the options should you use in [[IMAGE:1ddd5c11cc750578_2_6]] to achieve this? [[IMAGE:1ddd5c11cc750578_2_7]]
Source diagram or notationSource diagram or notationSource diagram or notationSource diagram or notationSource diagram or notationSource diagram or notation
  1. how='outer'
  2. how='left'
  3. how='inner'
  4. how='cross'

A published solution is not available for this question yet.

Question 3 MCQ · 2.0 marks

You have a 'long' DataFrame df containing weather data for different cities: [[IMAGE:1ddd5c11cc750578_3_8]] You want to reshape this so that each City has its own column, with Date as the index. Which command will produce this wide-format table?
Source diagram or notation
  1. df.columns.tolist()
  2. df.pivot(index='Date', columns='City', values='Temp')
  3. df.groupby(['Date', 'City']).sum()
  4. df.transpose()

A published solution is not available for this question yet.

Question 4 MCQ · 2.0 marks

What is the output of the following snippet of code? [[IMAGE:1ddd5c11cc750578_3_9]]
Source diagram or notation
  1. [[IMAGE:1ddd5c11cc750578_3_10]]
    Source diagram or notation
  2. [[IMAGE:1ddd5c11cc750578_4_11]]
    Source diagram or notation
  3. [[IMAGE:1ddd5c11cc750578_4_12]]
    Source diagram or notation
  4. [[IMAGE:1ddd5c11cc750578_4_13]]
    Source diagram or notation

A published solution is not available for this question yet.

Question 5 MCQ · 2.0 marks

A student is writing a training loop for a neural network. Consider the following code snippet, where three critical lines are missing: [[IMAGE:1ddd5c11cc750578_4_14]] Which of the following option correctly identifies the missing lines in the order they should appear to ensure the model trains correctly?
Source diagram or notation
  1. A: [[IMAGE:1ddd5c11cc750578_4_15]] ; B: [[IMAGE:1ddd5c11cc750578_4_16]] ; C: [[IMAGE:1ddd5c11cc750578_4_17]]
    Source diagram or notationSource diagram or notationSource diagram or notation
  2. A: [[IMAGE:1ddd5c11cc750578_4_18]] ; B: [[IMAGE:1ddd5c11cc750578_4_19]] ; C: [[IMAGE:1ddd5c11cc750578_4_20]]
    Source diagram or notationSource diagram or notationSource diagram or notation
  3. A: [[IMAGE:1ddd5c11cc750578_4_21]] ; B: [[IMAGE:1ddd5c11cc750578_4_22]] ; C: [[IMAGE:1ddd5c11cc750578_4_23]]
    Source diagram or notationSource diagram or notationSource diagram or notation
  4. A: [[IMAGE:1ddd5c11cc750578_4_24]] ; B: [[IMAGE:1ddd5c11cc750578_4_25]] ; C: [[IMAGE:1ddd5c11cc750578_4_26]]
    Source diagram or notationSource diagram or notationSource diagram or notation

A published solution is not available for this question yet.

Question 6 MCQ · 2.0 marks

[[IMAGE:1ddd5c11cc750578_5_27]]
Source diagram or notation
  1. 1 - C; 2 - D; 3 - A; 4 - B
  2. 1 - C; 2 - B; 3 - A; 4 - D
  3. 1 - C; 2 - B; 3 - D; 4 - A
  4. 1 - C; 2 - D; 3 - B; 4 - A

A published solution is not available for this question yet.

Question 7 MCQ · 2.0 marks

Which of the following best describes the logic of Non-Maximum Suppression algorithm used in the YOLO (You Only Look Once) model?
  1. It calculates the average coordinates of all overlapping boxes to produce a single refined box while suppressing the original set of boxes
  2. It selects the box with the highest confidence score and suppresses remaining boxes that have high overlap with the selected box
  3. It maximises the confidence score of boxes that are distant from each other while suppressing the score of overlapping boxes
  4. It implements a recursive search to merge overlapping boxes into a single box by taking the higher coordinate values at each step

A published solution is not available for this question yet.

Question 8 MCQ · 2.0 marks

[[IMAGE:1ddd5c11cc750578_6_28]]
Source diagram or notation
  1. LoRA will be applied to the entire model, including the embedding layers.
  2. LoRA will only be applied to the final classification layer of the model.
  3. LoRA will not be applied to any layer of the model.
  4. The model will throw an error because an empty list is invalid.

A published solution is not available for this question yet.

Question 9 MCQ · 2.0 marks

Consider the following code: [[IMAGE:1ddd5c11cc750578_6_29]] Which of the following statements is TRUE regarding the output generated by the tokenizer?
Source diagram or notation
  1. Each sentence will be tokenized independently without any padding because max_length is specified.
  2. All tokenized sequences in output["input_ids"] will have a length exactly equal to 6.
  3. The tokenizer will return a list of Python integer.
  4. Special tokens like [CLS] and [SEP] will not be added because padding is enabled.

A published solution is not available for this question yet.

Question 10 MCQ · 2.0 marks

Consider the following code and answer the following question. [[IMAGE:1ddd5c11cc750578_7_30]] which of the below option correctly describes the behavior of model with [[IMAGE:1ddd5c11cc750578_7_31]]
Source diagram or notationSource diagram or notation
  1. [[IMAGE:1ddd5c11cc750578_7_32]] merges all inputs into one combined prompt and returns a single response string.
    Source diagram or notation
  2. The model processes all inputs in a single batch request and returns a list of response objects in the same order as inputs.
  3. [[IMAGE:1ddd5c11cc750578_7_33]] returns a dictionary mapping each input to its response, requiring key-based access.
    Source diagram or notation
  4. [[IMAGE:1ddd5c11cc750578_7_34]] runs each input sequentially exactly like a for-loop using [[IMAGE:1ddd5c11cc750578_7_35]] and returns plain strings instead of response objects.
    Source diagram or notationSource diagram or notation

A published solution is not available for this question yet.

Question 11 MCQ · 2.0 marks

Which of the following code snippets will run successfully given that you have all the required installation, no billing issue, API KEYS are configured correctly, access of all mentioned models is present?
  1. [[IMAGE:1ddd5c11cc750578_8_36]]
    Source diagram or notation
  2. [[IMAGE:1ddd5c11cc750578_8_37]]
    Source diagram or notation
  3. [[IMAGE:1ddd5c11cc750578_8_38]]
    Source diagram or notation
  4. None of these

A published solution is not available for this question yet.

Question 12 MCQ · 2.0 marks

A legal chatbot must answer strictly based on internal case documents and should minimize hallucination. Which of the following approaches is MOST suitable?
  1. Fine-tuning
  2. RAG
  3. Temperature = 0
  4. Temperature = 1
  5. Top-p = 1
  6. Top-k = 1

A published solution is not available for this question yet.

Question 13 MCQ · 2.0 marks

Which analogy best describes RAG vs Fine-Tuning?
  1. RAG = memorizing textbook, Fine-tuning = Googling
  2. RAG = Googling before answering, Fine-tuning = learning permanently
  3. RAG = increasing IQ, Fine-tuning = reading newspaper

A published solution is not available for this question yet.

Question 14 MCQ · 2.0 marks

A developer wants only the top 2 most relevant chunks retrieved. Which of the following correctly achieves this?
  1. [[IMAGE:1ddd5c11cc750578_9_39]]
    Source diagram or notation
  2. [[IMAGE:1ddd5c11cc750578_9_40]]
    Source diagram or notation
  3. [[IMAGE:1ddd5c11cc750578_9_41]]
    Source diagram or notation
  4. None of these

A published solution is not available for this question yet.

Question 15 MCQ · 2.0 marks

You accidentally wrote: [[IMAGE:1ddd5c11cc750578_9_42]] But your state schema expects: [[IMAGE:1ddd5c11cc750578_9_43]] What is the most likely result?
Source diagram or notationSource diagram or notation
  1. LLM auto converts input to messages
  2. Runtime error due to missing state key
  3. Graph ignores output
  4. Messages auto populated

A published solution is not available for this question yet.

Question 16 MSQ · 3.0 marks

Which of the following statements are true regarding regularization?
  1. Regularization can be used when a model overfits, and it typically helps by reducing model complexity
  2. Ridge regularization can be used to perform feature selection as it forces some weights exactly to zero
  3. Regularization adds constraints to the model and can lead to an increase in bias while reducing the variance
  4. Regularization can be used to increase sensitivity of the model to small changes in the input data

A published solution is not available for this question yet.

Question 17 MSQ · 3.0 marks

A student is building a linear regression model. Which of the following code snippets correctly prevents PyTorch from tracking gradients during the evaluation phase? Select all that apply.
  1. Wrapping the code in a with torch.no_grad(): context manager.
  2. Setting requires_grad=False on the model parameters manually.
  3. Calling optimizer.zero_grad() before the forward pass.
  4. Calling model.eval() before passing the validation data through the model.

A published solution is not available for this question yet.

Question 18 MSQ · 3.0 marks

When implementing a custom dataset by inheriting from 'torch.utils.data.Dataset', which of the following methods must be overridden to ensure compatibility with a 'DataLoader'?
  1. getitem
  2. iter
  3. len
  4. init

A published solution is not available for this question yet.

Question 19 MSQ · 3.0 marks

An image "sample.jpg" with the shape [[IMAGE:1ddd5c11cc750578_11_44]] is processed using the following code: [[IMAGE:1ddd5c11cc750578_11_45]] Which of the following statements regarding the transformation are False?
Source diagram or notationSource diagram or notation
  1. The operation fails because the target width and height do not match the original dimensions
  2. The operation fails because the number of channels is not specified while resizing
  3. The output from [[IMAGE:1ddd5c11cc750578_11_46]] will be [[IMAGE:1ddd5c11cc750578_11_47]]
    Source diagram or notationSource diagram or notation
  4. The new aspect ratio of the resized image is 1:1

A published solution is not available for this question yet.

Question 20 MSQ · 3.0 marks

[[IMAGE:1ddd5c11cc750578_11_48]]
Source diagram or notation
  1. The sample dataset contains 50 samples.
  2. The range(0, 500, 10) function selects rows in steps of 10.
  3. The original dataset is modified after the .select() operation.
  4. The sample object is of type Dataset.

A published solution is not available for this question yet.

Question 21 NAT · 3.0 marks

Consider the following code snippet for a multi-class classification problem with three classes: 0, 1, and 2. The ground-truth labels are stored in [[IMAGE:1ddd5c11cc750578_12_49]] , and the predicted labels are stored in [[IMAGE:1ddd5c11cc750578_12_50]] . [[IMAGE:1ddd5c11cc750578_12_51]] **What is the recall score for class 1? (Round off to two decimal places)**
Source diagram or notationSource diagram or notationSource diagram or notation

    A published solution is not available for this question yet.

    Question 22 MSQ · 2.0 marks

    Consider the following code snippet and select the true statements from the options provided. [[IMAGE:1ddd5c11cc750578_13_52]]
    Source diagram or notation
    1. The [[IMAGE:1ddd5c11cc750578_13_53]] identified by GridSearchCV offers the best performance on the [[IMAGE:1ddd5c11cc750578_13_54]] from the given choices in [[IMAGE:1ddd5c11cc750578_13_55]]
      Source diagram or notationSource diagram or notationSource diagram or notation
    2. Changing the scoring metric to [[IMAGE:1ddd5c11cc750578_13_56]] can lead to a different set of hyperparameters returned by [[IMAGE:1ddd5c11cc750578_13_57]]
      Source diagram or notationSource diagram or notation
    3. Based on the configuration provided for GridSearchCV, 48 decision tree models are trained in total
    4. Based on the configuration provided for GridSearchCV, a total of 48 different hyperparameter combinations are evaluated

    A published solution is not available for this question yet.

    Question 23 MCQ · 3.0 marks

    Which of the following code snippets will produce the same output every time they are run? (Assume the model and its infrastructure remain unchanged.)
    1. [[IMAGE:1ddd5c11cc750578_14_58]]
      Source diagram or notation
    2. [[IMAGE:1ddd5c11cc750578_14_59]]
      Source diagram or notation
    3. Output can not be same if the code is run multiple times.
    4. [[IMAGE:1ddd5c11cc750578_15_60]]
      Source diagram or notation

    A published solution is not available for this question yet.

    Question 24 MCQ · 3.0 marks

    A RAG system answers direct factual questions well, but struggles when the answer requires piecing together information spread across multiple documents. A developer has the following setup: [[IMAGE:1ddd5c11cc750578_15_61]] Which single change would MOST directly improve performance on multi-document synthesis questions?
    Source diagram or notation
    1. Decrease the value of chunk_size. [[IMAGE:1ddd5c11cc750578_15_62]]
      Source diagram or notation
    2. Increase the value of chunk_size. [[IMAGE:1ddd5c11cc750578_15_63]]
      Source diagram or notation
    3. Increase the value of chunk_overlap. [[IMAGE:1ddd5c11cc750578_16_64]]
      Source diagram or notation
    4. Increase the value of k. [[IMAGE:1ddd5c11cc750578_16_65]]
      Source diagram or notation

    A published solution is not available for this question yet.

    Question 25 MCQ · 3.0 marks

    You are building a simple LangGraph agent that: 1. Starts at the agent node 2. If the LLM response contains a tool call, go to tool 3. Otherwise, end the workflow Fill in the missing line. [[IMAGE:1ddd5c11cc750578_16_66]] Which line correctly adds conditional routing?
    Source diagram or notation
    1. [[IMAGE:1ddd5c11cc750578_17_67]]
      Source diagram or notation
    2. [[IMAGE:1ddd5c11cc750578_17_68]]
      Source diagram or notation
    3. [[IMAGE:1ddd5c11cc750578_17_69]]
      Source diagram or notation
    4. [[IMAGE:1ddd5c11cc750578_17_70]]
      Source diagram or notation

    A published solution is not available for this question yet.

    Question 26 MCQ · 3.0 marks

    You are building a ReAct style agent using LangGraph. [[IMAGE:1ddd5c11cc750578_17_71]] What happens on [[IMAGE:1ddd5c11cc750578_18_72]]
    Source diagram or notationSource diagram or notation
    1. Executes the [[IMAGE:1ddd5c11cc750578_18_73]] node and returns the updated state.
      Source diagram or notation
    2. Executes the [[IMAGE:1ddd5c11cc750578_18_74]] node directly.
      Source diagram or notation
    3. Raises a runtime error due to missing entry point
    4. Returns an empty state without executing any node

    A published solution is not available for this question yet.