BaşlayınÜcretsiz Başlayın

Vectorizing text

You'll now transform the volunteer dataset's title column into a text vector, which you'll use in a prediction task in the next exercise.

Bu egzersiz

Preprocessing for Machine Learning in Python

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Store the volunteer["title"] column in a variable named title_text.
  • Instantiate a TfidfVectorizer as tfidf_vec.
  • Transform the text in title_text into a tf-idf vector using tfidf_vec.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Take the title text
title_text = ____

# Create the vectorizer method
tfidf_vec = ____

# Transform the text into tf-idf vectors
text_tfidf = tfidf_vec.____(____)
Kodu Düzenle ve Çalıştır