Giter VIP home page Giter VIP logo

svm-classification's Introduction

DOI

The package includes the following files:

-data_extraction.py: The data extraction script extracts the relevant data from the corpus and creates a CSV corpus.csv to store the data in a format that can be used by the system -SVMClassifier.py: implements the Linear SVC SVM Classifier and returns a list of classified output labels for the test data -corpus.txt: This is the corpus that is used for the project, this file can be stored at any desired path. When the data_extraction.py script is run, the system prompts the user to enter the path of the location where this file is stored) -README.txt

Instructions:

  1. Install the required libraries, the system needs the following import statements to import the required libraries:

import glob import numpy import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from sklearn.preprocessing import LabelBinarizer from sklearn.feature_extraction.text import (CountVectorizer, TfidfTransformer) from sklearn.multiclass import OneVsRestClassifier from sklearn.svm import LinearSVC from sklearn.pipeline import Pipeline from sklearn.cross_validation import KFold from sklearn.metrics import (confusion_matrix, classification_report, accuracy_score) from sklearn.calibration import (calibration_curve, CalibratedClassifierCV)

  1. Save the corpus.txt file on disk

  2. Run the data_extraction.py script and provide the required input (i.e. file path to the corpus.txt)

  3. Run the SVMClassifier.py script and provide the required input

  4. A heatmap of the confusion matrix (percentage), accuracy score and classification report are printed

svm-classification's People

Contributors

jarmel07 avatar

Watchers

James Cloos 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.