You are on page 1of 4

MODEL QUESTION PAPER

CAT – I
Answer the following questions 10 X 2 = 20 Marks

1 qt <- c("Time", 24, "October", TRUE, 3.33) . Ans


What is class(qt)?

(a) integer (b) numeric d


(c) logical (d) character

2 What is the output of following code? b


cd <- c(2.5, "May")
cd

(a) Error (b) '2.5' 'May'


(c) 0 0 (d) garbage values

3 What is the output of following code?


ab <- c(TRUE, 24)
b <- as.logical(ab)
b

(a) Error (b) TRUE FALSE c


(c) TRUE TRUE (d) 1 24

4 What is the output of following code?


m <- 1:10
print(dim(m))

(a) 1 10 (b) NULL b


(c) 10 1 (d) 10

5 What is the output of following code?


a <- matrix(1:6, nrow = 2, ncol = 2)
print(a)

(a) Error (b) 1 3 b


2 4
(c) 1 2 (d) 1 2 3 4
3 4

6 What is the output of following code? d


logical(5)

(a) TRUE TRUE TRUE TRUE TRUE (b) TRUE FALSE TRUE FALSE TRUE
(c) “” “” “” “” “” (d) FALSE FALSE FALSE FALSE FALSE

7 What is the output of following code?


x <- c('one','two','three','four')
x <- NULL
x

(a) ‘NULL’ ‘NULL’ ‘NULL’ ‘NULL’ (b) ‘NULL’ c


(c) NULL (d) NULL NULL NULL NULL
8 What is the output of following code? c
x <- c('one','two','three','four')
y <- c(1,2,3,4)
z <- c(4.5,8.9,3.3,4.5)
df <- data.frame(x,y,z)
class(df$x)

(a) Character (b) String


(c) Factor (d) All of the above

9 What is the output of following code? d

x <- c('one','two','three','four')
y <- c(1,2,3,4)
z <- c(4.5,8.9,3.3,4.5)
lst <- list(x,y,z)
lst[x]

(a) one two three four (b) ‘one’ ‘two’ ‘three’ ‘four’
(c) 1 2 3 4 (d) NULL NULL NULL NULL

10 What is the output of following code? d

x <- c('one','two','three','four')
y <- c(1,2,3,4)
z <- c(4.5,8.9,3.3,4.5)
arr <- array(c(x,y,z))
arr

(a) Error

(b)
(d) 'one' 'two' 'three' 'four' '1' '2' '3' '4' '4.5' '8.9'
(c) '3.3' '4.5
Consider the following data and answer the following questions from 11-15 . 5 X 2 = 10 Marks

This famous (Fisher's or Anderson's) iris data set gives the measurements in centimeters of the variables
sepal length and width and petal length and width, respectively, for 10 flowers from each of 3 species of
iris. The species are Iris setosa, versicolor, and virginica.

Sepal.Length Sepal.Width Petal.Length Petal.Width Species


5.4 3.4 1.5 0.4 setosa
5.2 4.1 1.5 0.1 setosa
5.8 2.6 4 1.2 versicolor
5.1 3.5 1.4 0.3 setosa
6.3 2.5 4.9 1.5 versicolor
5.7 3.8 1.7 0.3 setosa
6.7 3.1 5.6 2.4 virginica
5.4 3.4 1.7 0.2 setosa
6.7 3.1 4.4 1.4 versicolor
5.5 3.5 1.3 0.2 setosa

11 What are the mean and median of the column “Sepal.Length”? a

(a) 57.8 5.78 (b) 57.8 5.6


(c) 56.8 5.4 (d) 57.8 6.3

12 What is the mode of the column “Species”? c

(a) Versicolor (b) Virginica


(c) Setosa (d) None Of The Above (NOTA)

13 What are standard deviation and variance of the column “Petal.Width”? a

(a) 0.77, 0.60 (b) 0.87, 0.60


(c) 0.77, 0.50 (d) 0.67, 0.50

14 What is the normalized value of 2.5 in the column “Sepal.Width” using min-max normalization
having new minimum value as 11 and new maximum value is 13

(a) (b)
(c) (d)

15 What is the normalized value of 2.5 in the column “Petal.length” using z-score normalization?

(a) (b)
(c) (d)
16. Suppose that the data for analysis include the attribute age. The age values for the data tuples are (in
increasing order): 13, 15, 16, 16, 19, 20, 20, 21, 22, 22, 25, 25, 25, 25, 30, 33, 33, 35, 35, 35, 35, 36, 40, 45,
46, 52, 70
Smooth the data using following methods using a bin depth of 3
(a) smoothing by bin means (3 Marks)
(b) smoothing by bin medians (3 Marks)
(c) smoothing by bin boundaries (4 Marks)

17. In the following real-world data, tuples with missing values for some attributes are a common occurrence.
Fill the missing values with appropriate method and justify why you have chosen that method. (10 M)
ph. ph. pat. meal.
Id no Inst time status age sex Ecog karno karno Cal wt.loss

1 3 306 2 74 1 1 90 100 1175

2 3 455 2 68 1 0 90 90 1225 15

3 3 1 56 1 0 90 90 15

4 5 210 57 1 1 90 60 1150 11

5 1 883 2 60 1 0 90 0

6 12 1022 1 1 1 50 80 513 0
7 7 310 2 68 2 2 70 60 384 10

8 11 2 71 2 2 60 80 1

9 1 218 2 53 1 1 70 80 825 16
10 7 166 2 61 2 70 271 34

You might also like