Git Product home page Git Product logo

boosting-exact-pattern-matching's Introduction

Boosting exact pattern matching with eXtreme Gradient Boosting (and more)

About

This repository contains datasets and source code for the paper "Boosting exact pattern matching with eXtreme Gradient Boosting (and more)".

Contents

The experiment consists of two parts.

  1. The first part consists of measuring the times of exact pattern matching algorithms to create a dataset for machine learning.

    • ๐Ÿ“ smart - contains the source code for exact pattern matching, which is mostly taken from SMART tool (Nov 7 2018, 3b112e362b6ff9e3336b406cc8618164da91ef23).
    • ๐Ÿ“ data - contains datasets and patterns excluding datasets that must be downloaded from Pizza&Chilli corpus (the tests were performed on 50MB texts).
    • ๐Ÿ“„ run_tests.py - executes exact pattern matching algorithms and saves the results to dataset-raw.pickle
    • ๐Ÿ“„ utils.py - contains helper functions
    • ๐Ÿ“„ dataset-raw.pickle - contains raw datasets with pattern searching times for all algorithms
  2. The second part is to prepare the dataset for machine learning and train machine learning models whose task is to predict the fastest algorithm for a given pattern.

    • ๐Ÿ“„ start_pred.py - runs the tests (trainings and predictions)
    • ๐Ÿ“„ datautils.py - contains helper functions to process the data
    • ๐Ÿ“„ dataset-full.pickle - processed dataset, prepared for machine learning
    • ๐Ÿ“” dataset-full-notebook.ipynb - jupyter notebook with results of exact pattern matching algorithms
    • ๐Ÿ“„ train_datasets.pickle - train dataset
    • ๐Ÿ“„ test_datasets.pickle - test dataset
    • ๐Ÿ“„ trained_models.pickle - contains trained models (make sure to have the same version of scikit-learn to load them, otherwise it will not be possible)
    • ๐Ÿ“” results-notebook.ipynb - jupyter notebook with results of machine learning models

Note: *.pickle files are not included in the repository. They can be downloaded from:

Note 2: The text corpus is also not included in the repository. It can be downloaded from Pizza&Chilli (the tests were performed on 50MB texts) and then placed in the data directory.

Requirements

  • Python 3.10.10 (other versions may work, but they were not tested)
  • All required packages are listed in requirements.txt file.

To reproduce the results

  1. Clone the repository

    git clone https://github.com/rsusik/boosting-exact-pattern-matching.git
  2. Install required packages by running

    pip install -r requirements.txt
  3. Download the *.pickle files from the links above and place them in the root directory of the repository.

  4. Run start_pred.py script.

The results may differ in prediction times slightly due to the hardware differences, but the impact on the overall results should be negligible.

To create the dataset from scratch

Perform step 1 and 2 from the previous section and then:

  1. Download the text corpus from Pizza&Chilli (the tests were performed on 50MB texts) and place it in the data directory.

  2. Execute searching algorithms to create the dataset:

    cd smart
    python compile.py
    cd ..
    python run_tests.py

Running the searching algorithms may take a long time and lead to slightly different results due to the hardware differences.

Authors

  • Robert Susik
  • Szymon Grabowski

boosting-exact-pattern-matching's People

Contributors

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