Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Досліджуємо набір даних | Побудова моделі
Метод Головних Компонент
course content

Зміст курсу

Метод Головних Компонент

Метод Головних Компонент

1. Що таке аналіз головних компонент
2. Основні поняття РСА
3. Побудова моделі
4. Аналіз результатів

book
Досліджуємо набір даних

Now we will take a closer look at the creation of a PCA model using the example of one dataset. As a dataset, we will use wine from the scikit-learn set. It contains 13 wine characteristics and 3 classes. It is especially convenient for us because there are no categorical variables in it.

Let's load the dataset:

python

Now let's explore the dataset to understand what data we are working with. Let's convert the numpy array X to a pandas dataframe and check the amount of missing data:

python

To get a complete description of each column (mean, standard deviation, etc.), use the .describe() method:

python

Before loading the dataset into the PCA model, let's process our data. Based on the previous lessons, you may have noticed that an important step is data standardization. We implement this using the StandardScaler() class:

python
Завдання

Swipe to start coding

Read the data from the train.csv (from web) file. Remove the "Id" column from the dataset and standardize it.

Рішення

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

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

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

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

book
Досліджуємо набір даних

Now we will take a closer look at the creation of a PCA model using the example of one dataset. As a dataset, we will use wine from the scikit-learn set. It contains 13 wine characteristics and 3 classes. It is especially convenient for us because there are no categorical variables in it.

Let's load the dataset:

python

Now let's explore the dataset to understand what data we are working with. Let's convert the numpy array X to a pandas dataframe and check the amount of missing data:

python

To get a complete description of each column (mean, standard deviation, etc.), use the .describe() method:

python

Before loading the dataset into the PCA model, let's process our data. Based on the previous lessons, you may have noticed that an important step is data standardization. We implement this using the StandardScaler() class:

python
Завдання

Swipe to start coding

Read the data from the train.csv (from web) file. Remove the "Id" column from the dataset and standardize it.

Рішення

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

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

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

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