Scaling II
You'll now apply a scaler to the dataset, which is available for you as environment.
Remember that Scaling helps the algorithm converge faster, and avoids having one dominant feature heavily influence the outcomes.
この演習はコースの一部です
Analyzing IoT Data in Python
演習の手順
- Initialize a
StandardScalerand store it assc. - Fit the scaler to
environment. - Scale
environmentand store the result asenviron_scaled. - Convert the scaled data back to a DataFrame, using the same columns and index than the original DataFrame.
実践的なインタラクティブ演習
このサンプルコードを完成させて、この演習に挑戦してみましょう。
# Initialize StandardScaler
sc = ____()
# Fit the scaler
sc.fit(____)
# Transform the data
environ_scaled = ____.____(____)
# Convert scaled data to DataFrame
environ_scaled = pd.DataFrame(____,
columns=____,
index=____)
print(environ_scaled.head())
plot_unscaled_scaled(environment, environ_scaled)