Giter Club home page Giter Club logo

fuzzy-lite's Introduction

fuzzy-lite

Lightweight and simple fuzzy logic system implementation

Features

  • scikit-fuzzy like API
  • Custom operators in production system
  • Access to all intermediate system outputs

Quick start

import numpy as np
import fuzzylite as fuzzy

quality = fuzzy.FuzzyVariable(np.arange(0, 10 + 1, 1), 'quality')
quality['poor']    = fuzzy.trimf(quality.universe, [0,  0,  5])
quality['average'] = fuzzy.trimf(quality.universe, [0,  5, 10])
quality['good']    = fuzzy.trimf(quality.universe, [5, 10, 10])

service = fuzzy.FuzzyVariable(np.arange(0, 10 + 1, 1), 'service')
service['poor']    = fuzzy.trimf(quality.universe, [0,  0,  5])
service['average'] = fuzzy.trimf(quality.universe, [0,  5, 10])
service['good']    = fuzzy.trimf(quality.universe, [5, 10, 10])

tip = fuzzy.FuzzyVariable(np.arange(0, 25 + 1, 1), 'tip')
tip['low']    = fuzzy.trimf(tip.universe, [0,   0, 13])
tip['medium'] = fuzzy.trimf(tip.universe, [0,  13, 25])
tip['high']   = fuzzy.trimf(tip.universe, [13, 25, 25])

rules = [
  fuzzy.Rule([quality['poor'], service['poor']], tip['low']),
  fuzzy.Rule([service['average']], tip['medium']),
  fuzzy.Rule([service['good'], quality['good']], tip['high'])
]

system = fuzzy.FuzzySystem(rules)
system.input = { 'quality': 6.5, 'service': 9.8 }
system.produce()
print(system.output)

Requirements

fuzzy-lite depends from NumPy package

fuzzy-lite's People

Contributors

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