Senz AIoT Savants - ML & C++
Quiz
•
Computers
•
Professional Development
•
Practice Problem
•
Hard
Kavinda Perera
Used 1+ times
FREE Resource
Enhance your content in a minute
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Numpy array arr is defined as follows :
arr = np.array([1,2,3,4,5,6,7])
Which one of the following returns the even numbers in the array ?
print(arr(0: step = 2))
print(arr(1: step = 2))
print(arr[1::2])
print(arr[::2])
Answer explanation
arr[::2] means to select every 2nd element from the array starting from the first element, i.e., [1, 3, 5, 7]. This works because the even numbers in the array are at positions that are multiples of 2, starting from the first element at position 0.
The other options are:
print(arr(0: step = 2)): This is not valid Python syntax. It should be arr[::2].
print(arr(1: step = 2)): This is not valid Python syntax. It should be arr[1::2].
print(arr[1::2]): This returns [2, 4, 6], which are the odd numbers in the array. This is because we start selecting elements from position 1, which is the second element, and then select every 2nd element from there.
2.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
A Python dataframe is defined according to the code shown in the picture. What is the data type (dtype) of column “Age” ?
Int64
String
object
Above snippet will give an error
Answer explanation
In the given DataFrame, the column "Age" has values of mixed data types - integers and a string ("hello"). When a column in a Pandas DataFrame has mixed data types, Pandas assigns the data type that can accommodate all the data in the column, which is usually the object data type.
In this case, since the "Age" column has a string value, Pandas assigns the data type of the column to object. If we try to perform numerical operations on this column, it will result in a TypeError due to the presence of the string value.
3.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which of the following is a method for reducing the dimensionality of a dataset?
Normalization
Standardization
One-hot encoding
Principal component analysis (PCA)
Answer explanation
PCA is a technique for reducing the dimensionality of a dataset by projecting it onto a lower-dimensional space while preserving as much of the variance in the data as possible. Normalization, standardization, and one-hot encoding are all preprocessing techniques that are not specifically designed for dimensionality reduction.
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which of the following evaluation metrics is commonly used for measuring the performance of object detection algorithms?
Precision-Recall curve
F1-score
Mean Average Precision (mAP)
Receiver Operating Characteristic (ROC) curve
Answer explanation
While Precision-Recall curve, F1-score, and Receiver Operating Characteristic (ROC) curve are also commonly used metrics for evaluating the performance of machine learning algorithms, they are more suitable for binary classification problems. Object detection is a multi-class classification problem, and mAP is specifically designed to evaluate the accuracy of object detection algorithms.
5.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the output of the following code snippet?
[1, 2, 3]
[1, 4, 3]
[1, 2, 4]
[4, 2, 3]
Answer explanation
In this code, we create a list x with the values [1, 2, 3]. We then make a copy of this list and assign it to y. Next, we change the second element of x to 4. Finally, we print the value of y. Since y is a copy of x, changing x does not affect y, so the output will be [1, 2, 3].
6.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which of the following is NOT a common preprocessing step in machine learning?
Normalization
Standardization
One-hot encoding
Feature selection
Answer explanation
While feature selection is a common technique for reducing the number of features in a dataset, it is not considered a preprocessing step in the same way that normalization, standardization, and one-hot encoding are.
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the output of the following C++ code snippet?
5 7
7 5
7 7
Compilation Error
Answer explanation
This code initializes two integer variables x and y with the values 5 and 7 respectively. It then declares two integer pointers p1 and p2 and sets them to point to the memory addresses of x and y respectively.
The next line is where things get interesting: p1 = p2;. This line is assigning the value pointed to by p2 (which is y) to the value pointed to by p1 (which is x). So after this line executes, x will have the value 7, and y will still have the value 7.
Finally, the code prints out the values of x and y on the same line separated by a space using cout << x << " " << y << endl;. The output of this code will be: 7 7
In summary, the code swaps the values of x and y by using pointers, and then outputs the new values of both variables.
Create a free account and access millions of resources
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
11 questions
Technology Morning Tea Quiz
Quiz
•
KG - Professional Dev...
10 questions
SQL Commands - SELECT Statements
Quiz
•
Professional Development
10 questions
Day 3 C Programming quiz
Quiz
•
Professional Development
10 questions
Fun and Interesting Facts about Technology
Quiz
•
University - Professi...
10 questions
1 - Introducing SCRUM in SAFe
Quiz
•
Professional Development
10 questions
Pre Test CTIA
Quiz
•
Professional Development
11 questions
Types of Mass Media
Quiz
•
10th Grade - Professi...
10 questions
Friday Fun
Quiz
•
Professional Development
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
15 questions
4:3 Model Multiplication of Decimals by Whole Numbers
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
The Best Christmas Pageant Ever Chapters 1 & 2
Quiz
•
4th Grade
12 questions
Unit 4 Review Day
Quiz
•
3rd Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
