Complete the code to import the machine learning library.
import [1]
TensorFlow is a popular library used for machine learning tasks.
Complete the code to create a simple linear regression model using scikit-learn.
from sklearn.linear_model import [1] model = [1]()
LinearRegression is the class used to create a linear regression model in scikit-learn.
Fix the error in the code to split data into training and testing sets with test_size=0.2.
from sklearn.model_selection import train_test_split X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=[1], random_state=42)
The test_size parameter expects a float between 0 and 1 representing the proportion of the dataset to include in the test split.
Fill both blanks to create a dictionary comprehension that maps words to their lengths only if the length is greater than 3.
{word: [1] for word in words if [2]The dictionary comprehension maps each word to its length using len(word). The condition filters words with length greater than 3.
Fill all three blanks to create a dictionary comprehension that maps uppercase words to their frequencies only if frequency is greater than 1.
{ [1]: [2] for [3], [2] in word_counts.items() if [2] > 1 }The comprehension maps the uppercase version of each word to its count, iterating over word_counts items where count is greater than 1.