Coder Social home page Coder Social logo

gridsearch-helper's Introduction

gridsearch-helper

A simple tool to facilitate use of Scikit-Learn's GridSearchCV across multiple models.

SciKit learn's GridSearchCV is an excellent tool for hyperparameter search, but can only be used with model at a time. Additionally, the dictionary syntax used by the object may be difficult for beginner programmers to understand. This tool is meant to facillitate model and parameter searching. Users can edit a human-readable config file instead of programmatically assembling parameter dictionaries.

Installation

Requires:

  • sklearn
  • pandas
  • numpy
  • pyyaml

Detailed install instructions may be added at a later date.

Usage

Data formatting

You must prepare two files for data input, X and y. Each must be a comma seperated file. X is expected to be a sample x feature matrix with sample rows and feature columns. Column names will be ignored. Every column of X is expected to be a feature; X must not contain an index or sample labels. y is expected to be a sample x label matrix or vector. y may contain several columns; each column will be treated as a new target against which to train models with X. X and y are expected to be the same number of samples and ordered such that row (i) in X corresponds to row (i) in y.

Running

Simply run: python run.py -X path_to_X.csv -y path_to_y.csv -cv [int] -o path_to_output.csv

Arguments:

  • X : Path to the X data csv file.
  • y: Path to the y data csv file.
  • cv: Number of folds to be perfomed in cross validation.
  • o: Path to the output result file.

Config

To adjust which models will be used, edit the config.yml file. Write true or false next to each model to indicate whether to use the model in grid search.

Parameters for each model are found in the params section of the config file. To add new params to be searched, append to the list. For example, to test Random Forest Classifiers using both Gini impurity or entropy as the decision metric, scroll to the RF section of params and write:

criterion:
 - gini
 - entropy

Consult the Sci Kit Learn documentation for each model to identify which parameter values are possible.

gridsearch-helper's People

Contributors

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