GithubHelp home page GithubHelp logo

robertneat / attribute_extraction Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.25 MB

Attribute extraction and generation, PCA (Principal Component Analysis) and ICA (Independent Component Analysis).

License: MIT License

Python 100.00%

attribute_extraction's Introduction

Model Analysis and Feature Extraction (digits dataset)

This repository contains code for feature extraction and classification using PCA (Principal Component Analysis) and ICA (Independent Component Analysis). The dataset used here is the handwritten digits dataset from the sklearn.datasets library.

Code Overview

The code provided demonstrates the process of:

  • Loading the dataset and splitting it into training and test sets.
  • Utilizing PCA to extract principal components, retaining 95% variance.
  • Employing kNN (k-Nearest Neighbors) classifier after feature extraction using PCA.
  • Implementing a Pipeline to streamline the process of feature extraction, scaling, and classification with PCA and kNN.
  • Using ICA (Independent Component Analysis) for feature extraction and kNN classification within a Pipeline.

Feature Extraction using PCA (Principal Component Analysis)

Principal Component Analysis is performed to extract essential features while retaining 95% variance from the dataset. The cumulative explained variance plot indicates the number of principal components necessary to retain this variance.

Results from PCA

  • Number of Principal Components for 95% variance: 28
  • Accuracy score achieved: 97.22%

Utilizing Pipeline for Feature Extraction and Classification

A Pipeline is constructed to automate the process, including PCA for feature extraction, scaling, and kNN for classification. The results achieved using this pipeline mirror those obtained directly with PCA.

Results from Pipeline

  • Accuracy score achieved: 97.22%

Feature Extraction using ICA (Independent Component Analysis)

Independent Component Analysis with 20 independent components is applied for feature extraction. This transformed dataset is then classified using kNN.

Results from ICA

  • Accuracy score achieved: 97.78%

Conclusion

Both PCA and ICA are effective methods for feature extraction, enabling dimensionality reduction while retaining crucial information for classification. In this specific scenario, PCA and ICA, followed by kNN classification, produced comparable and high accuracy scores, showcasing their utility in preprocessing and classification tasks.

Launching Project

To run the project, you have a couple of options:

Using Google Colab via Gist

Access the project through Google Colab using the Gist website. You can import the necessary data from the GitHub project resources. Use the following Gist link: gist link here

Running Locally

If you prefer to run the project on your local machine, follow these steps:

  1. Clone the Repository: Download the repository branch from GitHub.
  2. Local Environment:
    • DataSpell or PyCharm: Open the project using DataSpell or PyCharm by JetBrains.
    • Spyder IDE: Alternatively, you can use Spyder IDE to work with the project.
  3. Dataset Requirements:
    • Ensure that the dataset files are available and stored inside your project directory. This step is crucial to prevent any issues related to missing data.

Running the project locally allows you to explore the code and execute it in your preferred Python environment. If you encounter any problems, make sure to check the dataset's presence in your project directory.

attribute_extraction's People

Contributors

robertneat avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.