bfast-ray


Namebfast-ray JSON
Version 0.0.4 PyPI version JSON
download
home_pagehttps://github.com/benerain/bfast-ray
SummaryThe bfast-ray package provides a highly-efficient parallel implementation for the `Breaks For Additive Season and Trend (BFASTmonitor) proposed by Verbesselt et al. The implementation is based on Ray
upload_time2023-09-01 07:38:14
maintainer
docs_urlNone
authorYujia LI
requires_python>=3.8
licenseMIT license
keywords bfast_ray
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # bfast-ray


[![image](https://img.shields.io/pypi/v/bfast-ray.svg)](https://pypi.python.org/pypi/bfast-ray)
<!-- [![image](https://img.shields.io/conda/vn/conda-forge/bfast-ray.svg)](https://anaconda.org/conda-forge/bfast-ray) -->


**The bfast-ray package provides a highly-efficient parallel implementation for the `Breaks For Additive Season and Trend (BFASTmonitor) proposed by Verbesselt et al. The implementation is based on Ray**

This package is adapted from https://github.com/diku-dk/bfast, with credit to mortvest.


-   Free software: MIT license
-   Documentation: https://benerain.github.io/bfast-ray
    

## Dependencies
============
- numpy==1.25.2
- pandas==2.0.3
- scikit-learn==1.3.0
- scipy==1.11.2
- matplotlib==3.7.2
- wget==3.2
- ray==2.6.1

## Input args 
- start_monitor:Python 标准库中的 datetime类型的数据(用datetime库解析字符串)

- freq: 季节性变化的观测频次。比如,监测变量NDWI是按年度变化的,采样数据是某一天的均值,那么freq就设置为365;采样数据是某一月的均值,那么freq就设置为12

- k : 谐波级数,傅立叶分解的精度

- hfrac: 用多少observation 来计算时间序列的 均值和方差。  moving window the比例 限制为0.25, 0.5, 1

- trend :  bool值, 是否使用offset值

- level: 监测的明显水平(和 ROC,如果选择)过程,即概率类型 I 错误。       

- verbose: int 中间过程输不输出

- backend: str, 'python' or 'python-ray'

- address: str, e.g.:"ray://xxx.xx.xx.xx:xxxxx"

- ray_remote_args: dic, e.g.: {"resources": {"customResources": 1}, "batch_size":10}

## Output 

breaks: 数组。 -2代表 没有充分的历史数据。 -1代表该pixel没有break 。所有其他非负数据对应于第一个在监控期间检测到的中断的索引序号

means: 每一个MOSUM 过程的mean值(例如考虑NDMI指数时,像素的正平均值对应于植被的增加,)

timers : dict 是个字典,包含拟合过程不同阶段的运行时测量值。

共三个

## use example

