Giter Site home page Giter Site logo

cnxtech / swblocks-decisiontree Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jpmorganchase/swblocks-decisiontree

0.0 0.0 0.0 314 KB

swblocks-decisiontree library is a high performance, highly flexible service which evaluates inputs to a set of rules to identify one and only one output rule which in term results in a set of outputs

License: Apache License 2.0

Java 100.00%

swblocks-decisiontree's Introduction

License Build Status

swblocks-decisiontree

Overview

swblocks-decisiontree library is a high performance, highly flexible service which evaluates inputs to a set of rules to identify one and only one output rule which in term results in a set of outputs. It can be used to model complex conditional processing within an application.
Example:

Rule Input1: Day of week Input2: Outstanding Work Input3: Boss's mood Output 1: Leave Time Output2: After Work
1 Monday * * 5 pm Pick up children
2 * Low * 6:45 pm Go to gym
3 Thursday * Good 6:30 pm Go to pub
4 Friday * * 5 pm Party time
5 * * * 7 pm Go home
6 * * Angry 10 pm More work

The rules are evaluated based on the precedence of matched data from left to right. A matching value gives a 1 and a wildcard match a 0, the highest value is picked. In this example the employees life after work on certain days takes precedence over the boss. If the following input values are sent in:
Inputs: Day of Week: Monday, Outstanding Work: High, Boss's mood: Angry
This matches rules 1, 5 and 6. Rule 1 gives 100, Rule 5 gives 000 and Rule 6 gives 001, rule 1 is picked.
Output: Leave Time: 5pm, After Work: Pick up children

If the order of the columns are changed to make the Boss's mood higher importance, then this gives.

Rule Input1: Boss's Mode Input2: Outstanding Work Input3: Day of week Output 1: Leave Time Output2: After Work
1 * * Monday 5 pm Pick up children
2 * Low * 6:45 pm Go to gym
3 Good * Thursday 6:30 pm Go to pub
4 * * Friday 5 pm Party time
5 * * * 7 pm Go home
6 Angry * * 10 pm More work


If the same inputs are sent in:
Inputs: Day of Week: Monday, Outstanding Work: High, Boss's mood: Angry
This matches rules 1, 5 and 6. Rule 1 gives 001, Rule 5 gives 000 and Rule 6 gives 100, rule 6 is picked.
Output: Leave Time: 10pm, After Work: More work

### Data Types The Decision Tree supports a number of different types of definitions of data * Strings, the normal type inputs provide an exact match against the input. * Regular Expressions, standard regular expressions match against the input. * Groups, combinations of other all data types, including other groups matching any against the input. * Integer Ranges, matches any integer input within the range, inclusive at the minimum and exclusive at the maximum. * Date Ranges, matches any date within the range.

Structure of code

The code is in a multi-module structure project structure.

Core

The Core project contains the main algorithms for the tree building and construction.

Change

The Change project provides an API to modify a DecisionTree in an audited and controlled manor.

Persistence-json-jackson

A persistence module for writing and reading using a JSON structure and the Jackson JSON code.

Persistence-cassandra

A persistence module for writing and reading using Cassandra as a storage.

Examples

A set of example code to demonstrate usage of the DecisionTree.

License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this library except in compliance with the License. You may obtain a copy of the License at:

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

See the LICENSE file for additional license information

Java Build

The project is built with Gradle using this build.gradle file.

You require the following to build swblocks-decisiontree:

Default target provides a full clean, build, and install into local maven repository

swblocks-decisiontree's People

Contributors

jondey avatar jpmjaw avatar lazar-ivanov avatar logicrunner 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.