practice_paper_1
practice_paper_1
practice_paper_1
a) Pandas
b) NumPy
c) Matplotlib
d) Seaborn
Answer: b) NumPy
2. What does the `axis` parameter specify in NumPy functions like `np.sum()`?
a) It specifies the range of values to include in the calculation
b) It specifies the dimension along which the operation will be performed
c) It specifies the type of operation to perform
d) It specifies the output data type
Answer: b) It specifies the dimension along which the operation will be
performed
3. Which of the following is a correct way to create a NumPy array from a Python
list?
a) `np.array(list)`
b) `numpy.array(list)`
c) `numpy.array([list])`
d) `array(list)`
Answer: a) `np.array(list)`
7. Which of the following is a correct syntax to read a CSV file into a Pandas
DataFrame?
a) `pd.read_csv(file)`
b) `pandas.read_csv(file)`
c) `pd.read_excel(file)`
d) `pandas.read_file(file)`
Answer: a) `pd.read_csv(file)`
11. Which of the following is a correct way to create a scatter plot in Matplotlib?
a) `plt.scatterplot(x, y)`
b) `plt.scatter(x, y)`
c) `plt.plot(x, y)`
d) `plt.bar(x, y)`
Answer: b) `plt.scatter(x, y)`
13. Which of the following is a correct way to create a bar plot in Seaborn?
a) `seaborn.barplot(x=data['X'], y=data['Y'])`
b) `seaborn.plot(x=data['X'], y=data['Y'])`
c) `seaborn.scatterplot(x=data['X'], y=data['Y'])`
d) `seaborn.histplot(x=data['X'], y=data['Y'])`
Answer: a) `seaborn.barplot(x=data['X'], y=data['Y'])`
17. Which of the following is a correct syntax to create a linear regression model
in Scikit-learn?
a) `model = sklearn.LinearRegression()`
b) `model = LinearRegression()`
c) `model = sklearn.regression.Linear()`
d) `model = linear_regression()`
Answer
: b) `model = LinearRegression()`
18. What is the purpose of the `fit()` method in a linear regression model?
a) To evaluate the model
b) To make predictions
c) To train the model
d) To transform the data
Answer: c) To train the model
23. What is the purpose of the `predict()` method in a logistic regression model?
a) To evaluate the model
b) To make predictions
c) To train the model
d) To transform the data
Answer: b) To make predictions
26. Which of the following is a correct syntax to create an SVM model in Scikit-
learn?
a) `model = sklearn.SVM()`
b) `model = SVM()`
c) `model = sklearn.svm.SVC()`
d) `model = svm_model()`
Answer: c) `model = sklearn.svm.SVC()`
28. Which of the following kernel functions is commonly used in SVM for non-linear
data?
a) Linear
b) Polynomial
c) Sigmoid
d) Normal
Answer: b) Polynomial
30. Which of the following is a correct syntax to create a decision tree model in
Scikit-learn?
a) `model = sklearn.DecisionTree()`
b) `model = DecisionTree()`
c) `model = sklearn.tree.DecisionTreeClassifier()`
d) `model = decision_tree_model()`
Answer: c) `model = sklearn.tree.DecisionTreeClassifier()`
32. Which of the following is a correct syntax to create a random forest model in
Scikit-learn?
a) `model = sklearn.RandomForest()`
b) `model = RandomForest()`
c) `model = sklearn.ensemble.RandomForestClassifier()`
d) `model = random_forest_model()`
Answer: c) `model = sklearn.ensemble.RandomForestClassifier()`
35. What does the term "explained variance ratio" refer to in PCA?
a) The percentage of total variance explained by each principal component
b) The number of principal components in the dataset
c) The amount of noise added to the dataset
d) The number of features after dimensionality reduction
Answer: a) The percentage of total variance explained by each principal
component
36. Which of the following is a correct syntax to create a neural network model in
Keras?
a) `model = keras.NeuralNetwork()`
b) `model = keras.Sequential()`
c) `model = keras.Model()`
d) `model = NeuralNetwork()`
Answer: b) `model = keras.Sequential()`
38. Which of the following is a correct syntax to compile a neural network model in
Keras?
a) `model.compile(loss='mse', optimizer='sgd', metrics=['accuracy'])`
b) `compile(model, loss='mse', optimizer='sgd', metrics=['accuracy'])`
c) `model.compile(loss='mse', sgd, ['accuracy'])`
d) `compile(loss='mse', optimizer='sgd', metrics=['accuracy'])`
Answer: a) `model.compile(loss='mse', optimizer='sgd', metrics=['accuracy'])`
model
42. Which of the following is a correct syntax to evaluate a neural network model
in Keras?
a) `model.evaluate(X_test, y_test)`
b) `evaluate(model, X_test, y_test)`
c) `model.evaluate(test_data)`
d) `evaluate(X_test, y_test)`
Answer: a) `model.evaluate(X_test, y_test)`
44. Which parameter in Keras controls the learning rate in optimization algorithms?
a) `epochs`
b) `batch_size`
c) `learning_rate`
d) `dropout`
Answer: c) `learning_rate`
45. Which of the following is not a correct syntax to create a scatter plot in
Matplotlib?
a) `plot.scatter(x, y)`
b) `scatter(x, y)`
c) `scatterplot(x, y)`
d) `plot(x, y)`
Answer: d) `plot(x, y)`
47. Which of the following is not a correct syntax to create a bar plot in Seaborn?
a) `sns.barplot(x=data['X'], y=data['Y'])`
b) `barplot(x=data['X'], y=data['Y'])`
c) `seaborn.barplot(x=data['X'], y=data['Y'])`
d) `plot.bar(x=data['X'], y=data['Y'])`
Answer: d) `plot.bar(x=data['X'], y=data['Y'])`
50. Which of the following is a correct syntax to create a line plot in Plotly?
a) `plotly.plot(data)`
b) `plotly.line(data)`
c) `plotly.plot(data, mode='lines')`
d) `plotly.graph_objects.Figure(data=graph_data)`
Answer: c) `plotly.plot(data, mode='lines')`
52. Which of the following is a correct syntax to create a neural network model in
TensorFlow?
a) `model = tf.keras.Model()`
b) `model = tf.keras.Sequential()`
c) `model = tf.keras.NeuralNetwork()`
d) `model = tf.NeuralNetwork()`
Answer: b) `model = tf.keras.Sequential()`
53. What is the primary role of the activation function in a neural network?
a) To normalize the input data
b) To control the learning rate
c) To introduce non-linearity
d) To compute the loss function
Answer: c) To introduce non-linearity
56. Which of the following is a correct syntax to create a K-means clustering model
in Scikit-learn?
a) `model = sklearn.KMeans()`
b) `model = KMeans()`
c) `model = sklearn.cluster.KMeans()`
d) `model = kmeans_model()`
Answer: c) `model = sklearn.cluster.KMeans()`
61. Which of the following is a correct syntax to create a neural network model in
TensorFlow?
a) `model = tf.keras.Model()`
b) `model = tf.keras.Sequential()`
c) `model = tf.keras.NeuralNetwork()`
d) `model = tf.NeuralNetwork()`
Answer: b) `model = tf.keras.Sequential()`
62. What is the primary role of the activation function in a neural network?
a) To normalize the input data
b) To control the learning rate
c) To introduce non-linearity
d) To compute the loss function
Answer: c) To introduce non-linearity
64. What is the purpose of the `fit()` method in a machine learning model?
a) To evaluate the model
b) To make predictions
c) To train the model
d) To transform the data
Answer: c) To train the model
65. Which of the following is a correct syntax to create a K-means clustering model
in Scikit-learn?
a) `model = sklearn.KMeans()`
b) `model = KMeans()`
c) `model = sklearn.cluster.KMeans()`
d) `model = kmeans_model()`
Answer: c) `model = sklearn.cluster.KMeans()`
70. Which of the following is a correct syntax to create a neural network model in
TensorFlow?
a) `model = tf.keras.Model()`
b) `model = tf.keras.Sequential()`
c) `model = tf.keras.NeuralNetwork()`
d) `model = tf.NeuralNetwork()`
Answer: b) `model = tf.keras.Sequential()`
71. What is the primary role of the activation function in a neural network?
a) To normalize the input data
b) To control the learning rate
c) To introduce non-linearity
d) To compute the loss function
Answer: c) To introduce non-linearity
73. What is the purpose of the `fit()` method in a machine learning model?
a) To evaluate the model
b) To make predictions
c) To train the model
d) To transform the data
Answer: c) To train the model
74. Which of the following is a correct syntax to create a K-means clustering model
in Scikit-learn?
a) `model = sklearn.KMeans()`
b) `model = KMeans()`
c) `model = sklearn.cluster.KMeans()`
d) `model = kmeans_model()`
Answer: c) `model = sklearn.cluster.KMeans()`