Code Monkey home page Code Monkey logo

hyperbox-classifier's Introduction

Hyperbox-classifier

Implementation of classifiers based on hyper-box representation

Before running the python files in this project, we need to install packages first as follows:

Open command line in Windows and navigate to the Hyperbox-classifier folder, and then type the following command:

python setup.py install

Instruction of executing the online version of GFMM (file: onlinegfmm.py):

python onlinegfmm.py arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9 arg10

INPUT parameters from command line:

arg1:  + 1 - training and testing datasets are located in separated files
       + 2 - training and testing datasets are located in the same files
arg2:  path to file containing the training dataset (arg1 = 1) or both training and testing datasets (arg1 = 2)
arg3:  + path to file containing the testing dataset (arg1 = 1)
       + percentage of the training dataset in the input file
arg4:  + True: drawing hyperboxes during the training process
       + False: no drawing
arg5:  Maximum size of hyperboxes (teta, default: 1)
arg6:  The minimum value of maximum size of hyperboxes (teta_min: default = teta)
arg7:  gamma value (default: 1)
arg8:  Operation used to compute membership value: 'min' or 'prod' (default: 'min')
arg9:  Do normalization of datasets or not? True: Normilize, False: No normalize (default: True)
arg10: range of input values after normalization (default: [0, 1])

Note: parameters with string datatype should be put between quotation marks (" ")

Example:

python onlinegfmm.py 1 synthetic_train.dat synthetic_test.dat True 0.6 0.5 1 min True "[0, 1]"

alt text

If using Spyder to run the source code, let's configure Spyder as follows:

From Run/Configuration per file or press Ctr+F6, on the open window, select onlinegfmm.py in the field Select a run configuration check on Command line options and input the input parameters such as: 1 synthetic_train.dat synthetic_test.dat True 0.6 0.5 1 min True "[0, 1]".

To the drawing display on the separated window (not inline mode as default), from Tools choose Preferences, and then select IPython console, in tab Graphics let change the value of the field backends to Qt5 or Qt4, choose OK. Finally, restart Spyder to update the changes.

Instruction of executing the batch learning versions of GFMM (files: accelbatchgfmm.py, batchgfmm_v1.py, batchgfmm_v2.py):
Full batch learning:

python batchgfmm_v2.py arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9 arg10 arg11 arg12

Faster version of full batch learning:

python batchgfmm_v1.py arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9 arg10 arg11 arg12

Improved version of batch learning - AGGLO2 :

python accelbatchgfmm.py arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9 arg10 arg11 arg12

INPUT parameters from command line:

arg1:  + 1 - training and testing datasets are located in separated files
       + 2 - training and testing datasets are located in the same files
arg2:  path to file containing the training dataset (arg1 = 1) or both training and testing datasets (arg1 = 2)
arg3:  + path to file containing the testing dataset (arg1 = 1)
       + percentage of the training dataset in the input file
arg4:  + True: drawing hyperboxes during the training process
       + False: no drawing
arg5:  Maximum size of hyperboxes (teta, default: 1)
arg6:  gamma value (default: 1)
arg7:  Similarity threshod (default: 0.5)
arg8:  Similarity measure: 'short', 'long' or 'mid' (default: 'mid')
arg9:  operation used to compute membership value: 'min' or 'prod' (default: 'min')
arg10: do normalization of datasets or not? True: Normilize, False: No normalize (default: True)
arg11: range of input values after normalization (default: [0, 1])   
arg12: Use 'min' or 'max' (default) memberhsip in case of assymetric similarity measure (simil='mid')

For instance:

Full batch learning:

python batchgfmm_v2.py 1 synthetic_train.dat synthetic_test.dat True 0.6 1 0.5 short min True "[0, 1]"

alt text

Improved version of batch learning - AGGLO2:

python accelbatchgfmm.py 1 synthetic_train.dat synthetic_test.dat True 0.6 1 0.5 mid min True "[0, 1]"

alt text

hyperbox-classifier's People

Contributors

thanhtung09t2 avatar

Watchers

 avatar

hyperbox-classifier's Issues

Need to update drawbox function

Currently, the drawbox function has not yet removed the previous hyperboxes from the figure when performing the hyperbox expansion and contraction processes.

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.