```py
k = 3
freq = 365
trend = False
hfrac = 0.25
level = 0.05
start_monitor = datetime(2010, 1, 1)

model = BFASTMonitor(
            start_monitor,
            freq=freq,
            k=k,
            hfrac=hfrac,
            trend=trend,
            level=level,
            # backend='python',
            backend='python-ray',
            cluster_address = "ray://xx.xx.xx.xx:xxxxx",
            ray_remote_args= {"resources": {"xxxx": xx}, "batch_size":1}
        )


model.fit(data, dates, nan_value=-32768)

breaks = model.breaks
means = model.means
timers = model.timers
```





            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/benerain/bfast-ray",
    "name": "bfast-ray",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "bfast_ray",
    "author": "Yujia LI",
    "author_email": "diana_15926479126@icloud.com",
    "download_url": "https://files.pythonhosted.org/packages/80/e2/1e0436f65e5a784eafbfe66cbe539e2a0bbdf0ae98319713502f860707b0/bfast-ray-0.0.4.tar.gz",
    "platform": null,
    "description": "# bfast-ray\n\n\n[![image](https://img.shields.io/pypi/v/bfast-ray.svg)](https://pypi.python.org/pypi/bfast-ray)\n<!-- [![image](https://img.shields.io/conda/vn/conda-forge/bfast-ray.svg)](https://anaconda.org/conda-forge/bfast-ray) -->\n\n\n**The bfast-ray package provides a highly-efficient parallel implementation for the `Breaks For Additive Season and Trend (BFASTmonitor) proposed by Verbesselt et al. The implementation is based on Ray**\n\nThis package is adapted from https://github.com/diku-dk/bfast, with credit to mortvest.\n\n\n-   Free software: MIT license\n-   Documentation: https://benerain.github.io/bfast-ray\n    \n\n## Dependencies\n============\n- numpy==1.25.2\n- pandas==2.0.3\n- scikit-learn==1.3.0\n- scipy==1.11.2\n- matplotlib==3.7.2\n- wget==3.2\n- ray==2.6.1\n\n## Input args \n- start_monitor\uff1aPython \u6807\u51c6\u5e93\u4e2d\u7684 datetime\u7c7b\u578b\u7684\u6570\u636e\uff08\u7528datetime\u5e93\u89e3\u6790\u5b57\u7b26\u4e32\uff09\n\n- freq\uff1a \u5b63\u8282\u6027\u53d8\u5316\u7684\u89c2\u6d4b\u9891\u6b21\u3002\u6bd4\u5982\uff0c\u76d1\u6d4b\u53d8\u91cfNDWI\u662f\u6309\u5e74\u5ea6\u53d8\u5316\u7684\uff0c\u91c7\u6837\u6570\u636e\u662f\u67d0\u4e00\u5929\u7684\u5747\u503c\uff0c\u90a3\u4e48freq\u5c31\u8bbe\u7f6e\u4e3a365\uff1b\u91c7\u6837\u6570\u636e\u662f\u67d0\u4e00\u6708\u7684\u5747\u503c\uff0c\u90a3\u4e48freq\u5c31\u8bbe\u7f6e\u4e3a12\n\n- k \uff1a \u8c10\u6ce2\u7ea7\u6570\uff0c\u5085\u7acb\u53f6\u5206\u89e3\u7684\u7cbe\u5ea6\n\n- hfrac\uff1a \u7528\u591a\u5c11observation \u6765\u8ba1\u7b97\u65f6\u95f4\u5e8f\u5217\u7684 \u5747\u503c\u548c\u65b9\u5dee\u3002  moving window the\u6bd4\u4f8b \u9650\u5236\u4e3a0.25, 0.5, 1\n\n- trend :  bool\u503c\uff0c \u662f\u5426\u4f7f\u7528offset\u503c\n\n- level\uff1a \u76d1\u6d4b\u7684\u660e\u663e\u6c34\u5e73\uff08\u548c ROC\uff0c\u5982\u679c\u9009\u62e9\uff09\u8fc7\u7a0b\uff0c\u5373\u6982\u7387\u7c7b\u578b I \u9519\u8bef\u3002       \n\n- verbose\uff1a int \u4e2d\u95f4\u8fc7\u7a0b\u8f93\u4e0d\u8f93\u51fa\n\n- backend: str, 'python' or 'python-ray'\n\n- address: str, e.g.:\"ray://xxx.xx.xx.xx:xxxxx\"\n\n- ray_remote_args: dic, e.g.: {\"resources\": {\"customResources\": 1}, \"batch_size\":10}\n\n## Output \n\nbreaks\uff1a \u6570\u7ec4\u3002 -2\u4ee3\u8868 \u6ca1\u6709\u5145\u5206\u7684\u5386\u53f2\u6570\u636e\u3002 -1\u4ee3\u8868\u8be5pixel\u6ca1\u6709break \u3002\u6240\u6709\u5176\u4ed6\u975e\u8d1f\u6570\u636e\u5bf9\u5e94\u4e8e\u7b2c\u4e00\u4e2a\u5728\u76d1\u63a7\u671f\u95f4\u68c0\u6d4b\u5230\u7684\u4e2d\u65ad\u7684\u7d22\u5f15\u5e8f\u53f7\n\nmeans\uff1a \u6bcf\u4e00\u4e2aMOSUM \u8fc7\u7a0b\u7684mean\u503c\uff08\u4f8b\u5982\u8003\u8651NDMI\u6307\u6570\u65f6\uff0c\u50cf\u7d20\u7684\u6b63\u5e73\u5747\u503c\u5bf9\u5e94\u4e8e\u690d\u88ab\u7684\u589e\u52a0\uff0c\uff09\n\ntimers : dict \u662f\u4e2a\u5b57\u5178\uff0c\u5305\u542b\u62df\u5408\u8fc7\u7a0b\u4e0d\u540c\u9636\u6bb5\u7684\u8fd0\u884c\u65f6\u6d4b\u91cf\u503c\u3002\n\n\u5171\u4e09\u4e2a\n\n## use example\n\n```py\nk = 3\nfreq = 365\ntrend = False\nhfrac = 0.25\nlevel = 0.05\nstart_monitor = datetime(2010, 1, 1)\n\nmodel = BFASTMonitor(\n            start_monitor,\n            freq=freq,\n            k=k,\n            hfrac=hfrac,\n            trend=trend,\n            level=level,\n            # backend='python',\n            backend='python-ray',\n            cluster_address = \"ray://xx.xx.xx.xx:xxxxx\",\n            ray_remote_args= {\"resources\": {\"xxxx\": xx}, \"batch_size\":1}\n        )\n\n\nmodel.fit(data, dates, nan_value=-32768)\n\nbreaks = model.breaks\nmeans = model.means\ntimers = model.timers\n```\n\n\n\n\n",
    "bugtrack_url": null,
    "license": "MIT license",
    "summary": "The bfast-ray package provides a highly-efficient parallel implementation for the `Breaks For Additive Season and Trend (BFASTmonitor) proposed by Verbesselt et al. The implementation is based on Ray",
    "version": "0.0.4",
    "project_urls": {
        "Homepage": "https://github.com/benerain/bfast-ray"
    },
    "split_keywords": [
        "bfast_ray"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8c4bf164062f64bfba0637629aba58b6c10444b60a2c22fe018800ad008269e6",
                "md5": "c880e6bd7310234ec8ad8fdb14b57199",
                "sha256": "9abdb875c0615f1be0d1cae147fc69c19727c6e30cba10fbd2e214b6a5cc4b2c"
            },
            "downloads": -1,
            "filename": "bfast_ray-0.0.4-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c880e6bd7310234ec8ad8fdb14b57199",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.8",
            "size": 27492,
            "upload_time": "2023-09-01T07:38:09",
            "upload_time_iso_8601": "2023-09-01T07:38:09.011509Z",
            "url": "https://files.pythonhosted.org/packages/8c/4b/f164062f64bfba0637629aba58b6c10444b60a2c22fe018800ad008269e6/bfast_ray-0.0.4-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "80e21e0436f65e5a784eafbfe66cbe539e2a0bbdf0ae98319713502f860707b0",
                "md5": "5e9ae690a19d140d4e751864c3042e93",
                "sha256": "6df47242cf3bcc127e80ebdf19ed97d7f2fc8549e3154bb89c832d7ba4596494"
            },
            "downloads": -1,
            "filename": "bfast-ray-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "5e9ae690a19d140d4e751864c3042e93",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 28188,
            "upload_time": "2023-09-01T07:38:14",
            "upload_time_iso_8601": "2023-09-01T07:38:14.821631Z",
            "url": "https://files.pythonhosted.org/packages/80/e2/1e0436f65e5a784eafbfe66cbe539e2a0bbdf0ae98319713502f860707b0/bfast-ray-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-01 07:38:14",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "benerain",
    "github_project": "bfast-ray",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "bfast-ray"
}
        
Elapsed time: 0.18383s