Giter Site home page Giter Site logo

liblinear_tool's Introduction

Liblinear tools

What's this ??

Tools for liblinear. For libsvm, there are useful tools. However, they does not fit to liblinear. We need to rewrite them for liblinear. That's very inconvenient. Thus, I opened tools for liblinear.

Tools in this repo.

  • scaling feature value
  • grid searching of hyperparameter C and xi
  • feature selection tuning on F-value

Files You need

  • liblinear: I confirmed at version 1.94
  • svm-scale: svm-scale exists in libsvm package. svm-scale is need to scale feature values

Usage

scaling feature value and grid searching

use ./tools/liblin_easy.py

1: you have to rewrite header to change path for your environment

#you can re-write for your environment 
svmscale_exe='../svm-scale';
liblinear_exe='../liblinear-1.94/train';
grid_py='/home/kensuke-mi/opt/libsvm-3.17/tools/grid.py';
import re, subprocess, os, sys;
#you can re-write for your environment 
sys.path.append('../liblinear-1.94/python/');
import liblinear, liblinearutil;

2: specify path to training file and test file

train_pathname='../heart_scale'
test_pathname='../heart_scale'

3: initialize instance

test01=Liblin_easy(train_pathname,test_pathname)

To scale feature values

test01.scalling_value()

To parameter tuning with grid search. You can tune parameters for other files, if you rewrite argument of this method.

test01.grid_search(train_pathname)

If you use easy_tuning(), it automatically do scaling and grid search on training file

test01.easy_tuning()

Acknowledgement

I really thank to team member of liblinear and libsvm

liblinear_tool's People

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.