Skip to content

This project is a demo that applies PCA (Principal Component Analysis) analysis on the Iris dataset using Python and the Scikit-learn library. PCA is utilized to reduce high-dimensional data to lower dimensions.

License

Notifications You must be signed in to change notification settings

Prometheussx/Iris-Data-PCA-Exploration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Iris-Data-PCA-Exploration

dataset-cover

This project is a demo that applies PCA (Principal Component Analysis) analysis on the Iris dataset using Python and the Scikit-learn library. PCA is utilized to reduce high-dimensional data to lower dimensions.

Using Iris Dataset and PCA

In this project, Principal Component Analysis (PCA) analysis was applied on Iris dataset using Python and Scikit-learn library. PCA is a technique used to reduce a multidimensional dataset to fewer dimensions and preserve the underlying variance of the data. The project consists of taking the data set, performing PCA analysis and visualizing the results with a graph.

Project Content

  • iris_pca.py: Python code implementing PCA analysis.
  • README.md: This file containing information about the project.

Requirements

The following requirements are needed for this code to work:

  • Python 3.x
  • Scikit-learn
  • Pandas
  • Matplotlib

You can use the following commands to install the necessary libraries:

pip install scikit-learn
pip install pandas
pip install matplotlib

Data Set

This project was realized using the Iris dataset. Iris dataset is a dataset containing the characteristics of flower species. This dataset is predefined within the Scikit-learn library and therefore no external source is needed to pull the dataset.

Project Phases

The project consists of the following steps:

  1. Iris dataset is extracted.
  2. PCA analysis is applied and the dataset is reduced from 4 dimensions to 2 dimensions.
  3. The results are visualized on a graph.

How to Use

You can follow the steps below to use the project:

  1. Clone the project to your computer:
git clone https://github.com/Prometheussx/Iris-Data-PCA-Exploration.git
  1. Go to the project folder:
cd Iris-Data-PCA-Exploration
  1. Run the code:
python PCA.py
  1. Examine the graph on the screen to see the results.
  • Shows the variance explained by each component. The first component explains 92.46%, and the second component explains 5.30% of the variance.
print("Variance ratio:", pca.explained_variance_ratio_)  
  • Indicates that 97.76% of the variance is preserved, implying a successful PCA with a 2.24% data loss.
print("Sum:", sum(pca.explained_variance_ratio_))  

image

image

Contact Information

For any questions, feedback or requests to contribute to the project, you can contact the contact information below:

Problems and Requests

You can report any issues or request new features using the Issues section of the project on GitHub. Try to be as detailed as possible when describing issues and requests.

Contributing

For any bug reports or requests to contribute to the project, please contact GitHub.

License

This project is licensed under the MIT license. For more information, see LICENSE.

About

This project is a demo that applies PCA (Principal Component Analysis) analysis on the Iris dataset using Python and the Scikit-learn library. PCA is utilized to reduce high-dimensional data to lower dimensions.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages