{"id":15288130,"url":"https://github.com/vc1492a/henosis","last_synced_at":"2025-09-05T16:36:36.897Z","repository":{"id":29314058,"uuid":"120686251","full_name":"vc1492a/henosis","owner":"vc1492a","description":"A Python framework for deploying recommendation models for form fields. ","archived":false,"fork":false,"pushed_at":"2022-10-19T13:26:17.000Z","size":1096,"stargazers_count":11,"open_issues_count":44,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-02T04:44:40.217Z","etag":null,"topics":["categorical-features","classification","machine-learning","predictive-modeling","python","recommendation-system","recommender-system","scikit-learn","supervised-learning"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vc1492a.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"docs/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-07T23:44:08.000Z","updated_at":"2021-02-20T12:28:42.000Z","dependencies_parsed_at":"2022-08-31T16:12:08.569Z","dependency_job_id":null,"html_url":"https://github.com/vc1492a/henosis","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vc1492a%2Fhenosis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vc1492a%2Fhenosis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vc1492a%2Fhenosis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vc1492a%2Fhenosis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vc1492a","download_url":"https://codeload.github.com/vc1492a/henosis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248678305,"owners_count":21144269,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["categorical-features","classification","machine-learning","predictive-modeling","python","recommendation-system","recommender-system","scikit-learn","supervised-learning"],"created_at":"2024-09-30T15:44:13.463Z","updated_at":"2025-04-13T07:34:27.669Z","avatar_url":"https://github.com/vc1492a.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Henosis\n\nHenosis is a cloud-native, lightweight Python-based recommender framework\nthat facilitates providing recommendations to users of applications, like this:\n\n\u003cbr/\u003e\n\n![PRS Demo Gif](https://i.imgur.com/VxtpwEq.gif)\n\n\u003cbr/\u003e\n\nHenosis is in **active development** and is released as alpha software.\nHenosis is being developed at the [NASA Jet Propulsion Laboratory](https://jpl.nasa.gov/) (JPL)\nusing user-driven development (UDD) with generous support from the Office of Safety and\nMission Success (5X).\n\n[![PyPi](https://img.shields.io/badge/pypi-0.0.11-green.svg)](https://pypi.python.org/pypi/Henosis/0.0.11)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\nHenosis brings together model training and testing,\nstorage and deployment, and querying under a single framework. Henosis provides Data Scientists with a straight-forward and\ngeneralizable environment in which to train, test, store, and deploy categorical machine\nlearning models for making form field recommendations, while also providing software engineers\nand web developers with a REST API that can be easily queried for recommendations\nand integrated across different enterprise applications.\n\n## How Does Henosis Work?\n\nThis framework brings together model training and testing,\nstorage and deployment, and querying under one framework that data\nscientists and developers can collectively use to provide\nrecommendations to users. Henosis provides data scientists with a straight-forward interface in\nwhich to train, test, store, and deploy categorical machine learning\nmodels. For developers, it provides an API that can be used\nto provide form field recommendations to users of enterprise\napplications.\n\n### For Data Scientists\n\nHenosis is intended to work well with data scientists' modeling workflow,\nand can be used to create training and test splits, fit models, and deploy\nmodels to a running Henosis instance.\n\n```python\nfrom Henosis.model import Data, Models\n\n# read in data from a csv\nd = Data()\nd.load(csv_path='file.csv')\nprint(d.all.head())\n\n# split data\nd.test_train_split(\n    d.all[X_vars],\n    d.all[y_var],\n    share_train=0.8\n)\n\n# fit a model (use any categorical scikit-learn model)\n# this is where you do your \"magic\"!\nm = Models().SKModel(MultinomialNB(alpha=0.25))\nm.train(d)\nm.test(d)\n\n# print results\nprint(m.train_results)\nprint(m.test_results)\n\n# connect to the deployed Henosis instance by referencing a configuration file\nfrom Henosis.utils import Connect\ns = Connect().config(config_yaml_path='config.yaml')\n\n# store the model in S3 and Elasticsearch\nm.store(\n    server_config=s,\n    model_path='model_' + y_var + '_1.pickle',\n    encoder_path='encoder_' + y_var + '_1.pickle',\n    encoder=count_vect\n)\n\n# deploy a model for use\nm.deploy(\n    server_config=s,\n    deploy=True\n)\n```\n\nMore detailed information and examples are available in the rest of the documentation.\n\n### For Developers\n\nRunning a Henosis instance for serving recommendations requires first setting\nup an Elasticsearch index (details in the configuration section) and an\nAmazon S3 bucket. Following that, deploying an instance of Henosis for\nmaking recommendations is as easy as placing the following in a Python file.\n\n```python\nfrom Henosis.server import Connect, Server\n\n# run the server\nc = Connect().config(config_yaml_path='config.yaml')\ns = Server(c).config()\ns.run(port=5005)\n```\n\nOnce a Henosis instance is running, developers can query for recommendations,\nmodel information, and API request information from the available Henosis API (REST)\nendpoints.\n\n### The Internal Structure\n\nHenosis works by acting as a bridge between end users and data scientists\nwhich train recommendation (predictive) models. There are several classes\nthat facilitate the interaction between data, scikit-learn models, and a\nREST API that provides recommendations and other information.\n\n![Henosis Flowchart](https://i.imgur.com/EXUh0cx.png)\n\nHenosis classes (bold borders) interface with the data scientist or statistician,\ndevelopers querying for recommendations, and trained models. When queried for\nrecommendations, Henosis references model information in Elasticsearch,\nloads appropriate models from AWS S3, and serves recommendations by using\ndata available in the query (REST API request).\n\n## Prerequisites\n\n- Python 3.6+ (untested on lower versions) with the following packages:\n    - boto3\n    - dill\n    - gevent\n    - Flask\n    - Flask-CORS\n    - Flask-HTTPAuth\n    - Flask-RESTful\n    - gevent\n    - imbalanced-learn\n    - Jinja2\n    - jwt\n    - gevent\n    - numpy\n    - pandas\n    - PyYAML\n    - requests\n    - scikit-learn\n- A working Amazon Web Services (AWS) S3 bucket, along with:\n    - AWS key\n    - AWS secret\n- A running Elasticsearch 6+ server (untested on lower versions). You'll need to\ncreate an index and specify a mapping (documentation is provided and helpful\nscripts are available in the *scripts* directory).\n\n## Getting Started\n\nSimply do a pip install and import the Henosis library as follows:\n\n```bash\npip install Henosis\n```\n\nIf you'd like, you can also fork the repository and pull Henosis to a local directory.\n\n## Documentation\n\nThe latest Henosis documentation is available [here](https://www.henosis.io/)\nand covers how to use Henosis for modeling and providing recommendations\nwithin your applications.\n\n## Motivation\n\nIn October 2017, our data science team at the [NASA Jet Propulsion Laboratory](https://jpl.nasa.gov/) (JPL)\nwas approached by the Office of Safety and Mission Success (5X) to improve\nprocesses for reporting in the Problem Reporting System (PRS). PRS is an internal\ntool that allows engineers to submit Problem Failure Reports (PFRs) and Incident\nSurprise, Anomaly reports (ISAs), which document pre-launch test failures and\npost-launch operational anomalies experienced by spacecraft. These reports not\nonly serve as a record of past problems but also of past solutions to the problems described.\n\nDespite their value, the reports contained within the PRS are costly to fill out and submit.\nWith dozens of textual, categorical, and other inputs in the forms, the PFRs and ISAs\ndraw valuable time away from mission staff to the annotation of internal forms — time\nbetter spent with spacecraft operations and mission work. A solution was needed that\nwould reduce the time needed to file reports in PRS while ensuring ease of use for\nusers already familiar with the current PRS system, such as a recommendation system\nfor form fields. What we needed from a data science and IT operations perspective\nwas a straightforward process to deploy a simple recommendation system for use in\nenterprise applications containing categorical form inputs (like dropdown menus).\n\nWhile the initial effort focused on one internal use case, Henosis was developed\nas a generalized, open-source framework and is freely available for use in\nother applications.\n\n## How to Contribute\nSee a bug that needs fixing or want to add a new feature? Fork the repository with\nthe name of the issue (e.g. 'issue_12', open an issue if there isn't one already) or\nthe name of your new feature. When ready, submit a pull request!\n\n## License\n\nThis project is licensed under the Apache 2.0 license and released by\nthe California Institute of Technology.\n\n## Acknowledgements\n\n- [NASA Jet Propulsion Laboratory](https://jpl.nasa.gov/)\n    - Ian Colwell\n    - Leslie Callum\n    - Harald Schone\n    - [Kyle Hundman](https://github.com/khundman)\n    - [Paul Ramirez](https://github.com/darth-pr)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvc1492a%2Fhenosis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvc1492a%2Fhenosis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvc1492a%2Fhenosis/lists"}