Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 35

DATA SCIENCE

1.What is the output of the following code snippet?

def foo(x=[]):

x.append(1)

return x

print(foo())

print(foo())

a) [1], [1, 1]

b) [1], [1]

c) [1, 1], [1, 1]

d) [1], [1, 1]

Answer: c) [1, 1], [1, 1]

2.What is the output of the following code snippet?

x = [1, 2, 3]

y=x

x += [4, 5]

print(y)

a) [1, 2, 3, 4, 5]
b) [1, 2, 3]

c) [1, 2, 3, [4, 5]]

d) Error

Answer: a) [1, 2, 3, 4, 5]

3.Which of the following is true about Python's Global Interpreter Lock (GIL)?

a) It ensures that only one thread executes Python bytecode at a time.

b) It prevents race conditions in multithreaded programs.

c) It allows for true parallelism in Python programs.

d) It is a feature of Python's memory management system.

Answer: a) It ensures that only one thread executes Python bytecode at a time.

4.What does the following list comprehension return?

[x for x in range(5) if x % 2 == 0]

a) [0, 2, 4]

b) [1, 3, 5]

c) [0, 1, 2, 3, 4]

d) [0, 1, 2, 3, 4, 5]

Answer: a) [0, 2, 4]
5.What is the output of the following code snippet?

print((lambda x: x * 2)(5))

a) 5

b) 10

c) 25

d) Error

Answer: b) 10

6.Which of the following is a valid way to open a file named "example.txt" in Python for reading?

a) file = open("example.txt", "r+")

b) file = open("example.txt", "w")

c) file = open("example.txt", "rb")

d) file = open("example.txt", "a")

Answer: a) file = open("example.txt", "r+")

7.What is the output of the following code snippet?

def f():

try:

print("a")

return

except:
print("b")

finally:

print("c")

f()

a) a

b) a c

c) a c b

d) a b c

Answer: b) a c

8.What does the "self" keyword refer to in Python class methods?

a) It refers to the current class instance.

b) It refers to the parent class of the current class.

c) It refers to the class itself.

d) It refers to the superclass of the current class.

Answer: a) It refers to the current class instance.

9.What is the output of the following code snippet?

x = 10

def foo():

global x
x += 5

return x

print(foo())

a) 10

b) 15

c) 20

d) Error

Answer: c) 20

10.What is the purpose of the "map" function in Python?

a) It creates a new list by applying a function to each element of an existing list.

b) It filters elements from a list based on a given condition.

c) It sorts the elements of a list in ascending order.

d) It reverses the elements of a list.

Answer: a) It creates a new list by applying a function to each element of an existing list.

11.Which of the following is a characteristic of overfitting in machine learning?


a) High bias and low variance
b) Low bias and low variance
c) High bias and high variance
d) Low bias and high variance

Answer: c) High bias and high variance


12.Which of the following algorithms is NOT a type of ensemble learning?
a) Random Forest
b) AdaBoost
c) k-Nearest Neighbors (KNN)
d) Gradient Boosting Machines (GBM)

Answer: c) k-Nearest Neighbors (KNN)

13.What is the primary goal of feature scaling in machine learning?

a) To normalize feature values to a standard range


b) To increase the number of features in the dataset
c) To remove irrelevant features from the dataset
d) To transform categorical features into numerical features

Answer: a) To normalize feature values to a standard range

14.Which of the following evaluation metrics is suitable for imbalanced classification problems?

a) Accuracy
b) Precision
c) Recall
d) F1-score

Answer: d) F1-score

15.What is the purpose of cross-validation in machine learning?

a) To evaluate a model's performance on an independent dataset


b) To divide the dataset into training and testing sets
c) To select the best hyperparameters for a model
d) To assess a model's generalization performance

Answer: d) To assess a model's generalization performance

16.Which of the following algorithms is used for unsupervised learning?


a) Decision Trees
b) Linear Regression
c) K-Means Clustering
d) Support Vector Machines (SVM)

Answer: c) K-Means Clustering

17.What is the purpose of the kernel trick in Support Vector Machines (SVM)?

