0% found this document useful (0 votes)
19 views7 pages

Ai Worksheet 2

Uploaded by

nmswork25
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)
19 views7 pages

Ai Worksheet 2

Uploaded by

nmswork25
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/ 7

AI WORKSHEET 2:-

UNIT 1: PYTHON PROGRAMMING-II

EXERCISES

A. Objective type questions

1. Which of the following is a primary data structure in Pandas?


a) List
b) Tuple
c) Series
d) Matrix

2. What does the fillna(0) function do in Pandas?


a) Removes rows with missing values
b) Fills missing values with zeros
c) Estimates missing values based on averages
d) Converts all data to zero

3. In Linear Regression, which library is typically used for importing and managing data?
a) NumPy
b) Pandas
c) Matplotlib
d) Scikit-learn

4. What is the correct syntax to read a CSV file into a Pandas DataFrame?
a) pd.DataFrame("filename.csv")
b) pd.read_csv("filename.csv")
c) pandas.read_file("filename.csv")
d) pd.file_read("filename.csv")

5. What is the result of the df.shape function?


a) Data type of the DataFrame
b) Number of rows and columns in the DataFrame
c) Memory usage of the DataFrame
d) Column names of the DataFrame

6. Which function can be used to export a DataFrame to a CSV file?


a) export_csv()
b) to_file()
c) to_csv()
d) save_csv()

B. Short Answer Questions

1. What is a DataFrame in Pandas?


2. How do you create a Pandas Series from a dictionary?

3. Name two strategies to handle missing values in a DataFrame.

4. What does the head(n) function do in a DataFrame?

5. What is the role of NumPy in Python programming?

6. Explain the use of the isnull() function in Pandas.

C. Long Answer Questions

1. Describe the steps to import and export data using Pandas.

2. Explain the concept of handling missing values in a DataFrame with examples.

3. What is Linear Regression, and how is it implemented in Python?

4. Compare NumPy arrays and Pandas DataFrames.

5. How can we add new rows and columns to an existing DataFrame? Explain with code
examples.

6. What are the attributes of a DataFrame? Provide examples.

D. Case study

1. A dataset of student marks contains missing values for some subjects. Write Python code to
handle these missing values by replacing them with the mean of the respective columns.

2. Write Python code to load the file into a Pandas DataFrame, calculate the total sales for each
product, and save the results into a new CSV file.

3. In a marketing dataset, analyze the performance of campaigns using Pandas. Describe steps
to group data by campaign type and calculate average sales and engagement metrics.

4. A company has collected data on employee performance. Some values are missing, and
certain columns are irrelevant. Explain how to clean and preprocess this data for analysis
using Pandas.

UNIT 2: Data Science Methodology: An Analytic Approach to Capstone


Project

EXERCISES

A. Objective type questions

1. Which is the hardest stage in the foundational methodology of Data Science?


a. Business Understanding
b. Data collection
c. Modelling
d. Evaluation

2. Business Sponsors defines the problem and project objectives from a ________ perspective.
a. Economic b. Feedback c. Business d. Data Collection
3. Match the following and choose the correct options:
i. Descriptive approach - A. Statistical Analysis
ii. Diagnostic approach - B. Current Status
iii. Predictive approach - C. How to solve it?
iv. Prescriptive approach - D. Probabilities of action
a. (i)—A, (ii)—B, (iii)–C, (iv)—D
b. (i)—B, (ii)—A, (iii)–D, (iv)—C
c. (i)—D, (ii)—B, (iii)–A, (iv)—C
d. (i)—A, (ii)—C, (iii)–B, (iv)—D

4. Arrange the following statements in order


i: Gaps in data will be identified and plans to fill/make substitutions will have to be made
ii: Decisions are made whether the collection requires more data or not
iii: Descriptive statistics and visualization is applied to dataset
iv: Identify the necessary data content, formats and sources
a. i,ii,iii,iv
b. iv,ii,iii,i
c. i,iii,ii,iv
d. ii,i,iii,iv

5. Data Modelling focuses on developing models that are either ___________ or ____________
a. Supervised, Unsupervised
b. Predictive, Descriptive
c. Classification, Regression
d. Train-test split, Cross Validation

6. Statement 1- There is no optimal split percentage


Statement 2- The most common split percentage between training and testing data is 20%-
80%
a. Statement 1 is true Statement 2 is false
b. Statement 2 is true Statement 1 is false
c. Both Statement 1 and 2 are true
d. Both Statement 1 and 2 are false

7. Train-test split function is imported from which Python module?


a. sklearn.model_selection
b. sklearn.ensemble
c. sklearn.metrics
d. sklearn. preprocessing

8. Identify the incorrect statement:


i. cross-validation gives a more reliable measure of your model's quality
ii. cross-validation takes short time to run
iii. cross-validation gets multiple measures of model’s quality
iv. cross-validation is preferred with small data
a. ii and iii
b. iii only
c. ii only
d. ii, iii and iv

9. Identifying the necessary data content, formats and sources for initial data collection is done
in which step of Data Science methodology?
a. Data requirements
b. Data Collection
c. Data Understanding
d. Data Preparation

