Complete the code to scale the data using Min-Max scaling.
from sklearn.preprocessing import MinMaxScaler scaler = MinMaxScaler() data_scaled = scaler.[1](data)
MinMaxScaler requires fitting and transforming the data. The fit_transform method does both in one step.
Complete the code to normalize the data using L2 norm.
from sklearn.preprocessing import Normalizer normalizer = Normalizer(norm='[1]') data_normalized = normalizer.fit_transform(data)
The L2 norm scales each sample so that the sum of squares equals 1.
Fix the error in the code to standardize the data.
from sklearn.preprocessing import StandardScaler scaler = StandardScaler() data_standardized = scaler.[1](data)
StandardScaler requires fitting and transforming the data. The fit_transform method does both steps together.
Fill both blanks to create a dictionary of word lengths for words longer than 3 characters.
lengths = {word: [1] for word in words if len(word) [2] 3}The dictionary comprehension maps each word to its length if the word length is greater than 3.
Fill all three blanks to create a dictionary of uppercase words mapped to their lengths for words longer than 4 characters.
result = { [1]: [2] for word in words if len(word) [3] 4 }The dictionary comprehension creates keys as uppercase words and values as their lengths, only for words longer than 4 characters.