a) To transform data into a higher-dimensional space


b) To reduce the dimensionality of the data
c) To speed up the training process
d) To handle missing values in the dataset

Answer: a) To transform data into a higher-dimensional space

18.Which of the following is NOT a type of neural network architecture?

a) Convolutional Neural Network (CNN)


b) Recurrent Neural Network (RNN)
c) Long Short-Term Memory (LSTM)
d) Random Forest

Answer: d) Random Forest

19.What is the purpose of the activation function in a neural network?

a) To introduce non-linearity into the network


b) To control the learning rate of the network
c) To prevent overfitting of the network
d) To normalize the input data

Answer: a) To introduce non-linearity into the network

20.What is the purpose of regularization in machine learning?


a) To reduce bias in the model
b) To reduce variance in the model
c) To prevent overfitting
d) To improve model performance
Answer: c) To prevent overfitting

21.Which of the following statistical tests is used to determine if there is a significant association
between two categorical variables?

a) T-test
b) Chi-square test
c) ANOVA
d) Z-test

Answer: b) Chi-square test

22.What is the purpose of a p-value in hypothesis testing?

a) To measure the strength of the relationship between two variables


b) To determine the probability of observing the data if the null hypothesis is true
c) To estimate the effect size of an intervention
d) To assess the normality of the data distribution

Answer: b) To determine the probability of observing the data if the null hypothesis is true

23.Which of the following is NOT a measure of central tendency?

a) Mean
b) Median
c) Variance
d) Mode

Answer: c) Variance

24.In linear regression, what does the coefficient of determination (R-squared) measure?

a) The strength of the relationship between the independent and dependent variables
b) The accuracy of the regression model's predictions
c) The proportion of the total variation in the dependent variable explained by the independent variable
d) The significance of the regression coefficients
Answer: c) The proportion of the total variation in the dependent variable explained by the independent
variable

25.Which of the following probability distributions is used to model the time until an event occurs?

a) Normal distribution
b) Poisson distribution
c) Exponential distribution
d) Binomial distribution

Answer: c) Exponential distribution

26.What is the purpose of cross-validation in machine learning?

a) To evaluate a model's performance on an independent dataset


b) To divide the dataset into training and testing sets
c) To select the best hyperparameters for a model
d) To assess a model's generalization performance

Answer: d) To assess a model's generalization performance

27.Which of the following is a measure of the spread of a probability distribution?

a) Mean
b) Median
c) Variance
d) Mode

Answer: c) Variance

28.In A/B testing, what is the purpose of randomization?

a) To ensure that the treatment and control groups are similar


b) To reduce bias in the sample selection process
c) To increase the statistical power of the test
d) To control for confounding variables

Answer: a) To ensure that the treatment and control groups are similar
29.What is the purpose of the F-test in ANOVA?

a) To test the overall significance of the regression model


b) To compare the means of multiple groups
c) To assess the normality of the residuals
d) To test for the equality of variances in two samples

Answer: b) To compare the means of multiple groups

30.What is the main advantage of using a non-parametric test over a parametric test?

a) Non-parametric tests require smaller sample sizes


b) Non-parametric tests make fewer assumptions about the data distribution
c) Non-parametric tests are more powerful
d) Non-parametric tests are easier to interpret

Answer: b) Non-parametric tests make fewer assumptions about the data distribution

31.What is the purpose of the apply family of functions in R?

a) To apply a function to each element of a vector or list


b) To create a new data frame from existing data frames
c) To perform matrix multiplication
d) To generate random numbers

Answer: a) To apply a function to each element of a vector or list

32.Which function is used to create a scatter plot in R?


a) plot()
b) scatterplot()
c) points()
d) scatter()

Answer: a) plot()

33.In R, what does the attach() function do?

a) Attaches a data frame to the search path for easier access to its columns
b) Attaches a library for use in the current session
c) Attaches a package for use in the current session
d) Attaches a function to an object

Answer: a) Attaches a data frame to the search path for easier access to its columns

