Giter Club home page Giter Club logo

bayesian-rf-knime-scikit's Introduction

bayesian-rf-knime-scikit

Bayesian Optimization of RandomForest parameters, with scikit-learn, to be used in KNIME in Python learner node. Based on https://github.com/fmfn/BayesianOptimization/ by fmfn.

Prerequisities:

  • pip install bayesian-optimization

Why?

  1. Parameter Optimization Loop Node(s) doesn't work as expected for some data. Including Bayesian optimization.
  2. You may want to use scikit-learn instead of KNIME or Weka implementation.
  3. You can tune this workflow to optimize other parameters for many different scikit algorithms.

Setup

  • In python node please select python2.
  • copy&paste the python code into the code window of Python Learner (python-learner.py) and Python Predictor (python-predictor.py)
  • sample workflow:

  • in the input table, the class should be in the last column
  • fine tuning - edit variables at the top of the python-learner.py:
#
# Bounded region of parameter space
#

parameterDict = { 'n_estimators': (100, 1200),
            'max_depth': (5, 30),
            'min_samples_split': (2, 100),
            'min_samples_leaf': (1, 10)
            }

#
# bayesian configuration
#

init_points = 5
n_iter = 20
  • please note: scripts (after slight modifications) can be run from the command line
  • sample data file provided (nr-ahr-lite.csv from my tox21 dataset)

Standard output

Among some training progress data (static) info about best parameters found is displayed:

Best params: {'min_samples_split': 2, 'n_estimators': 205, 'max_depth': 30, 'min_samples_leaf': 1}
Best target value: 0.837006427916

ROC output (ROC curve node)

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.