{"id":13571054,"url":"https://github.com/ruipgil/changepy","last_synced_at":"2025-12-25T08:57:10.916Z","repository":{"id":57417104,"uuid":"63890381","full_name":"ruipgil/changepy","owner":"ruipgil","description":"Time series changepoint detection","archived":false,"fork":false,"pushed_at":"2023-12-06T20:36:46.000Z","size":13,"stargazers_count":103,"open_issues_count":1,"forks_count":28,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-09T04:03:25.356Z","etag":null,"topics":["changepoint","pelt","timeseries"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/ruipgil.png","metadata":{"files":{"readme":"README.md","changelog":"changepy/__init__.py","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-07-21T17:46:20.000Z","updated_at":"2025-01-02T06:51:22.000Z","dependencies_parsed_at":"2024-06-19T01:35:49.961Z","dependency_job_id":"deece90f-37b7-4bbd-8412-ebbbb37b3d45","html_url":"https://github.com/ruipgil/changepy","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruipgil%2Fchangepy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruipgil%2Fchangepy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruipgil%2Fchangepy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruipgil%2Fchangepy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ruipgil","download_url":"https://codeload.github.com/ruipgil/changepy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247139468,"owners_count":20890236,"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":["changepoint","pelt","timeseries"],"created_at":"2024-08-01T14:00:57.970Z","updated_at":"2025-12-25T08:57:10.908Z","avatar_url":"https://github.com/ruipgil.png","language":"Python","funding_links":[],"categories":["📦 Packages"],"sub_categories":["Python"],"readme":"# changepy\n\nChangepoint detection in time series in pure python\n\n## Install\n\n```\npip install changepy\n```\n\n## Examples\n\n```python\n    \u003e\u003e\u003e from changepy import pelt\n    \u003e\u003e\u003e from changepy.costs import normal_mean\n    \u003e\u003e\u003e size = 100\n\n    \u003e\u003e\u003e mean_a = 0.0\n    \u003e\u003e\u003e mean_b = 10.0\n    \u003e\u003e\u003e var = 0.1\n\n    \u003e\u003e\u003e data_a = np.random.normal(mean_a, var, size)\n    \u003e\u003e\u003e data_b = np.random.normal(mean_b, var, size)\n    \u003e\u003e\u003e data = np.append(data_a, data_b)\n\n    \u003e\u003e\u003e pelt(normal_mean(data, var), len(data))\n    [0, 100] # since data is random, sometimes it might be different, but most of the time there will be at most a couple more values around 100\n```\n\nFor more examples see [pelt_test.py](./pelt_test.py)\n\n## Reference\n\nCurrently there is only one algorithm for changepoint evaluation, the PELT algorithm [1].\n\n\nThe PELT algorithm requires a cost function. Currently there are three functions available through this library. However, you could implement your own, for your specific needs.\nThose functions are:\n  + ``` normal_mean ```, which expects normal distributed data, with changing mean\n  + ``` normal_var ```, which expects normal distributed data, with changing variance\n  + ``` normal_meanvar ```, which expects normal distributed data, with changing mean and variance\n  + ``` poisson ```, which expect poisson distributed data, with changing mean\n  + ``` exponential ```, which expect exponential distributed data, with changing mean\n\n\n\u003e Test with ``` python test_pelt.py ```\n\n## Other implementations\n\nThis is mostly a port from other libraries, most of all from [STOR-i's changepoint package for julia](https://github.com/STOR-i/Changepoints.jl) and [rkillick cpt package for r](https://github.com/rkillick/changepoint/)\n\n\n[1]: Killick R, Fearnhead P, Eckley IA (2012) Optimal detection of changepoints with a linear computational cost, JASA 107(500), 1590-1598\n\n## License\n\n[MIT](./LICENSE)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruipgil%2Fchangepy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fruipgil%2Fchangepy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruipgil%2Fchangepy/lists"}