34.Which of the following is a valid way to create a new variable total in a data frame df that sums the
values of variables var1 and var2?

a) df$total <- sum(df$var1, df$var2)


b) df$total <- df$var1 + df$var2
c) df$total <- add(df$var1, df$var2)
d) df$total <- df$var1 + df$var2()

Answer: b) df$total <- df$var1 + df$var2

36.Which function is used to calculate the cumulative sum of a vector in R?

a) cumsum()
b) sum()
c) cumulative()
d) cumulative_sum()

Answer: a) cumsum()

37.What is the purpose of the grep() function in R?

a) To search for a pattern in a character vector


b) To generate random numbers
c) To perform matrix multiplication
d) To extract elements from a list based on a condition

Answer: a) To search for a pattern in a character vector

38.Which package is commonly used for data manipulation and transformation in R?


a) ggplot2
b) dplyr
c) tidyr
d) reshape2

Answer: b) dplyr
39.What is the purpose of the lapply() function in R?

a) To apply a function to each element of a list and return a list


b) To apply a function to each column of a data frame and return a vector
c) To apply a function to each row of a data frame and return a list
d) To apply a function to each element of a vector and return a vector

Answer: a) To apply a function to each element of a list and return a list

40.Which function is used to read a CSV file into R?

a) read.table()
b) read.csv()
c) read.csv2()
d) read.delim()

Answer: b) read.csv()

41.What does the groupby() function in pandas do?

a) Groups the data in a DataFrame based on a specified column or columns


b) Sorts the data in a DataFrame based on a specified column or columns
c) Reshapes the data in a DataFrame from wide to long format
d) Aggregates the data in a DataFrame using a specified function

Answer: a) Groups the data in a DataFrame based on a specified column or columns

42.Which of the following methods is used to fill missing values in a pandas DataFrame with a
specified value?

a) fillna()
b) dropna()
c) replace()
d) interpolate()

Answer: a) fillna()
43.What does the pivot_table() function in pandas do?

a) Reshapes the data in a DataFrame from long to wide format


b) Aggregates data in a DataFrame using one or more keys
c) Computes the correlation matrix for a DataFrame
d) Applies a function to each element of a DataFrame

Answer: b) Aggregates data in a DataFrame using one or more keys

44.Which of the following methods is used to concatenate two or more pandas DataFrames vertically?

a) merge()
b) concat()
c) join()
d) append()

Answer: d) append()

45.What is the purpose of the apply() method in pandas?

a) Applies a function along an axis of a DataFrame


b) Applies a function element-wise to a DataFrame
c) Applies a function to each row or column of a DataFrame
d) Applies a function to each group of a DataFrame

Answer: c) Applies a function to each row or column of a DataFrame

46.Which of the following methods is used to rename columns in a pandas DataFrame?

a) rename()
b) relabel()
c) columns()
d) set_columns()

Answer: a) rename()

47.What does the resample() method in pandas do?


a) Reshapes the data in a DataFrame from long to wide format
b) Aggregates data over different time intervals
c) Computes the rolling mean or sum of a DataFrame
d) Interpolates missing values in a time series

Answer: b) Aggregates data over different time intervals

48.Which of the following methods is used to create a new column in a pandas DataFrame based on
values in existing columns?
a) map()
b) apply()
c) transform()
d) assign()

Answer: d) assign()

49.What does the cut() function in pandas do?

a) Divides a DataFrame into multiple smaller DataFrames


b) Categorizes continuous data into discrete intervals
c) Removes duplicate rows from a DataFrame
d) Computes the cumulative sum of a DataFrame

Answer: b) Categorizes continuous data into discrete intervals

50.Which of the following methods is used to pivot a pandas DataFrame from long to wide format?

a) pivot_table()
b) pivot()
c) melt()
d) wide()

Answer: b) pivot()

51.What is the purpose of the numpy.arange() function?

a) To create an array with evenly spaced values within a specified range


b) To create an array with random values
c) To create an array with zeros
d) To create an array with ones
Answer: a) To create an array with evenly spaced values within a specified range

