Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Scikit-learn for PCA | Model Building
Principal Component Analysis
course content

Conteúdo do Curso

Principal Component Analysis

Principal Component Analysis

1. What is Principal Component Analysis
2. Basic Concepts of PCA
3. Model Building
4. Results Analysis

bookScikit-learn for PCA

We figured out the implementation of the PCA algorithm using the numpy library. Scikit-learn can let us start using this method with just one line of code:

PCA is a scikit-learn library class. It contains more than 5 arguments, but we are most interested in only one - n_components. This argument is responsible for the number of main components that we want to get. The only condition is that the number of components must, of course, be equal to or less than the variables in the dataset. The PCA class contains 2 main methods that we will use: fit and transform. The fit() method loads the data into the class, and the transform() method transforms it, and we get the result of the PCA algorithm. If we want to combine these 2 operations, use the fit_transform() method:

If we want to get the components that the algorithm has calculated, call the .components_ attribute:

Tarefa

Import the PCA class from the scikit-learn library and create a PCA model for the iris dataset with 2 components.

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 3. Capítulo 1
toggle bottom row

bookScikit-learn for PCA

We figured out the implementation of the PCA algorithm using the numpy library. Scikit-learn can let us start using this method with just one line of code:

PCA is a scikit-learn library class. It contains more than 5 arguments, but we are most interested in only one - n_components. This argument is responsible for the number of main components that we want to get. The only condition is that the number of components must, of course, be equal to or less than the variables in the dataset. The PCA class contains 2 main methods that we will use: fit and transform. The fit() method loads the data into the class, and the transform() method transforms it, and we get the result of the PCA algorithm. If we want to combine these 2 operations, use the fit_transform() method:

If we want to get the components that the algorithm has calculated, call the .components_ attribute:

Tarefa

Import the PCA class from the scikit-learn library and create a PCA model for the iris dataset with 2 components.

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 3. Capítulo 1
toggle bottom row

bookScikit-learn for PCA

We figured out the implementation of the PCA algorithm using the numpy library. Scikit-learn can let us start using this method with just one line of code:

PCA is a scikit-learn library class. It contains more than 5 arguments, but we are most interested in only one - n_components. This argument is responsible for the number of main components that we want to get. The only condition is that the number of components must, of course, be equal to or less than the variables in the dataset. The PCA class contains 2 main methods that we will use: fit and transform. The fit() method loads the data into the class, and the transform() method transforms it, and we get the result of the PCA algorithm. If we want to combine these 2 operations, use the fit_transform() method:

If we want to get the components that the algorithm has calculated, call the .components_ attribute:

Tarefa

Import the PCA class from the scikit-learn library and create a PCA model for the iris dataset with 2 components.

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

We figured out the implementation of the PCA algorithm using the numpy library. Scikit-learn can let us start using this method with just one line of code:

PCA is a scikit-learn library class. It contains more than 5 arguments, but we are most interested in only one - n_components. This argument is responsible for the number of main components that we want to get. The only condition is that the number of components must, of course, be equal to or less than the variables in the dataset. The PCA class contains 2 main methods that we will use: fit and transform. The fit() method loads the data into the class, and the transform() method transforms it, and we get the result of the PCA algorithm. If we want to combine these 2 operations, use the fit_transform() method:

If we want to get the components that the algorithm has calculated, call the .components_ attribute:

Tarefa

Import the PCA class from the scikit-learn library and create a PCA model for the iris dataset with 2 components.

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Seção 3. Capítulo 1
Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
some-alt