10. Data sets are available online. From the given options, which one does not provide online
data?
a. UNICEF
b.WHO
c. Google
d. Edge

11. A ____________ set is a set of historical data in which outcomes are already known.
a. Training set
b. Test set
c. Validation set
d. Evaluation set

12. _____________ data set is used to evaluate the fit machine learning model.
a. Training set
b. Test set
c. Validation set
d. Evaluation set

13. x_train,x_test,y_train,y_test = train_test_split (x, y, test_size=0.2)


From the above line of code, identify the training data set size
a. 0.2
b. 0.8
c. 20
d. 80

14. In k-fold cross validation, what does k represent?


a. number of subsets
b. number of experiments
c. number of folds
d. all of the above

15. Identify the correct points regarding MSE given below:


i. MSE is expanded as Median Squared Error
ii. MSE is standard deviation of the residuals
iii. MSE is preferred with regression
iv. MSE penalize large errors more than small errors
a. i and ii
b. ii and iii
c. iii and iv
d. ii, iii and iv

B. Short Answer Questions

1. How many steps are there in Data Science Methodology? Name them in order.

2. What do you mean by Feature Engineering?

3. Data is collected from different sources. Explain the different types of sources with example.

4. Which step of Data Science Methodology is related to constructing the data set? Explain.

5. Write a short note on the steps done during Data Preparation.

6. Differentiate between descriptive modelling and predictive modelling.

7. Explain the different metrics used for evaluating Classification models.

8. Is Feedback a necessary step in Data Science Methodology? Justify your answer.

9. Write a comparative study on train-test split and cross validation.

10. Why is model validation important?

C. Long Answer Questions

1. Explain the procedure of k-fold cross validation with suitable diagram.

2. Data is the main part of any project. How will you find the requirements of data, collect it,
understand the data and prepare it for modelling?

UNIT 3: Making Machines See

A. Multiple Choice Questions:

1. The field of study that helps to develop techniques to help computers “see”
is________________.
a. Python
b. Convolution
c. Computer Vision
d. Data Analysis

2. Task of taking an input image and outputting/assigning a class label that best describes the
image is ____________.
a. Image classification
b. Image localization
c. Image Identification
d. Image prioritization
3. Identify the incorrect option
(i) computer vision involves processing and analysing digital images and videos to
understand their content.
(ii) A digital image is a picture that is stored on a computer in the form of a sequence of
numbers that computers can understand.
(iii) RGB colour code is used only for images taken using cameras.
(iv) Image is converted into a set of pixels and less pixels will resemble the original image.
a. ii
b. iii
c. iii & iv
d. ii & iv

4. The process of capturing a digital image or video using a digital camera, a scanner, or other
imaging devices is related to ________.
a. Image Acquisition
b. Preprocessing
c. Feature Extraction
d. Detection

5. Which algorithm may be used for supervised learning in computer vision?


a. KNN
b. K-means
c. K-fold
d. KEAM

6. A computer sees an image as a series of ___________


a. colours
b. pixels
c. objects
d. all of the above

7. ____________ empowers computer vision systems to extract valuable insights and drive
intelligent decision-making in various applications, ranging from autonomous driving to
medical diagnostics.
a. Low level processing
b. High insights
c. High-level processing
d. None of the above

8. In Feature Extraction, which technique identifies abrupt changes in pixel intensity and
highlights object boundaries?
a. Edge detection
b. Corner detection
c. Texture Analysis
d. boundary detection
9. Choose the incorrect statement related to preprocessing stage of computer vision
a. It enhances the quality of acquired image
b. Noise reduction and Image normalization is often employed with images
c. Techniques like histogram equalization can be applied to adjust the distribution of pixel
intensities
d. Edge detection and corner detection are ensured in images.

10. 1 byte = __________ bits


a. 10
b. 8
c. 2
d. 1

B. Short Answer Questions:

1. What is Computer Vision?

2. What is the main difference between classification and detection?

3. Write down any two algorithms which can be used for object detection.

4. Write down the process of object detection in a single object.

5. Write any four applications of computer vision.

C. Long Answer Questions:

1. What do you mean by Image segmentation? Explain the popular segmentations.

2. Explain the challenges faced by computer vision.

COMPETENCY BASED QUESTIONS:

1. A group of students is participating in a photography competition. As part of the competition,


they need to submit digitally captured images of various landscapes. However, one of the
students, Aryan, is unsure about how to ensure the best quality for his images when digitizing
them. Explain Aryan how the resolution of his images can impact their quality and detail
when viewed on a computer screen or printed.

2. The Red Fort is hosting a grand cultural event, and keeping everyone safe is top priority! A
state-of-the-art security system utilizes different "FEATURE EXTRACTION " to analyse live
video feeds and identify potential issues. Identify the feature extraction technique that can
be used in the following situation.
a. A large bag is left unattended near a crowded entrance.
b. A person tries to climb over a wall near a blind spot.
c. A group of people starts pushing and shoving in a congested area.
d. A wanted person with a distinctive red scarf enters the venue.

You might also like