52.Which of the following statements is true about broadcasting in numpy?

a) It only works for arrays of the same shape


b) It allows arrays with different shapes to be combined in arithmetic operations
c) It is used for converting data types in arrays
d) It is used for reshaping arrays

Answer: b) It allows arrays with different shapes to be combined in arithmetic operations

53.What does the numpy.dot() function do?

a) Computes the dot product of two arrays


b) Computes the cross product of two arrays
c) Computes the element-wise product of two arrays
d) Computes the sum of the elements in an array

Answer: a) Computes the dot product of two arrays

54.Which numpy function is used to find the unique elements of an array?


a) numpy.unique()
b) numpy.distinct()
c) numpy.unique_elements()
d) numpy.distinct_elements()

Answer: a) numpy.unique()

55.What does the numpy.concatenate() function do?

a) Concatenates two or more arrays along a specified axis


b) Merges two or more arrays into a single array
c) Joins two or more arrays using a specified delimiter
d) Splits an array into multiple sub-arrays

Answer: a) Concatenates two or more arrays along a specified axis


56.Which numpy function is used to compute the mean of an array?
a) numpy.mean()
b) numpy.average()
c) numpy.mean_array()
d) numpy.array_mean()

Answer: a) numpy.mean()

57.What does the numpy.reshape() function do?


a) Changes the shape of an array without changing its data
b) Transposes the rows and columns of an array
c) Converts an array into a matrix
d) Resizes the dimensions of an array

Answer: a) Changes the shape of an array without changing its data

58.Which numpy function is used to compute the standard deviation of an array?

a) numpy.std()
b) numpy.var()
c) numpy.mean()
d) numpy.median()

Answer: a) numpy.std()

59.What is the purpose of the numpy.where() function?

a) It is used to filter elements from an array based on a condition


b) It is used to find the indices of elements in an array that satisfy a condition
c) It is used to replace elements in an array with a specified value
d) It is used to concatenate arrays along a specified axis

Answer: b) It is used to find the indices of elements in an array that satisfy a condition

60.Which numpy function is used to compute the cumulative sum of elements in an array?

a) numpy.cumsum()
b) numpy.sum_cumulative()
c) numpy.cumulative_sum()
d) numpy.sum() with the cumulative parameter set to True

Answer: a) numpy.cumsum()

61.What is the purpose of the matplotlib.pyplot.plot() function?

a) To create a line plot


b) To create a scatter plot
c) To create a bar plot
d) To create a histogram

Answer: a) To create a line plot

62.Which of the following statements is true about the matplotlib.pyplot.subplots() function?

a) It creates a single subplot


b) It creates multiple subplots in a single figure
c) It creates a figure without any subplots
d) It creates a 3D plot

Answer: b) It creates multiple subplots in a single figure

63.What does the matplotlib.pyplot.hist() function do?

a) It creates a line plot


b) It creates a scatter plot
c) It creates a bar plot
d) It creates a histogram

Answer: d) It creates a histogram

64.Which of the following is NOT a valid way to set the title of a plot in matplotlib?

a) plt.title("Title")
b) plt.set_title("Title")
c) plt.suptitle("Title")
d) plt.figtext("Title")
Answer: b) plt.set_title("Title")

65.What is the purpose of the matplotlib.pyplot.savefig() function?

a) It saves the current figure to a file


b) It sets the size of the current figure
c) It displays the current figure
d) It closes the current figure

Answer: a) It saves the current figure to a file

66.Which of the following methods is used to customize the color of a plot in matplotlib?

a) color()
b) set_color()
c) set_facecolor()
d) set_edgecolor()

Answer: a) color()

67.What is the purpose of the matplotlib.pyplot.legend() function?

a) It adds a legend to the current plot


b) It sets the labels for the x-axis and y-axis
c) It creates a new subplot
d) It adjusts the layout of the plot

Answer: a) It adds a legend to the current plot

68.Which of the following statements is true about the matplotlib.pyplot.subplots_adjust() function?

a) It adjusts the spacing between subplots


