Code Monkey home page Code Monkey logo

follower-gender-classification's Introduction

Follower Gender Classifier

๐Ÿก
Know the gender of your followers!
A quick hack to support my short text classification thesis. This code serves as a quick demo and is NOT maintained!

Introduction

screenshot1

Goal

The goal of this code demo is to predict gender of social media users based on comments section on Instagram profile by using AdaBoost, XGBoost, Support Vector Machine, and Naive Bayes Classifier combined with a grid search and K- Fold validation.

How many are males vs females?

We collect comments against followers' Instagram picture media posts and format them as bag-of-words along with other pre-processing.

Data Labelling

To label the data that was used to train the model, we use Azure FaceAPI to filter pictures where there's only one person and is able to detect their gender.

Overview

The code demo consists of several parts:

  • The frontend built with socketio, flask, html & javascript,
  • and 4 different implementations of classifier algorithm: xgboost, support vector machine, naive bayes, and adaboost.

adab/

Implementing AdaBoost using sklearn library.

app.py

Main entrypoint for the Flask application (this project).

data/

Data dump(s) or saved pickle files (cache, models, etc.).

screenshots/

Screenshots.

naive_bayes/

Implementing naive bayes algorithm using nltk library.

svm

Implementing Support Vector Machine algorithm using sklearn library.

thirdparty/

Third-party related library supporting this project.

xgb

Implementing eXtreme gradient boosting algorithm using xgboost library.

Getting Started

The config is simply loaded by app.py via decouple package, keeping things simple.

Run cp .env.example .env and fill the necessary variables.

Docker

docker run --env-file=.env -p 9000:9000 williamchanrico/follower-gender-classification:v0.1.0

Manual

Assuming you have virtualenv and python3-pip installed:

  • virtualenv venv && source venv/bin/activate
  • pip3 install -r requirements.txt
  • python -m nltk.downloader punkt
  • Optionally, you may need libgomp1 depending on your operating system (required by xgboost)
python3 app.py

Python Version

$ python --version
Python 3.7.1

License

GNU General Public License v3.0

follower-gender-classification's People

Contributors

dependabot[bot] avatar williamchanrico avatar

Stargazers

 avatar  avatar  avatar  avatar  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.