mirror of https://github.com/01-edu/Branch-AI.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
629 B
629 B
Exercise 1 Imputer 1
The goal of this exercise is to learn how to use an Imputer to fill missing values on basic example.
train_data = [[7, 6, 5],
[4, np.nan, 5],
[1, 20, 8]]
-
Fit the
SimpleImputer
on the data. Print thestatistics_
. Check that the statistics matchnp.nanmean(train_data, axis=0)
. -
Fill the missing values in
train_data
using the fitted imputer andtransform
. -
Fill the missing values in
test_data
using the fitted imputer andtransform
.
test_data = [[np.nan, 1, 2],
[7, np.nan, 9],
[np.nan, 2, 4]]