| Name | rkt-ai-lib JSON |
| Version |
2.0.0
JSON |
| download |
| home_page | None |
| Summary | RootKit ai Lib (RL - Qlearning) |
| upload_time | 2024-06-13 15:25:31 |
| maintainer | None |
| docs_url | None |
| author | RootKit |
| requires_python | >=3.9 |
| license | None |
| keywords |
|
| VCS |
|
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
# rkt_ai_lib - Python library







This Python library is based only on built-in Python libraries and two (2) non-build-in library :
- [numpy](https://pypi.org/project/numpy/)
- [pandas](https://pypi.org/project/pandas/)
##### Python Version 3.9.9
##### PyYaml Version 5.4.1 (Released Jan 20, 2021)
##### numpy Version 1.21.5 (Released Jan 7, 2022)
##### pandas Version 1.3.5 (Released Dec 12, 2021)
----
## What is Python?
Python is an interpreted high-level general-purpose programming language. Python's design philosophy emphasizes code readability with its notable use of significant indentation. Its language constructs as well as its object-oriented approach aim to help programmers write clear, logical code for small and large-scale projects.
[source](https://en.wikipedia.org/wiki/Python_(programming_language))
## What is numpy?
NumPy is the fundamental package for scientific computing in Python.
It is a Python library that provides a multidimensional array object, various derived objects (such as masked arrays and matrices),
and an assortment of routines for fast operations on arrays, including mathematical, logical, shape manipulation,
sorting, selecting, I/O, discrete Fourier transforms, basic linear algebra, basic statistical operations, random simulation and much more.
[source](https://pypi.org/project/numpy/)
## What is pandas?
pandas is a Python package that provides fast, flexible, and expressive data structures designed to make working with
"relational" or "labeled" data both easy and intuitive.
It aims to be the fundamental high-level building block for doing practical, real world data analysis in Python.
Additionally, it has the broader goal of becoming the most powerful and flexible open source data analysis / manipulation tool available in any language.
It is already well on its way towards this goal.
[source](https://pypi.org/project/pandas/)
## Libraries
* AI: overlay of pandas library (Renforcement Learning - Qlearning)
## Use it
### Install
```bash
(venv) my_project> pip install rkt_ai_lib [--index-url https://gitlab.tprc.ovh/api/v4/groups/python/-/packages/pypi]
```
###
```python
from os.path import exists
from rkt_ai_lib import QLearning
from your_local_lib import MyGameObject
my_action_list = ['up', 'down', 'left', 'right']
# can override alpha (0.1), gamma (0.5)
if exists("my_mind.pkl"):
mind = QLearning(actions=my_action_list, should_load=True, qtable_file_to_load="my_mind.pkl")
else:
mind = QLearning(actions=my_action_list)
# You can use the Qlearning for another thing then game
my_game = MyGameObject()
while True:
# get the current state
state = my_game.get_state()
# get the action
action = mind.choose_action(state)
# do the action your logic is here (move, attack, ... for game, send, buy, ... for trading, ...)
my_game.do_action(action)
# get the reward this is here reward logic
reward = my_game.get_reward(action, state)
# update the Q-table
mind.learn(state, action, reward)
# check if you "win"
if my_game.is_win():
break
mind.save("my_mind.pkl")
```
### Output (as file or sdtout ot both)
```log
Your "game" log
```
## Contributing
If you find this library useful here's how you can help:
- Send a merge request with your kickass new features and bug fixes
- Help new users with [issues](https://gitlab.tprc.ovh/python/rkt_lib_toolkit/-/issues) they may encounter
- Support the development of this library and star this repo!
Raw data
{
"_id": null,
"home_page": null,
"name": "rkt-ai-lib",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": null,
"author": "RootKit",
"author_email": "rootkit@rootkit-lab.org",
"download_url": "https://files.pythonhosted.org/packages/a5/e5/33466a6f98dacbfd8bd824fcc94e8b9251171ef17c55d0a3cf9f36d1b75b/rkt_ai_lib-2.0.0.tar.gz",
"platform": null,
"description": "# rkt_ai_lib - Python library\n\n\n\n\n\n\n\n\n\n\nThis Python library is based only on built-in Python libraries and two (2) non-build-in library :\n - [numpy](https://pypi.org/project/numpy/)\n - [pandas](https://pypi.org/project/pandas/)\n\n##### Python Version 3.9.9\n##### PyYaml Version 5.4.1 (Released Jan 20, 2021)\n##### numpy Version 1.21.5 (Released Jan 7, 2022)\n##### pandas Version 1.3.5 (Released Dec 12, 2021)\n\n----\n\n## What is Python?\nPython is an interpreted high-level general-purpose programming language. Python's design philosophy emphasizes code readability with its notable use of significant indentation. Its language constructs as well as its object-oriented approach aim to help programmers write clear, logical code for small and large-scale projects.\n\n[source](https://en.wikipedia.org/wiki/Python_(programming_language))\n\n## What is numpy?\nNumPy is the fundamental package for scientific computing in Python. \nIt is a Python library that provides a multidimensional array object, various derived objects (such as masked arrays and matrices), \nand an assortment of routines for fast operations on arrays, including mathematical, logical, shape manipulation,\nsorting, selecting, I/O, discrete Fourier transforms, basic linear algebra, basic statistical operations, random simulation and much more. \n[source](https://pypi.org/project/numpy/)\n\n## What is pandas?\npandas is a Python package that provides fast, flexible, and expressive data structures designed to make working with \n\"relational\" or \"labeled\" data both easy and intuitive. \nIt aims to be the fundamental high-level building block for doing practical, real world data analysis in Python. \nAdditionally, it has the broader goal of becoming the most powerful and flexible open source data analysis / manipulation tool available in any language. \nIt is already well on its way towards this goal. \n[source](https://pypi.org/project/pandas/)\n## Libraries\n\n* AI: overlay of pandas library (Renforcement Learning - Qlearning)\n\n## Use it\n### Install\n```bash\n (venv) my_project> pip install rkt_ai_lib [--index-url https://gitlab.tprc.ovh/api/v4/groups/python/-/packages/pypi]\n```\n###\n\n```python\nfrom os.path import exists\nfrom rkt_ai_lib import QLearning\nfrom your_local_lib import MyGameObject\n\nmy_action_list = ['up', 'down', 'left', 'right']\n\n# can override alpha (0.1), gamma (0.5)\nif exists(\"my_mind.pkl\"):\n mind = QLearning(actions=my_action_list, should_load=True, qtable_file_to_load=\"my_mind.pkl\")\nelse:\n mind = QLearning(actions=my_action_list)\n\n# You can use the Qlearning for another thing then game\nmy_game = MyGameObject()\n\nwhile True:\n # get the current state\n state = my_game.get_state()\n # get the action\n action = mind.choose_action(state)\n # do the action your logic is here (move, attack, ... for game, send, buy, ... for trading, ...)\n my_game.do_action(action)\n # get the reward this is here reward logic\n reward = my_game.get_reward(action, state)\n # update the Q-table\n mind.learn(state, action, reward)\n\n # check if you \"win\"\n if my_game.is_win():\n break\n\nmind.save(\"my_mind.pkl\")\n```\n\n### Output (as file or sdtout ot both)\n```log\nYour \"game\" log\n```\n\n## Contributing\n\nIf you find this library useful here's how you can help:\n\n- Send a merge request with your kickass new features and bug fixes\n- Help new users with [issues](https://gitlab.tprc.ovh/python/rkt_lib_toolkit/-/issues) they may encounter\n- Support the development of this library and star this repo!\n",
"bugtrack_url": null,
"license": null,
"summary": "RootKit ai Lib (RL - Qlearning)",
"version": "2.0.0",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "44bda21b698168075bf9bec6ba314e198d70e405b853c085084e23d7253d800d",
"md5": "f58067e88ce41958fa3ce5bc0db066cd",
"sha256": "6bce7ef54cbdd7c833209ea7545d21687e5e8c3aa947b914b7bdb9e7be26ad96"
},
"downloads": -1,
"filename": "rkt_ai_lib-2.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f58067e88ce41958fa3ce5bc0db066cd",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 5954,
"upload_time": "2024-06-13T15:25:30",
"upload_time_iso_8601": "2024-06-13T15:25:30.306926Z",
"url": "https://files.pythonhosted.org/packages/44/bd/a21b698168075bf9bec6ba314e198d70e405b853c085084e23d7253d800d/rkt_ai_lib-2.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a5e533466a6f98dacbfd8bd824fcc94e8b9251171ef17c55d0a3cf9f36d1b75b",
"md5": "dbabf63410b6e41bee3c97068a901812",
"sha256": "5eebf97143e69ead848ac45e61be6254a7420f5978064ff7dfc501e7808508a7"
},
"downloads": -1,
"filename": "rkt_ai_lib-2.0.0.tar.gz",
"has_sig": false,
"md5_digest": "dbabf63410b6e41bee3c97068a901812",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 7527,
"upload_time": "2024-06-13T15:25:31",
"upload_time_iso_8601": "2024-06-13T15:25:31.706304Z",
"url": "https://files.pythonhosted.org/packages/a5/e5/33466a6f98dacbfd8bd824fcc94e8b9251171ef17c55d0a3cf9f36d1b75b/rkt_ai_lib-2.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-13 15:25:31",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "rkt-ai-lib"
}