{"_id":"bayesian-changepoint","_rev":"3331964","name":"bayesian-changepoint","description":"Useful Grid algorithm from Material-UI (https://github.com/mui-org/material-ui)","dist-tags":{"latest":"1.0.1"},"maintainers":[{"name":"mathew-kurian","email":""}],"time":{"modified":"2024-07-10T07:25:30.000Z","created":"2020-04-02T19:23:22.791Z","1.0.1":"2020-04-02T19:23:22.791Z"},"users":{},"author":{"name":"Mathew Kurian","email":"mwkurian@gmail.com.com"},"repository":{"type":"git","url":"git+https://github.com/mathew-kurian/BayesianChangePointJS.git"},"versions":{"1.0.1":{"name":"bayesian-changepoint","version":"1.0.1","main":"./lib/BayesianChangePoint.js","typings":"./lib/BayesianChangePoint.d.ts","scripts":{"prepare":"npm run build","build":"npx tsc","test":"npx mocha -r ts-node/register ./spec/*.ts"},"keywords":["bayesian","changepoint","detection","javascript"],"author":{"name":"Mathew Kurian","email":"mwkurian@gmail.com.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/mathew-kurian/BayesianChangePointJS.git"},"bugs":{"url":"https://github.com/mathew-kurian/BayesianChangePointJS/issues"},"homepage":"https://github.com/mathew-kurian/BayesianChangePointJS#readme","description":"Useful Grid algorithm from Material-UI (https://github.com/mui-org/material-ui)","dependencies":{},"peerDependencies":{},"devDependencies":{"@types/mocha":"^7.0.2","@types/node":"^13.9.8","mocha":"^7.1.1","ts-node":"^8.8.1","typescript":"3.7.5"},"gitHead":"d37636d35c7b0427967e94ceda9d1e8119186573","_id":"bayesian-changepoint@1.0.1","_nodeVersion":"10.15.0","_npmVersion":"6.14.3","dist":{"shasum":"cb21d56b1001fb6883997204f30f2fe4237cd31a","size":3558,"noattachment":false,"key":"/bayesian-changepoint/-/bayesian-changepoint-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/bayesian-changepoint/download/bayesian-changepoint-1.0.1.tgz"},"maintainers":[{"name":"mathew-kurian","email":""}],"_npmUser":{"name":"mathew-kurian","email":"mwkurian@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bayesian-changepoint_1.0.1_1585855402656_0.13858376181997478"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-24T19:03:05.907Z","publish_time":1585855402791,"_cnpm_publish_time":1585855402791}},"readme":"## Bayesian Online ChangePoint JS Detection\n\n[![Edit BayesianChangePointJS](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/hopeful-hawking-vpftt?fontsize=14&hidenavigation=1&theme=dark)\n\nPure JavaScript/TypeScript implementation of [Bayesian Online Changepoint](https://arxiv.org/pdf/0710.3742.pdf) detection which runs for Browsers & NodeJS.\n\n## Example\n\n```typescript\nimport assert from \"assert\";\nimport BayesianChangePoint, { BreakPoint } from \"bayesian-changepoint\";\n\nconst breakpointVerifier = (\n  next: BreakPoint<number>,\n  prev: BreakPoint<number>\n): boolean => {\n  if (Math.abs(next.data - prev.data) >= 5) {\n    return true;\n  }\n\n  return false;\n};\n\nconst values = (breakPoints: BreakPoint<number>[]): number[] => {\n  return breakPoints.map(breakPoint => breakPoint.data);\n};\n\nconst indicies = (breakPoints: BreakPoint<number>[]): number[] => {\n  return breakPoints.map(breakPoint => breakPoint.index);\n};\n\nconst detection = new BayesianChangePoint<number>({\n  breakpointVerifier\n});\n\ndetection.exec([10, 10, 10, 10, 5000, 5000, 5000, 5000, 30, 30, 30, 30, 30]);\n\nassert.deepEqual(values(detection.breakPoints()), [5000, 30]);\nassert.deepEqual(indicies(detection.breakPoints()), [4, 8]);\n```\n\n## Installation\n\n```bash\nnpm install\nnpm test\n```\n\n## Credits\n\nBased off of [Bayesian Online Changepoint](https://arxiv.org/pdf/0710.3742.pdf)\n","_attachments":{},"homepage":"https://github.com/mathew-kurian/BayesianChangePointJS#readme","bugs":{"url":"https://github.com/mathew-kurian/BayesianChangePointJS/issues"},"license":"MIT"}