Code Monkey home page Code Monkey logo

kaggle-lshtc's Introduction

Code for Large Scale Hierarchical Text Classification competition.

http://www.kaggle.com/c/lshtc

Summary

a centroid-based flat classifier.

Prediction

  1. Selecting k-class from near the query with nearest centroid classifier.
  2. Judging with binary classifier whether the query can be accepted to class.

(predict.cpp)

predict1

Selecting k-candidate classes that centroid of class close to the query.

predict2

Selecting classes that binary classifier of class returns p > 0.5. (Implementation of the binary classifier is logistic regression)

predict3

Training

For each data points..

  1. Selecting k-class from near the data point with nearest centroid classifier.
  2. Adding the data point as training data to dataset for each classes.

(prefetch.cpp)

For each classes..

  1. Learning the binary classifier using own dataset.

(train.cpp)

train1 train2

What are the feature

using variant TF-IDF.

tf = log(number_of_term_occurs_in_document + 1)
idf = log(total_number_of_documents / (number_of_documents_containing_term + 1)) + 5
tfidf = tf * idf

and feature vector is normalized by L2 norm. (code: tfidf_transformer.hpp)

What are the metric for Centroid Classifier

using cosine similarity.

Requirements

  • Ubuntu 13.10
  • g++ 4.8.1
  • make
  • 32GB RAM

How to Generate the Solution

please edit SETTINGS.h first.

make
./prefetch
./train
./predict

NOTE: ./prefetch is very slow. probably processing time exceeds 15 hours.

MISC programs

Running the Validation Test

./vt_prefech
./vt_train
./validation

Simple k-NN baseline

running the validation test.

./vt_knn

generating the sumission.txt.

./knn

Simple Nearest Centroid Classifier

running the validation test.

./vt_ncc

generating the sumission.txt.

./ncc

Figure

ModelLBMaFTraining TimePrediction Time
k-NN0.23088n/a10 minutes
NCC0.2893180 seconds2 hours
NCC+BC0.3302515 hours2 hours

kaggle-lshtc's People

Contributors

nagadomi avatar

Watchers

 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.