Senz AIoT Savants  - ML & C++

Senz AIoT Savants - ML & C++

Professional Development

10 Qs

quiz-placeholder

Similar activities

Python-Sem-II

Python-Sem-II

Professional Development

10 Qs

Python Training Day-2  Quiz-2

Python Training Day-2 Quiz-2

Professional Development

10 Qs

Python Class 1

Python Class 1

Professional Development

15 Qs

Sequences-2

Sequences-2

Professional Development

10 Qs

Python Quiz

Python Quiz

Professional Development

7 Qs

Basic of Programming - Quiz 02

Basic of Programming - Quiz 02

University - Professional Development

15 Qs

PYTHON QUIZ2

PYTHON QUIZ2

University - Professional Development

10 Qs

C++ Is Fun

C++ Is Fun

Professional Development

10 Qs

Senz AIoT Savants  - ML & C++

Senz AIoT Savants - ML & C++

Assessment

Quiz

Computers

Professional Development

Hard

Created by

Kavinda Perera

Used 1+ times

FREE Resource

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

Media Image

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

Media Image

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

Media Image

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
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?