Name | casebased JSON |
Version |
0.1.6
JSON |
| download |
home_page | None |
Summary | CaseBased is a python library that implements the priciples of case-based reasoning. |
upload_time | 2025-02-17 15:30:41 |
maintainer | None |
docs_url | None |
author | Jonas Liendl |
requires_python | <4.0,>=3.9 |
license | The MIT License (MIT)
Copyright (c) 2024 casebased
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
cbr
case-based reasoning
ml
machine learning
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
<div align="left">
[](https://pypi.org/project/casebased/)
[](https://github.com/Case-Based/casebased/pulls?utf8=%E2%9C%93&q=is%3Apr%20author%3Aapp%2Fdependabot)
[](https://github.com/psf/black)
[](https://github.com/PyCQA/bandit)
[](https://github.com/Case-Based/casebased/blob/main/.pre-commit-config.yaml)
[](https://github.com/Case-Based/casebased/releases)
[](https://github.com/Case-Based/casebased/blob/master/LICENSE)

---
### [π Our Paper on CBR](https://github.com/user-attachments/files/16977337/SA-I_IT22_KlockenhoffLukas-KloettschenJannekLiendlJonas.pdf)
---
# Casebased - A Python Library for Case-Based Reasoning
[](https://pypi.org/project/casebased/)
[](https://pypi.org/project/casebased/)
[](https://github.com/Case-Based/casebased/blob/main/LICENSE)
**Casebased** is a Python library that provides a flexible and extensible framework for implementing case-based reasoning (CBR) systems. CBR is a problem-solving paradigm that focuses on solving new problems by adapting solutions that were used to solve similar past problems.
## Features
| Feature | Description |
| ---------------------- | -------------------------------------------------------------------------- |
| Case Representation | Represent cases using a variety of data structures, including dictionaries, JSON, and custom classes. |
| Case Retrieval | Implement different case retrieval algorithms, such as nearest neighbor, fuzzy matching, and knowledge-guided search. |
| Case Adaptation | Provide functions to adapt retrieved cases to fit the current problem. |
| Case Evaluation | Assess the quality of the adapted solution and provide feedback to the system. |
| Case Learning | Automatically learn from successful and unsuccessful problem-solving experiences to improve future performance. |
| Extensibility | Easily integrate the library with your own domain-specific data and algorithms. |
## Installation
You can install the `casebased` library using pip:
```
pip install casebased
```
## Usage
Here's a simple example of how to use the `casebased` library:
<antArtifact identifier="casebased-example" type="application/vnd.ant.code" language="python" title="Casebased Library Example">
from casebased.case_base import CaseBase
from casebased.retrieval import NearestNeighborRetriever
# Create a case base
case_base = CaseBase()
# Add cases to the case base
```python
case_base.add_case({
"problem": {
"symptoms": ["fever", "headache", "sore throat"],
"duration": 3
},
"solution": {
"medication": "paracetamol",
"dosage": "500mg every 6 hours"
}
})
```
```python
case_base.add_case({
"problem": {
"symptoms": ["cough", "runny nose", "fatigue"],
"duration": 5
},
"solution": {
"medication": "ibuprofen",
"dosage": "400mg every 8 hours"
}
})
```
# Retrieve the most similar case
```python
new_problem = {
"symptoms": ["fever", "headache", "sore throat"],
"duration": 2
}
retriever = NearestNeighborRetriever()
similar_case = retriever.retrieve(case_base, new_problem)
print(f"Similar case: {similar_case}")
print(f"Suggested solution: {similar_case['solution']}")
```
## π Releases
You can see the list of available releases on the [GitHub Releases](https://github.com/casebased/casebased/releases) page.
We follow [Semantic Versions](https://semver.org/) specification.
We use [`Release Drafter`](https://github.com/marketplace/actions/release-drafter). As pull requests are merged, a draft release is kept up-to-date listing the changes, ready to publish when youβre ready. With the categories option, you can categorize pull requests in release notes using labels.
### List of labels and corresponding titles
| **Label** | **Title in Releases** |
| :-----------------------------------: | :---------------------: |
| `enhancement`, `feature` | π Features |
| `bug`, `refactoring`, `bugfix`, `fix` | π§ Fixes & Refactoring |
| `build`, `ci`, `testing` | π¦ Build System & CI/CD |
| `breaking` | π₯ Breaking Changes |
| `documentation` | π Documentation |
| `dependencies` | β¬οΈ Dependencies updates |
You can update it in [`release-drafter.yml`](https://github.com/casebased/casebased/blob/main/.github/release-drafter.yml).
GitHub creates the `bug`, `enhancement`, and `documentation` labels for you. Dependabot creates the `dependencies` label. Create the remaining labels on the Issues tab of your GitHub repository, when you need them.
## π‘ License
[](https://github.com/Case-Based/casebased/blob/main/LICENSE)
This project is licensed under the terms of the `MIT` license. See [LICENSE](https://github.com/Case-Based/casebased/blob/main/LICENSE) for more details.
## π Citation
```bibtex
@misc{casebased,
author = {casebased},
title = {CaseBased is a python library that implements the priciples of case-based reasoning.},
year = {2024},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/casebased/casebased}}
}
```
## Credits [](https://github.com/TezRomacH/python-package-template)
This project was generated with [`python-package-template`](https://github.com/TezRomacH/python-package-template)
Raw data
{
"_id": null,
"home_page": null,
"name": "casebased",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": "CBR, case-based reasoning, ML, Machine Learning",
"author": "Jonas Liendl",
"author_email": "casebased@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/79/a5/7522e609e56886fa9ba757aa0eea1889bba994bd38e95150858f032a5e50/casebased-0.1.6.tar.gz",
"platform": null,
"description": "<div align=\"left\">\n\n[](https://pypi.org/project/casebased/)\n[](https://github.com/Case-Based/casebased/pulls?utf8=%E2%9C%93&q=is%3Apr%20author%3Aapp%2Fdependabot)\n\n[](https://github.com/psf/black)\n[](https://github.com/PyCQA/bandit)\n[](https://github.com/Case-Based/casebased/blob/main/.pre-commit-config.yaml)\n[](https://github.com/Case-Based/casebased/releases)\n[](https://github.com/Case-Based/casebased/blob/master/LICENSE)\n\n\n---\n\n### [\ud83d\udcc3 Our Paper on CBR](https://github.com/user-attachments/files/16977337/SA-I_IT22_KlockenhoffLukas-KloettschenJannekLiendlJonas.pdf)\n\n---\n\n# Casebased - A Python Library for Case-Based Reasoning\n\n[](https://pypi.org/project/casebased/)\n[](https://pypi.org/project/casebased/)\n[](https://github.com/Case-Based/casebased/blob/main/LICENSE)\n\n**Casebased** is a Python library that provides a flexible and extensible framework for implementing case-based reasoning (CBR) systems. CBR is a problem-solving paradigm that focuses on solving new problems by adapting solutions that were used to solve similar past problems.\n\n## Features\n\n| Feature | Description |\n| ---------------------- | -------------------------------------------------------------------------- |\n| Case Representation | Represent cases using a variety of data structures, including dictionaries, JSON, and custom classes. |\n| Case Retrieval | Implement different case retrieval algorithms, such as nearest neighbor, fuzzy matching, and knowledge-guided search. |\n| Case Adaptation | Provide functions to adapt retrieved cases to fit the current problem. |\n| Case Evaluation | Assess the quality of the adapted solution and provide feedback to the system. |\n| Case Learning | Automatically learn from successful and unsuccessful problem-solving experiences to improve future performance. |\n| Extensibility | Easily integrate the library with your own domain-specific data and algorithms. |\n\n## Installation\n\nYou can install the `casebased` library using pip:\n\n```\npip install casebased\n```\n\n## Usage\n\nHere's a simple example of how to use the `casebased` library:\n\n<antArtifact identifier=\"casebased-example\" type=\"application/vnd.ant.code\" language=\"python\" title=\"Casebased Library Example\">\nfrom casebased.case_base import CaseBase\nfrom casebased.retrieval import NearestNeighborRetriever\n\n# Create a case base\ncase_base = CaseBase()\n\n# Add cases to the case base\n```python\ncase_base.add_case({\n\"problem\": {\n\"symptoms\": [\"fever\", \"headache\", \"sore throat\"],\n\"duration\": 3\n},\n\"solution\": {\n\"medication\": \"paracetamol\",\n\"dosage\": \"500mg every 6 hours\"\n}\n})\n```\n\n```python\ncase_base.add_case({\n\"problem\": {\n\"symptoms\": [\"cough\", \"runny nose\", \"fatigue\"],\n\"duration\": 5\n},\n\"solution\": {\n\"medication\": \"ibuprofen\",\n\"dosage\": \"400mg every 8 hours\"\n}\n})\n```\n# Retrieve the most similar case\n```python\nnew_problem = {\n\"symptoms\": [\"fever\", \"headache\", \"sore throat\"],\n\"duration\": 2\n}\n\nretriever = NearestNeighborRetriever()\nsimilar_case = retriever.retrieve(case_base, new_problem)\n\nprint(f\"Similar case: {similar_case}\")\nprint(f\"Suggested solution: {similar_case['solution']}\")\n```\n\n## \ud83d\udcc8 Releases\n\nYou can see the list of available releases on the [GitHub Releases](https://github.com/casebased/casebased/releases) page.\n\nWe follow [Semantic Versions](https://semver.org/) specification.\n\nWe use [`Release Drafter`](https://github.com/marketplace/actions/release-drafter). As pull requests are merged, a draft release is kept up-to-date listing the changes, ready to publish when you\u2019re ready. With the categories option, you can categorize pull requests in release notes using labels.\n\n### List of labels and corresponding titles\n\n| **Label** | **Title in Releases** |\n| :-----------------------------------: | :---------------------: |\n| `enhancement`, `feature` | \ud83d\ude80 Features |\n| `bug`, `refactoring`, `bugfix`, `fix` | \ud83d\udd27 Fixes & Refactoring |\n| `build`, `ci`, `testing` | \ud83d\udce6 Build System & CI/CD |\n| `breaking` | \ud83d\udca5 Breaking Changes |\n| `documentation` | \ud83d\udcdd Documentation |\n| `dependencies` | \u2b06\ufe0f Dependencies updates |\n\nYou can update it in [`release-drafter.yml`](https://github.com/casebased/casebased/blob/main/.github/release-drafter.yml).\n\nGitHub creates the `bug`, `enhancement`, and `documentation` labels for you. Dependabot creates the `dependencies` label. Create the remaining labels on the Issues tab of your GitHub repository, when you need them.\n\n## \ud83d\udee1 License\n[](https://github.com/Case-Based/casebased/blob/main/LICENSE)\n\nThis project is licensed under the terms of the `MIT` license. See [LICENSE](https://github.com/Case-Based/casebased/blob/main/LICENSE) for more details.\n\n## \ud83d\udcc3 Citation\n\n```bibtex\n@misc{casebased,\n author = {casebased},\n title = {CaseBased is a python library that implements the priciples of case-based reasoning.},\n year = {2024},\n publisher = {GitHub},\n journal = {GitHub repository},\n howpublished = {\\url{https://github.com/casebased/casebased}}\n}\n```\n\n## Credits [](https://github.com/TezRomacH/python-package-template)\n\nThis project was generated with [`python-package-template`](https://github.com/TezRomacH/python-package-template)\n\n",
"bugtrack_url": null,
"license": "The MIT License (MIT)\n Copyright (c) 2024 casebased\n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE\n OR OTHER DEALINGS IN THE SOFTWARE.",
"summary": "CaseBased is a python library that implements the priciples of case-based reasoning.",
"version": "0.1.6",
"project_urls": {
"Homepage": "https://www.casebased.org/",
"Repository": "https://github.com/Case-Based/casebased"
},
"split_keywords": [
"cbr",
" case-based reasoning",
" ml",
" machine learning"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "d760a2ae0cefdcd6051040ba6c521bd070abd88d127d3aa5c9e4f767cc17d3ac",
"md5": "023e24ce68eee424b627510ca7c4a0b1",
"sha256": "93af5fbd8b748ab0f7c16919632de43696d0d601a94fd5688939ecdf130f8ea5"
},
"downloads": -1,
"filename": "casebased-0.1.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "023e24ce68eee424b627510ca7c4a0b1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 28879,
"upload_time": "2025-02-17T15:30:39",
"upload_time_iso_8601": "2025-02-17T15:30:39.597377Z",
"url": "https://files.pythonhosted.org/packages/d7/60/a2ae0cefdcd6051040ba6c521bd070abd88d127d3aa5c9e4f767cc17d3ac/casebased-0.1.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "79a57522e609e56886fa9ba757aa0eea1889bba994bd38e95150858f032a5e50",
"md5": "bd15d4f9c6eff891284c950718e71e66",
"sha256": "a45ddfbfe0eaec261985c197828944f135a29f1909a07020e3545c44ccefd1a4"
},
"downloads": -1,
"filename": "casebased-0.1.6.tar.gz",
"has_sig": false,
"md5_digest": "bd15d4f9c6eff891284c950718e71e66",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 23065,
"upload_time": "2025-02-17T15:30:41",
"upload_time_iso_8601": "2025-02-17T15:30:41.217219Z",
"url": "https://files.pythonhosted.org/packages/79/a5/7522e609e56886fa9ba757aa0eea1889bba994bd38e95150858f032a5e50/casebased-0.1.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-17 15:30:41",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Case-Based",
"github_project": "casebased",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "casebased"
}