{"id":34606721,"url":"https://github.com/bcdev/fuzzy-decision-tree","last_synced_at":"2026-05-29T19:31:04.521Z","repository":{"id":101824092,"uuid":"128076987","full_name":"bcdev/fuzzy-decision-tree","owner":"bcdev","description":"A Java decision tree implementation which uses fuzzy membership functions","archived":false,"fork":false,"pushed_at":"2018-04-23T19:08:17.000Z","size":3026,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-09T14:15:28.808Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bcdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-04-04T14:48:25.000Z","updated_at":"2023-04-26T13:55:30.000Z","dependencies_parsed_at":"2023-06-19T05:36:18.086Z","dependency_job_id":null,"html_url":"https://github.com/bcdev/fuzzy-decision-tree","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bcdev/fuzzy-decision-tree","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcdev%2Ffuzzy-decision-tree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcdev%2Ffuzzy-decision-tree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcdev%2Ffuzzy-decision-tree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcdev%2Ffuzzy-decision-tree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bcdev","download_url":"https://codeload.github.com/bcdev/fuzzy-decision-tree/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bcdev%2Ffuzzy-decision-tree/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33668185,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-24T13:56:51.414Z","updated_at":"2026-05-29T19:31:04.515Z","avatar_url":"https://github.com/bcdev.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fuzzy-decision-tree\nA Java decision tree implementation which uses fuzzy membership functions. \n\nFind a Python implementation [here](https://github.com/forman/dectree).\n\n## Command-line Usage\n\nGenerate Java code from decision tree YAML file:\n\n```bash\n    $ java -jar fuzzy-decision-tree \u003cyaml-file\u003e\n```\n\n## Programmatic Usage\n\nLoad a function object from from decision tree YAML file and execute it:\n\n```java\n    import com.bc.dectree.DecTreeDoc;\n    import com.bc.dectree.DecTreeFunction;\n    \n    // Load decision tree function\n    //\n    DecTreeDoc doc = DecTreeDoc.parse(yamlFile);    \n    DecTreeFunction function = DecTreeFunction.load(doc);\n    \n    // Call decision tree function\n    //\n    double inputs[] = new double[function.getInputSize()];\n    // Set inputs...\n    double outputs[] = new double[function.getOutputSize()];\n    function.apply(inputs, outputs);\n```\n\n## YAML Format\n\n### Example\n\nHere is a somwehat numb but illuminating RGB-image classification (result is [here](https://github.com/forman/dectree/blob/master/examples/im_classif/im_classif.ipynb)):\n\n```yaml\n\n    types:\n      radiance:\n        LOW:       inv_ramp(x1=0, x2=127)\n        MIDDLE:    triangular(x1=0, x2=127, x3=255)\n        HIGH:      ramp(x1=127, x2=255)\n        VERY_HIGH: ramp(x1=180, x2=220)\n    \n    inputs:\n      red:   radiance\n      green: radiance\n      blue:  radiance\n    \n    derived:\n      mean = (red + green + blue) / 3: radiance\n    \n    outputs:\n      grey:     boolean\n      yellow:   boolean\n      dark_red: boolean\n      dark:     boolean\n      not_dark: boolean\n      cloudy:   boolean\n      mean:     radiance\n    \n    rules:\n      - if mean is VERY_HIGH:\n          cloudy: TRUE\n    \n      - if red is VERY_HIGH and green is VERY_HIGH and blue is VERY_HIGH:\n          cloudy: TRUE\n    \n      - if red is MIDDLE and green is MIDDLE and blue is MIDDLE:\n          grey: TRUE\n    \n      - if red is HIGH and green is HIGH or red is MIDDLE and green is MIDDLE:\n          if blue is LOW:\n            yellow: TRUE\n    \n      - if red is MIDDLE or red is LOW and green is MIDDLE or green is LOW:\n          if blue is not LOW and blue is not MIDDLE and blue is not HIGH:\n            dark_red: TRUE\n    \n      - if red is LOW and green is LOW and blue is LOW:\n          dark: TRUE\n        else:\n          not_dark: TRUE\n\n```\n\n### Syntax\n\n*yaml-file* ::=\n\n\u0026nbsp;\u0026nbsp;`name` `:` *dectree-name*\\\n\\\n\u0026nbsp;\u0026nbsp;`version` `:` *dectree-model-version*     (optional, default is `\"1.0\"`)\\\n\\\n\u0026nbsp;\u0026nbsp;`types` `:`\\\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;*type* `:`\\\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;*property* `:` *membership-function*\\\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;*property* `:` *membership-function*\\\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;...\\\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;...\\\n\\\n\u0026nbsp;\u0026nbsp;`inputs` `:`\\\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;*input* `:` *type* | `number` | `boolean`\\\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;*input* `:` *type* | `number` | `boolean`\\\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;...\\\n\\\n\u0026nbsp;\u0026nbsp;`derived` `:`\\\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;*derived* `=` *expression* `:` *type* | `number` | `boolean`\\\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;*derived* `=` *expression* `:` *type* | `number` | `boolean`\\\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;...\\\n\\\n\u0026nbsp;\u0026nbsp;`outputs` `:`\\\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;*output* `:` *type* | `number` | `boolean`\\\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;*output* `:` *type* | `number` | `boolean`\\\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;...\\\n\\\n\u0026nbsp;\u0026nbsp;`rules` `:`\\\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;`-` *rule*\\\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;`-` *rule*\\\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;...\n\n\n\nwhere\n\n*rule* ::=\\\n\u0026nbsp;\u0026nbsp;`if` *condition*`:`\\\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;*block*\\\n\u0026nbsp;\u0026nbsp;`else` `if` *condition*`:`    (optional)\\\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;*block*\\\n\u0026nbsp;\u0026nbsp;`else` `if` *condition*`:`    (optional)\\\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;*block*\\\n\u0026nbsp;\u0026nbsp;...\\\n\u0026nbsp;\u0026nbsp;`else` `:`                    (optional)\\\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;*block*\n\n*block* ::=\\\n\u0026nbsp;\u0026nbsp;*statement*\\\n\u0026nbsp;\u0026nbsp;*statement*\\\n\u0026nbsp;\u0026nbsp;...\n\n*statement* ::= *rule* | *assignment*\n\n*assignment* ::= *output*`:` `TRUE` | `FALSE`\n\n*condition* ::=  `(` *condition* `)` \n | *variable* `is` *property* | *variable* `is` `not` *property* \n | `not` *condition*\n | *condition* `and` *condition*\n | *condition* `or` *condition*\n \n*variable* ::=  *input* | *derived* | *output*\n\n*dectree-name* ::= *fully-qualified-java-class-name*\n\n*dectree-model-version* ::= [SemVer](https://semver.org/)-compliant version string\n\n*type*      ::= *java-identifier* \n\n*property*  ::= *java-identifier*\n\n*input*     ::= *java-identifier*\n\n*derived*   ::= *java-identifier*\n\n*output*    ::= *java-identifier*\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcdev%2Ffuzzy-decision-tree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbcdev%2Ffuzzy-decision-tree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcdev%2Ffuzzy-decision-tree/lists"}