✅ Quiz M3.01

✅ Quiz M3.01#

Question

Which parameters below are hyperparameters of HistGradientBoostingClassifier? Remember we only consider hyperparameters to be those that potentially impact the result of the learning procedure and subsequent predictions.

  • a) C

  • b) max_leaf_nodes

  • c) verbose

  • d) classes_

  • e) learning_rate

Select all answers that apply

Question

Given an instance named model as defined by:

from sklearn.linear_model import LogisticRegression
model = LogisticRegression()

how do you get the value of the C parameter?

  • a) model.get_parameters()['C']

  • b) model.get_params()['C']

  • c) model.get_params('C')

  • d) model.get_params['C']

Select a single answer

Question

Given model defined by:

from sklearn.linear_model import LogisticRegression

model = LogisticRegression()

how do you set the value of the C parameter to 5?

  • a) model.set_params('C', 5)

  • b) model.set_params({'C': 5})

  • c) model.set_params()['C'] = 5

  • d) model.set_params(C=5)

Select a single answer

Question

Given model defined by:

from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import LogisticRegression
from sklearn.pipeline import Pipeline

model = Pipeline([
    ('scaler', StandardScaler()),
    ('classifier', LogisticRegression())
])

how do you set the value of the C parameter of the LogisticRegression component to 5:

  • a) model.set_params(C=5)

  • b) model.set_params(logisticregression__C=5)

  • c) model.set_params(classifier__C=5)

  • d) model.set_params(classifier--C=5)

Select a single answer