b) It adjusts the size of the subplots
c) It adjusts the position of the subplots
d) It adjusts the color of the subplots

Answer: a) It adjusts the spacing between subplots


69.What does the matplotlib.pyplot.grid() function do?

a) It adds a grid to the plot


b) It removes the grid from the plot
c) It adjusts the gridlines in the plot
d) It sets the grid color and style

Answer: a) It adds a grid to the plot

70.Which of the following methods is used to set the x-axis limits in matplotlib?

a) plt.xlim()
b) plt.set_xlim()
c) plt.set_xlimits()
d) plt.axis()

Answer: a) plt.xlim()

71.What is Django?

a) A programming language
b) A web framework for building web applications
c) A database management system
d) A server-side scripting language

Answer: b) A web framework for building web applications

72.What is the purpose of Django's ORM (Object-Relational Mapping)?

a) To manage database connections


b) To define database models using Python classes
c) To handle HTTP requests and responses
d) To create user interfaces for web applications

Answer: b) To define database models using Python classes


73.Which of the following is NOT a built-in authentication method in Django?

a) Basic authentication
b) Token-based authentication
c) Session-based authentication
d) OAuth authentication

Answer: d) OAuth authentication

74.What is the purpose of Django's "migrations"?

a) To manage user authentication


b) To handle URL routing in web applications
c) To synchronize the database schema with changes in Django models
d) To manage static files such as CSS and JavaScript

Answer: c) To synchronize the database schema with changes in Django models

75.Which of the following is used to define the URL patterns in a Django application?

a) URLs.py
b) Views.py
c) Models.py
d) Settings.py

Answer: a) URLs.py

76.What is the purpose of Django's "middleware"?

a) To manage user sessions


b) To handle HTTP requests and responses
c) To provide a user interface for managing Django applications
d) To define the structure of a Django project

Answer: b) To handle HTTP requests and responses

77.Which of the following is NOT a valid database backend supported by Django?


a) MySQL
b) PostgreSQL
c) MongoDB
d) SQLite

Answer: c) MongoDB

78.What is the purpose of Django's "template tags"?

a) To define custom template filters


b) To include reusable HTML code in templates
c) To manage user authentication in templates
d) To define the structure of a Django template

Answer: a) To define custom template filters

79.What is the role of Django's "context processors"?

a) To process HTTP requests


b) To provide data to be used in templates
c) To define URL patterns
d) To manage user authentication

Answer: b) To provide data to be used in templates

80Which command is used to start a development server in Django?

a) python manage.py runserver


b) python startserver.py
c) python manage.py startserver
d) python runserver.py

Answer: a) python manage.py runserver

81.What is FastAPI?

a) A frontend JavaScript framework

b) A Python web framework for building APIs with a focus on speed

c) A database management system


d) A serverless computing platform

Answer: b) A Python web framework for building APIs with a focus on speed

82.Which of the following Python web frameworks is FastAPI built on top of?

a) Flask

b) Django

c) Starlette

d) Falcon

Answer: c) Starlette

83.What is the purpose of FastAPI's Path class?

a) To define the path parameters in a request URL

b) To define the request body in a POST or PUT request

c) To define the query parameters in a request URL

d) To define the response model for an API endpoint

Answer: a) To define the path parameters in a request URL

84.Which of the following is NOT a feature of FastAPI?

a) Automatic generation of OpenAPI and JSON Schema

b) Dependency injection for route handlers

c) Built-in support for web sockets


d) Asynchronous request handling with Python's async and await

Answer: c) Built-in support for web sockets

85.How does FastAPI handle request validation?

a) It uses Python's built-in validation libraries

b) It automatically validates requests based on defined data models

c) It requires explicit validation code in each route handler

d) It relies on external validation services

Answer: b) It automatically validates requests based on defined data models

86.Which Python type hinting feature does FastAPI heavily rely on for automatic data validation and
serialization?

a) Annotations

b) Typing

c) Protocols

d) Generics

Answer: a) Annotations

87.What is the purpose of FastAPI's Response class?

a) To define the response model for an API endpoint

