# pikaia - Genetic AI
pikaia is the Python implementation of Genetic AI (evolutionary simulation for data analysis).
## Installation
Use the package manager [pip](https://pip.pypa.io/en/stable/) to install pikaia
```bash
pip install pikaia
```
## Usage
We provide here the code for the "hello_model" example
```python
import pikaia
import pikaia
import pikaia.alg
rawdata = np.zeros([3,3])
rawdata[:,:] = [[ 300, 10, 2],
[ 600, 5, 2],
[1500, 4, 1]]
# defines the variant fitness rules
gvfitnessrules = ["inv_percentage", "inv_percentage", "inv_percentage"]
# converts the raw data to a genetic population
data = pikaia.alg.Population(rawdata, gvfitnessrules)
# defines the used evolutionary strategies
strategy = ["GS Dominant", "OS Balanced"]
iterations = 1
# creating the genetic model
model = pikaia.alg.Model(data, strategy)
initialgenefitness = [1.0/3.0, 1.0/3.0, 1.0/3.0]
# returns the gene fitness values after 1 iteration
model.complete_run(initialgenefitness, iterations)
```
## Examples
```python
# provides the data for a small decision problem
example3x3 = pikaia.examples.assemble_example("3x3-DomBal+AltSal")
# provides the data for a real-world decision problem
example10x5 = pikaia.examples.assemble_example("10x5-DomBal+AltSal")
# use genetic ai to search a datafile using keywords and rank results
# for a more detailed example we refer to examples/geneticAI_run_search_example.py
search = pikaia.search.Search(data, orgs_labels, gens_labels)
fitnessOrganisms, fitnessGenes = search.search_request(query, top_k=5)
```
For details see examples/README.md.
## Scientific Background
Please find the preprint of Genetic AI [here](http://arxiv.org/abs/2501.19113)
In Genetic AI, we convert a data problem to a model of genes and organisms. Afterwards, we run evolutionary simulations to obtain understanding of the input data.
Genetic AI is an AI that does not use training data to 'learn' but fully autonomously analyzes a problem. This is done by evolutionary strategies that cover certain 'behavior' and correlations of the input data.
## License
[MIT](https://choosealicense.com/licenses/mit/)
Raw data
{
"_id": null,
"home_page": null,
"name": "pikaia",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "AI, data analysis, evolutionary simulation",
"author": null,
"author_email": "Philipp Wissgott <philipp@danube.ai>, Andreas Roschal <andreas@danube.ai>, Martin B\u00e4r <martin@danube.ai>",
"download_url": "https://files.pythonhosted.org/packages/cc/08/8686e50f3ad575d0780c7740ebbd8bca30247128ac842d9c6321cff773e9/pikaia-0.0.2.tar.gz",
"platform": null,
"description": "# pikaia - Genetic AI\n\npikaia is the Python implementation of Genetic AI (evolutionary simulation for data analysis).\n\n## Installation\n\nUse the package manager [pip](https://pip.pypa.io/en/stable/) to install pikaia \n\n```bash\npip install pikaia\n```\n\n## Usage \n\nWe provide here the code for the \"hello_model\" example\n\n```python\nimport pikaia\n\nimport pikaia\nimport pikaia.alg\n \n\nrawdata = np.zeros([3,3])\nrawdata[:,:] = [[ 300, 10, 2],\n [ 600, 5, 2],\n [1500, 4, 1]]\n# defines the variant fitness rules\ngvfitnessrules = [\"inv_percentage\", \"inv_percentage\", \"inv_percentage\"]\n# converts the raw data to a genetic population\ndata = pikaia.alg.Population(rawdata, gvfitnessrules)\n# defines the used evolutionary strategies\nstrategy = [\"GS Dominant\", \"OS Balanced\"]\niterations = 1\n\n# creating the genetic model\nmodel = pikaia.alg.Model(data, strategy)\n\ninitialgenefitness = [1.0/3.0, 1.0/3.0, 1.0/3.0]\n# returns the gene fitness values after 1 iteration\nmodel.complete_run(initialgenefitness, iterations)\n\n```\n\n## Examples\n```python\n# provides the data for a small decision problem\nexample3x3 = pikaia.examples.assemble_example(\"3x3-DomBal+AltSal\")\n\n# provides the data for a real-world decision problem\nexample10x5 = pikaia.examples.assemble_example(\"10x5-DomBal+AltSal\")\n\n# use genetic ai to search a datafile using keywords and rank results\n# for a more detailed example we refer to examples/geneticAI_run_search_example.py\nsearch = pikaia.search.Search(data, orgs_labels, gens_labels)\nfitnessOrganisms, fitnessGenes = search.search_request(query, top_k=5)\n```\n\nFor details see examples/README.md.\n\n## Scientific Background\n\nPlease find the preprint of Genetic AI [here](http://arxiv.org/abs/2501.19113)\n\n\nIn Genetic AI, we convert a data problem to a model of genes and organisms. Afterwards, we run evolutionary simulations to obtain understanding of the input data.\n\nGenetic AI is an AI that does not use training data to 'learn' but fully autonomously analyzes a problem. This is done by evolutionary strategies that cover certain 'behavior' and correlations of the input data.\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Data analysis with evolutionary simulation",
"version": "0.0.2",
"project_urls": {
"Homepage": "https://github.com/danube-ai/pikaia",
"Issues": "https://github.com/danube-ai/pikaia/issues"
},
"split_keywords": [
"ai",
" data analysis",
" evolutionary simulation"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "0d9b3d5144bcfe24738026498c35a1459a63a178388dd1250818a6b4b9d0d339",
"md5": "b1a97856fab9f4b83b1c9f1805b3cf3c",
"sha256": "b8f1472b9c9cdf833302ff37e22ecd3979fe9a2b0705fe281ec0ac2a7119d9c8"
},
"downloads": -1,
"filename": "pikaia-0.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b1a97856fab9f4b83b1c9f1805b3cf3c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 10518,
"upload_time": "2025-02-06T13:24:37",
"upload_time_iso_8601": "2025-02-06T13:24:37.607151Z",
"url": "https://files.pythonhosted.org/packages/0d/9b/3d5144bcfe24738026498c35a1459a63a178388dd1250818a6b4b9d0d339/pikaia-0.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "cc088686e50f3ad575d0780c7740ebbd8bca30247128ac842d9c6321cff773e9",
"md5": "3b4f3e47ce16772de7bbe7b7e0a18a98",
"sha256": "a9da8ec4ddae26b743eb4baa71ec8d057aa4e1c113dfc60e3bddb52f6131d376"
},
"downloads": -1,
"filename": "pikaia-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "3b4f3e47ce16772de7bbe7b7e0a18a98",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 9014,
"upload_time": "2025-02-06T13:24:39",
"upload_time_iso_8601": "2025-02-06T13:24:39.020444Z",
"url": "https://files.pythonhosted.org/packages/cc/08/8686e50f3ad575d0780c7740ebbd8bca30247128ac842d9c6321cff773e9/pikaia-0.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-06 13:24:39",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "danube-ai",
"github_project": "pikaia",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "pikaia"
}