Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
SimpleImputer | The Very First Steps
Introduction to Scikit Learn
course content

Зміст курсу

Introduction to Scikit Learn

Introduction to Scikit Learn

1. The Very First Steps
2. Scaling Numerical Data
3. Models in Scikit Learn

bookSimpleImputer

We figured out the identification of missing values. Time now to find out what to do with them and how.

SimpleImputer - it is a class from the scikit-learn library, and which is used to work with the missing values.

SimpleImputer(). This method replaces the missing values with more logical values. It has such main arguments, let's look at them.

  • missing_values - a way to represent missing values, by default is NaN, but as we have already said, it can be for example 0.
  • strategy - here we indicate which values we will replace with. It can be mean(default), median, most_frequent and constant.
  • fill_value - a constant value, with which we will replace the missing values, if we chose strategy = constant.

We learn fit() and transform() functions a little more later.

Завдання

Let's try to fill the empty space in your small dataset.To use SimpleImputer you have to implement the next steps:

  1. Import the class.
  2. Create an instance of the class (imputer object).
  3. Specify the parameters you need, especially: we see that here the missing values are represented by NaN, so replace them with the constant value 15.
  4. Fit the imputer on your data using fit() function
  5. Impute all missing values in you data using transform() function.

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 1. Розділ 2
toggle bottom row

bookSimpleImputer

We figured out the identification of missing values. Time now to find out what to do with them and how.

SimpleImputer - it is a class from the scikit-learn library, and which is used to work with the missing values.

SimpleImputer(). This method replaces the missing values with more logical values. It has such main arguments, let's look at them.

  • missing_values - a way to represent missing values, by default is NaN, but as we have already said, it can be for example 0.
  • strategy - here we indicate which values we will replace with. It can be mean(default), median, most_frequent and constant.
  • fill_value - a constant value, with which we will replace the missing values, if we chose strategy = constant.

We learn fit() and transform() functions a little more later.

Завдання

Let's try to fill the empty space in your small dataset.To use SimpleImputer you have to implement the next steps:

  1. Import the class.
  2. Create an instance of the class (imputer object).
  3. Specify the parameters you need, especially: we see that here the missing values are represented by NaN, so replace them with the constant value 15.
  4. Fit the imputer on your data using fit() function
  5. Impute all missing values in you data using transform() function.

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 1. Розділ 2
toggle bottom row

bookSimpleImputer

We figured out the identification of missing values. Time now to find out what to do with them and how.

SimpleImputer - it is a class from the scikit-learn library, and which is used to work with the missing values.

SimpleImputer(). This method replaces the missing values with more logical values. It has such main arguments, let's look at them.

  • missing_values - a way to represent missing values, by default is NaN, but as we have already said, it can be for example 0.
  • strategy - here we indicate which values we will replace with. It can be mean(default), median, most_frequent and constant.
  • fill_value - a constant value, with which we will replace the missing values, if we chose strategy = constant.

We learn fit() and transform() functions a little more later.

Завдання

Let's try to fill the empty space in your small dataset.To use SimpleImputer you have to implement the next steps:

  1. Import the class.
  2. Create an instance of the class (imputer object).
  3. Specify the parameters you need, especially: we see that here the missing values are represented by NaN, so replace them with the constant value 15.
  4. Fit the imputer on your data using fit() function
  5. Impute all missing values in you data using transform() function.

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

We figured out the identification of missing values. Time now to find out what to do with them and how.

SimpleImputer - it is a class from the scikit-learn library, and which is used to work with the missing values.

SimpleImputer(). This method replaces the missing values with more logical values. It has such main arguments, let's look at them.

  • missing_values - a way to represent missing values, by default is NaN, but as we have already said, it can be for example 0.
  • strategy - here we indicate which values we will replace with. It can be mean(default), median, most_frequent and constant.
  • fill_value - a constant value, with which we will replace the missing values, if we chose strategy = constant.

We learn fit() and transform() functions a little more later.

Завдання

Let's try to fill the empty space in your small dataset.To use SimpleImputer you have to implement the next steps:

  1. Import the class.
  2. Create an instance of the class (imputer object).
  3. Specify the parameters you need, especially: we see that here the missing values are represented by NaN, so replace them with the constant value 15.
  4. Fit the imputer on your data using fit() function
  5. Impute all missing values in you data using transform() function.

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Секція 1. Розділ 2
Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
some-alt