b) To create and send HTTP responses

c) To handle exceptions and errors in API endpoints


d) To define the request body in a POST or PUT request

Answer: b) To create and send HTTP responses

88.Which of the following is a valid way to define a path parameter in a FastAPI route?

a) /items/{item_id}

b) /items/:item_id

c) /items/item_id

d) /items?item_id={item_id}

Answer: a) /items/{item_id}

89.What is the purpose of FastAPI's BackgroundTasks class?

a) To define background tasks that run asynchronously

b) To handle background jobs in a web application

c) To define middleware for request handling

d) To manage database connections in the background

Answer: a) To define background tasks that run asynchronously

90.Which of the following is NOT a supported response format in FastAPI?

a) JSON

b) HTML

c) XML

d) Plain text

Answer: c) XML
91.What is K-means clustering used for?

a) Dimensionality reduction

b) Classification

c) Regression

d) Clustering

Answer: d) Clustering

91.In K-means clustering, what does "K" represent?

a) The number of clusters to be formed

b) The number of iterations for convergence

c) The number of features in the dataset

d) The number of data points in the dataset

Answer: a) The number of clusters to be formed

92.What is the objective function optimized by K-means clustering?

a) Entropy

b) Information gain

c) Inertia

d) Silhouette coefficient

Answer: c) Inertia
93.How does the K-means algorithm initialize cluster centroids?

a) Randomly

b) Based on the first K data points

c) Based on the maximum variance in the dataset

d) Based on the minimum variance in the dataset

Answer: a) Randomly

94.What is the main drawback of the K-means algorithm?

a) It is sensitive to the initial placement of cluster centroids

b) It cannot handle non-linear relationships in the data

c) It assumes that clusters are of spherical shape

d) It requires a large number of iterations to converge

Answer: a) It is sensitive to the initial placement of cluster centroids

95.Which of the following is a metric used to evaluate the quality of K-means clustering?

a) F1 score

b) Adjusted Rand Index (ARI)

c) Mean squared error (MSE)

d) R-squared

Answer: b) Adjusted Rand Index (ARI)


96.What does the K-means++ initialization method aim to achieve?

a) Faster convergence of the algorithm

b) More accurate cluster centroids

c) Improved handling of outliers

d) Better separation between clusters

Answer: b) More accurate cluster centroids

97.How does the K-means algorithm update cluster centroids in each iteration?

a) By computing the mean of all data points assigned to each cluster

b) By computing the median of all data points assigned to each cluster

c) By computing the mode of all data points assigned to each cluster

d) By randomly selecting new cluster centroids

Answer: a) By computing the mean of all data points assigned to each cluster

99.Which of the following statements about K-means clustering is true?

a) It can handle categorical data directly

b) It is guaranteed to converge to the global optimum

c) It is sensitive to outliers in the dataset

d) It is not affected by the scale of the features

Answer: c) It is sensitive to outliers in the dataset


100.How does the Elbow method help in determining the optimal number of clusters in K-means
clustering?

a) It measures the silhouette coefficient for different values of K

b) It computes the variance explained by different values of K

c) It calculates the sum of squared distances from data points to their assigned centroids for different
values of K

d) It visualizes the clusters for different values of K

Answer: c) It calculates the sum of squared distances from data points to their assigned centroids for
different values of K

101.What is scikit-learn?

a) A data visualization library

b) A machine learning library for Python

c) A database management system

d) A deep learning framework

Answer: b) A machine learning library for Python

102.Which of the following is NOT a module in scikit-learn?

a) sklearn.preprocessing

b) sklearn.feature_extraction

c) sklearn.model_selection

d) sklearn.neural_network

Answer: d) sklearn.neural_network
103.What is the purpose of the train_test_split function in scikit-learn?

a) To split a dataset into training and testing sets

b) To preprocess text data for machine learning

c) To perform feature selection

d) To perform model evaluation

Answer: a) To split a dataset into training and testing sets

104.Which algorithm is used for classification in scikit-learn?

a) K-means clustering

b) Decision trees

