Exercise

Assembling your first ensemble

It's time to build your first ensemble model! The Pokémon dataset from the previous exercise has been loaded and split into train and test sets.

Your job is to leverage the voting ensemble technique using the sklearn API. It's up to you to instantiate the individual models and pass them as parameters to build your first voting classifier.

Instructions

100 XP
  • Instantiate a KNeighborsClassifier called clf_knn with 5 neighbors (specified using n_neighbors).
  • Instantiate a "balanced" LogisticRegression called clf_lr (specified using class_weight).
  • Instantiate a DecisionTreeClassifier called clf_dt with min_samples_leaf = 3 and min_samples_split = 9.
  • Build a VotingClassifier using the parameter estimators to specify the following list of (str, estimator) tuples: 'knn', clf_knn, 'lr', clf_lr, and 'dt', clf_dt.