Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
孊ぶ Challenge: Putting It All Together | Section
Machine Learning Foundations with Scikit-Learn

Challenge: Putting It All Together

メニュヌを衚瀺するにはスワむプしおください

In this challenge, apply the full workflow learned in the course — from data preprocessing through training to model evaluation.

タスク

スワむプしおコヌディングを開始

You are working with a penguin dataset. Build an ML pipeline to classify species with KNN, handling encoding, missing values, scaling, and tuning.

  1. Encode y with LabelEncoder.
  2. Split with train_test_split(test_size=0.33).
  3. Make ct: OneHotEncoder on 'island', 'sex', remainder='passthrough'.
  4. Set param_grid for n_neighbors, weights, p. For n_neighbors better to use odd values of integers.
  5. Create GridSearchCV(KNeighborsClassifier(), param_grid).
  6. Pipeline: ct → SimpleImputer('most_frequent') → StandardScaler → GridSearchCV.
  7. Fit on train.
  8. Print test .score.
  9. Predict, print first 5 decoded labels.
  10. Print .best_estimator_.

解答

Switch to desktop実践的な緎習のためにデスクトップに切り替える䞋蚘のオプションのいずれかを利甚しお、珟圚の堎所から続行する
すべお明確でしたか

どのように改善できたすか

フィヌドバックありがずうございたす

セクション 1. 章 32
single

single

AIに質問する

expand

AIに質問する

ChatGPT

䜕でも質問するか、提案された質問の1぀を詊しおチャットを始めおください

some-alt