Loading

Quipoin Menu

Learn • Practice • Grow

python-for-ai / Training a Simple Model
mcq
Direction: Choose the correct option

Q1.

Which estimator from scikit-learn is used for linear regression?
A. LogisticRegression
B. Ridge
C. Both A and C
D. LinearRegression
Direction: Choose the correct option

Q2.

How do you create and train a linear regression model?
A. Both A and B
B. model = LinearRegression(); model.fit(X_train, y_train)
C. model = LinearRegression().fit(X_train, y_train)
D. model = LinearRegression.train(X_train, y_train)
Direction: Choose the correct option

Q3.

What does the `coef_` attribute of a linear model represent?
A. R-squared
B. Predictions
C. Intercept
D. Coefficients (weights)
Direction: Choose the correct option

Q4.

How do you make predictions with a trained model?
A. model.predict_proba(X_test)
B. model.score(X_test)
C. model.transform(X_test)
D. model.predict(X_test)
Direction: Choose the correct option

Q5.

Which model is used for binary classification?
A. Both A and B
B. LinearRegression
C. LogisticRegression
D. KNeighborsClassifier
Direction: Choose the correct option

Q6.

How do you import the K-Nearest Neighbors classifier?
A. from sklearn.neighbors import KNeighborsClassifier
B. from sklearn.knn import KNeighborsClassifier
C. import KNeighborsClassifier
D. from sklearn.neighbors import KNN
Direction: Choose the correct option

Q7.

What is a common way to set model hyperparameters?
A. Both A and B
B. Pass them to the constructor (e.g., KNeighborsClassifier(n_neighbors=5))
C. Use `params` argument in fit
D. Use `set_params` method
Direction: Choose the correct option

Q8.

What does `model.fit(X, y)` do for an unsupervised model like KMeans?
A. Predicts labels
B. Both A and B
C. Clusters the data
D. None
Direction: Choose the correct option

Q9.

What is the output of `model.score(X_test, y_test)` for a classifier?
A. R-squared
B. Mean accuracy
C. Log loss
D. F1 score
Direction: Choose the correct option

Q10.

Which method is used to get predicted probabilities for a classifier?
A. Both A and C
B. predict_proba
C. predict
D. predict_log_proba