c) Linear regression

d) Principal Component Analysis (PCA)

Answer: b) Decision trees

104.What is the purpose of the GridSearchCV class in scikit-learn?

a) To perform grid search for hyperparameter tuning

b) To visualize the decision boundary of a classifier

c) To evaluate the performance of a model

d) To preprocess data for clustering algorithms

Answer: a) To perform grid search for hyperparameter tuning


105.Which method is used to train a model in scikit-learn?

a) fit()

b) train()

c) predict()

d) transform()

Answer: a) fit()

106.What is the purpose of the Pipeline class in scikit-learn?

a) To create a sequence of data processing steps followed by a model

b) To create a neural network model

c) To handle missing values in a dataset

d) To perform feature scaling

Answer: a) To create a sequence of data processing steps followed by a model

107.Which metric is commonly used to evaluate the performance of classification models in scikit-
learn?

a) Mean Absolute Error (MAE)

b) Root Mean Squared Error (RMSE)

c) Accuracy

d) R-squared

Answer: c) Accuracy
108.What is the purpose of the StandardScaler class in scikit-learn?

a) To standardize feature scaling

b) To perform dimensionality reduction

c) To handle missing values in a dataset

d) To encode categorical variables

Answer: a) To standardize feature scaling

109.Which of the following is NOT a supervised learning algorithm available in scikit-learn?

a) Support Vector Machines (SVM)

b) K-means clustering

c) Random Forest

d) Linear Regression

Answer: b) K-means clustering

110.Which of the following is NOT a dimensionality reduction technique available in scikit-learn?

a) Principal Component Analysis (PCA)

b) t-Distributed Stochastic Neighbor Embedding (t-SNE)

c) Linear Discriminant Analysis (LDA)

d) Support Vector Machines (SVM)

Answer: d) Support Vector Machines (SVM)


111.What is Keras?

a) A data visualization library

b) A machine learning library for Python

c) A deep learning framework for Python

d) A database management system

Answer: c) A deep learning framework for Python

112.Which of the following statements is true about Keras?

a) It is an independent machine learning library

b) It is built on top of TensorFlow and provides a high-level API

c) It is primarily used for classical machine learning algorithms

d) It is not suitable for deep learning tasks

Answer: b) It is built on top of TensorFlow and provides a high-level API

113.What is the primary advantage of using Keras for deep learning?

a) Its ability to handle large-scale distributed training

b) Its ease of use and high-level abstraction

c) Its compatibility with various programming languages

d) Its support for low-level optimization

Answer: b) Its ease of use and high-level abstraction


114.Which of the following is NOT a valid Keras model type?

a) Sequential model

b) Functional API model

c) Object Detection model

d) Model Subclassing

Answer: c) Object Detection model

115.What is the purpose of the compile() method in Keras?

a) To define the architecture of a neural network model

b) To configure the model for training

c) To train the model on input data

d) To evaluate the model's performance on a test set

Answer: b) To configure the model for training

116.Which loss function is commonly used for binary classification tasks in Keras?

a) Mean Squared Error (MSE)

b) Binary Cross-Entropy

c) Categorical Cross-Entropy

d) Kullback-Leibler Divergence

Answer: b) Binary Cross-Entropy


117.What is the purpose of the fit() method in Keras?

a) To define the architecture of a neural network model

b) To compile the model for training

c) To train the model on input data

d) To evaluate the model's performance on a test set

Answer: c) To train the model on input data

118.Which of the following is used to prevent overfitting in a Keras model?

a) Dropout regularization

b) L1 regularization

c) L2 regularization

d) All of the above

Answer: d) All of the above

119.What is the purpose of the evaluate() method in Keras?

a) To define the architecture of a neural network model

b) To compile the model for training

c) To train the model on input data

d) To evaluate the model's performance on a test set

Answer: d) To evaluate the model's performance on a test set


120.Which of the following is NOT a valid Keras layer type?

a) Dense layer

b) Convolutional layer

c) Pooling layer

d) Activation layer

Answer: d) Activation laye

You might also like