{"id":21083301,"url":"https://github.com/mudafar/alz-predictor","last_synced_at":"2025-05-16T09:32:40.367Z","repository":{"id":57177003,"uuid":"350512339","full_name":"mudafar/alz-predictor","owner":"mudafar","description":"A JavaScript sequence prediction library, for building proactive and smart user interfaces.","archived":false,"fork":false,"pushed_at":"2021-04-03T17:08:49.000Z","size":177,"stargazers_count":9,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-27T01:43:05.557Z","etag":null,"topics":["activelezi","adaptive","ai","algorithm","client-side","javascript-library","lz77","prediction","predictive-prefetching","sequence","spa","ui"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/mudafar.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}},"created_at":"2021-03-22T22:50:46.000Z","updated_at":"2023-10-19T10:14:14.000Z","dependencies_parsed_at":"2022-09-14T02:21:33.555Z","dependency_job_id":null,"html_url":"https://github.com/mudafar/alz-predictor","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mudafar%2Falz-predictor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mudafar%2Falz-predictor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mudafar%2Falz-predictor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mudafar%2Falz-predictor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mudafar","download_url":"https://codeload.github.com/mudafar/alz-predictor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225419515,"owners_count":17471434,"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":["activelezi","adaptive","ai","algorithm","client-side","javascript-library","lz77","prediction","predictive-prefetching","sequence","spa","ui"],"created_at":"2024-11-19T20:17:31.461Z","updated_at":"2024-11-19T20:17:32.319Z","avatar_url":"https://github.com/mudafar.png","language":"JavaScript","readme":"# ALZ predictor \u0026middot; [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/mudafar/alz-predictor/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/alz-predictor.svg?style=flat)](https://www.npmjs.com/package/alz-predictor)  ![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)\n\nALZ predictor is a JavaScript library for symbols sequence prediction, based on **Gopalratnam and Cook Active LeZi algorithm**.\n\n\n* **AI:** ALZ predictor makes it possible to create proactive and smart UIs. Improve your application UX by adding a touch of artificial intelligence. Guess and prefetch required data to enhance performance. \n\n* **Simple:** Model each user action as a char, then train ALZ by simply adding them as they come (one by one). Predict next user action at any time. \n\n* **Lightweight:** No dependencies.   \n\n## FAQ\n- Why **JavaScript** and **Frontend AI** at all? \n   - No server-client latency\n   - Offline\n   - Privacy\n   - Cost\n   - [TensorFlow.js](https://www.tensorflow.org/js/) and [ONNX.JS](https://microsoft.github.io/onnxjs-demo/#/)\n\n- How to **save learning** data?\n   \n   Serialize and save to browser **localStorage**.\n\n- What is the difference with **Guess.js**?\n   \n    **Google Analytics** is **not** required for training.\n\n\n## Installation\n```bash\n# Yarn\nyarn add alz-predictor\n\n# NPM\nnpm install --save alz-predictor\n```\n\n\n## Usage\n\n```js\nimport Predictor from 'alz-predictor'\n\nconst predictor = new Predictor()\npredictor.add('a')\npredictor.add('b')\npredictor.add('a')\n\nconst predictions = predictor.predict()\n```\n\n## Examples\n- Next-page data predective prefetching:\n    - Online demo: https://mudafar.github.io/alz-predictor-prefetch-example/\n\n    - [Source code](https://github.com/mudafar/alz-predictor-prefetch-example)\n\n\n\n## Documentation\n### Constructor\n```js\nconst predictor = new Predictor()\n```\n\n### Methods\n- add: add `char` to the sequence.\n- predict: get predictions object. \n- loadJSON: recover state from JSON. \n\n### Serialization\n```js\nconst predictor = new Predictor()\npredictor.add('a')\npredictor.add('b')\n\nconst json = JSON.stringify(predictor)\n```\n\n\n## License\nALZ predictor is [MIT licensed](./LICENSE).","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmudafar%2Falz-predictor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmudafar%2Falz-predictor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmudafar%2Falz-predictor/lists"}