Project Workshop: Feature Engineering & Baseline Model
With our data explored, it's time to prepare it for our machine learning algorithms. We need to convert our raw text into numbers and establish a baseline model.
Our models cannot read English; they need numbers. We will use a TfidfVectorizer to convert the text into TF-IDF features.
We must set aside some data to evaluate our model later. A common split is 80% for training and 20% for testing. Make sure to use stratified sampling so both sets have an equal balance of positive and negative reviews.
A baseline model is a simple, standard model we use as a benchmark. If a complex model can't beat the baseline, it's not worth using! We will use Logistic Regression.
Put together your preprocessing and baseline model:
TfidfVectorizer on the training data. Let's try max_features=3000.LogisticRegression model on the training data.