sam


Namesam JSON
Version 3.1.11 PyPI version JSON
download
home_page
SummaryTime series anomaly detection and forecasting
upload_time2023-07-13 06:59:54
maintainer
docs_urlNone
author
requires_python>=3.8
licenseMIT
keywords python data-science time-series forecasting anomaly-detection asset-management
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">
    <img src="docs/source/images/logo.png" width=600><br>
</div>

# SAM

[![PyPI Latest Release](https://img.shields.io/pypi/v/sam.svg)](https://pypi.org/project/sam/)
[![Documentation Status](https://readthedocs.org/projects/sam-rhdhv/badge/?version=latest)](https://sam-rhdhv.readthedocs.io/en/latest/?badge=latest)
[![Downloads](https://static.pepy.tech/personalized-badge/sam?period=month&units=international_system&left_color=black&right_color=orange&left_text=PyPI%20downloads%20per%20month)](https://pepy.tech/project/sam)
[![License](https://img.shields.io/pypi/l/sam.svg)](https://github.com/RoyalHaskoningDHV/sam/blob/main/LICENSE)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)

SAM (Smart Asset Management) is a Python package for *timeseries analysis*, *anomaly detection* and *forecasting*.

The documentation is available on [ReadTheDocs](https://sam-rhdhv.readthedocs.io/en/latest/).

Author: [Royal HaskoningDHV](https://global.royalhaskoningdhv.com/)

Email: [ruud.kassing@rhdhv.com](mailto:ruud.kassing@rhdhv.com)

## Getting started

### Installation

The easiest way to install is package is using pip:
```
pip install sam
```

There are different optional dependencies for SAM, if you are unsure use `pip install 'sam[all]'` other options include `plotting` (just use the plotting functionality), `data_science` (all dependencies needed for a data scientist) and `data_engineering` (dependencies for data engineer).

Keep in mind that the sam package is updated frequently, and after a while, your local version may be out of date with the online documentation. To be sure, run the `pip install -U sam` command to install the latest version.

### Simple example

Below you can find a simple example on how to use one of our timeseries models. For more examples, check our [example notebooks](https://github.com/RoyalHaskoningDHV/sam/tree/main/examples)

```python
from sam.datasets import load_rainbow_beach
from sam.models import MLPTimeseriesRegressor
from sam.feature_engineering import SimpleFeatureEngineer

data = load_rainbow_beach()
X, y = data, data["water_temperature"]

# Easily create rolling and time features to be used by the model
simple_features = SimpleFeatureEngineer(
    rolling_features=[
        ("wave_height", "mean", 24),
        ("wave_height", "mean", 12),
    ],
    time_features=[
        ("hour_of_day", "cyclical"),
    ],
    keep_original=False,
)

# Define your model, see the docs for all parameters
model = MLPTimeseriesRegressor(
    predict_ahead=(1, 2, 3), # Multiple predict aheads are possible
    quantiles=(0.025, 0.975), # Predict quantile bounds for anomaly detection
    feature_engineer=simple_features,
    epochs=20,
)
model.fit(X, y)
```

### Configuration

A configuration file can be created as `.config` and should be located in your working directory. This configuration file only stores api credentials for now, but more options may be added in the future. The configuration file is parsed using the [Python3 configparser](https://docs.python.org/3/library/configparser.html), and an example configuration is shown below:

```ini
[regenradar]
url=https://rhdhv.lizard.net/api/v3/raster-aggregates/?
user=user.name
password=secret

[openweathermap]
apikey=secret
```

## Issue tracking and Feature Requests

Anyone can create feature requests or bug reports! You can browse and create new issues on GitHub: https://github.com/RoyalHaskoningDHV/sam/issues

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "sam",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "python,data-science,time-series,forecasting,anomaly-detection,asset-management",
    "author": "",
    "author_email": "Royal HaskoningDHV <ruben.peters@rhdhv.com>",
    "download_url": "https://files.pythonhosted.org/packages/77/b6/141dcd701bc2e62aca2a793495787c6ee89ae3d5a6095c76124cd9fbe81e/sam-3.1.11.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n    <img src=\"docs/source/images/logo.png\" width=600><br>\n</div>\n\n# SAM\n\n[![PyPI Latest Release](https://img.shields.io/pypi/v/sam.svg)](https://pypi.org/project/sam/)\n[![Documentation Status](https://readthedocs.org/projects/sam-rhdhv/badge/?version=latest)](https://sam-rhdhv.readthedocs.io/en/latest/?badge=latest)\n[![Downloads](https://static.pepy.tech/personalized-badge/sam?period=month&units=international_system&left_color=black&right_color=orange&left_text=PyPI%20downloads%20per%20month)](https://pepy.tech/project/sam)\n[![License](https://img.shields.io/pypi/l/sam.svg)](https://github.com/RoyalHaskoningDHV/sam/blob/main/LICENSE)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)\n\nSAM (Smart Asset Management) is a Python package for *timeseries analysis*, *anomaly detection* and *forecasting*.\n\nThe documentation is available on [ReadTheDocs](https://sam-rhdhv.readthedocs.io/en/latest/).\n\nAuthor: [Royal HaskoningDHV](https://global.royalhaskoningdhv.com/)\n\nEmail: [ruud.kassing@rhdhv.com](mailto:ruud.kassing@rhdhv.com)\n\n## Getting started\n\n### Installation\n\nThe easiest way to install is package is using pip:\n```\npip install sam\n```\n\nThere are different optional dependencies for SAM, if you are unsure use `pip install 'sam[all]'` other options include `plotting` (just use the plotting functionality), `data_science` (all dependencies needed for a data scientist) and `data_engineering` (dependencies for data engineer).\n\nKeep in mind that the sam package is updated frequently, and after a while, your local version may be out of date with the online documentation. To be sure, run the `pip install -U sam` command to install the latest version.\n\n### Simple example\n\nBelow you can find a simple example on how to use one of our timeseries models. For more examples, check our [example notebooks](https://github.com/RoyalHaskoningDHV/sam/tree/main/examples)\n\n```python\nfrom sam.datasets import load_rainbow_beach\nfrom sam.models import MLPTimeseriesRegressor\nfrom sam.feature_engineering import SimpleFeatureEngineer\n\ndata = load_rainbow_beach()\nX, y = data, data[\"water_temperature\"]\n\n# Easily create rolling and time features to be used by the model\nsimple_features = SimpleFeatureEngineer(\n    rolling_features=[\n        (\"wave_height\", \"mean\", 24),\n        (\"wave_height\", \"mean\", 12),\n    ],\n    time_features=[\n        (\"hour_of_day\", \"cyclical\"),\n    ],\n    keep_original=False,\n)\n\n# Define your model, see the docs for all parameters\nmodel = MLPTimeseriesRegressor(\n    predict_ahead=(1, 2, 3), # Multiple predict aheads are possible\n    quantiles=(0.025, 0.975), # Predict quantile bounds for anomaly detection\n    feature_engineer=simple_features,\n    epochs=20,\n)\nmodel.fit(X, y)\n```\n\n### Configuration\n\nA configuration file can be created as `.config` and should be located in your working directory. This configuration file only stores api credentials for now, but more options may be added in the future. The configuration file is parsed using the [Python3 configparser](https://docs.python.org/3/library/configparser.html), and an example configuration is shown below:\n\n```ini\n[regenradar]\nurl=https://rhdhv.lizard.net/api/v3/raster-aggregates/?\nuser=user.name\npassword=secret\n\n[openweathermap]\napikey=secret\n```\n\n## Issue tracking and Feature Requests\n\nAnyone can create feature requests or bug reports! You can browse and create new issues on GitHub: https://github.com/RoyalHaskoningDHV/sam/issues\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Time series anomaly detection and forecasting",
    "version": "3.1.11",
    "project_urls": {
        "discussions": "https://github.com/RoyalHaskoningDHV/sam/discussions",
        "documentation": "https://sam-rhdhv.readthedocs.io/en/latest/",
        "homepage": "https://github.com/RoyalHaskoningDHV/sam",
        "issues": "https://github.com/RoyalHaskoningDHV/sam/issues"
    },
    "split_keywords": [
        "python",
        "data-science",
        "time-series",
        "forecasting",
        "anomaly-detection",
        "asset-management"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b30edc20a7cce77b46cf936de3cc18e23bfd05068d9373f12b87b902ea3d0101",
                "md5": "dd601cdc86413e9c360370961bd534d2",
                "sha256": "1cc3aaa019d0a4730ffd310a6a9c9a063fd58b524ba9c28cb83d3e1b6ce8f29b"
            },
            "downloads": -1,
            "filename": "sam-3.1.11-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "dd601cdc86413e9c360370961bd534d2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 667782,
            "upload_time": "2023-07-13T06:59:52",
            "upload_time_iso_8601": "2023-07-13T06:59:52.182736Z",
            "url": "https://files.pythonhosted.org/packages/b3/0e/dc20a7cce77b46cf936de3cc18e23bfd05068d9373f12b87b902ea3d0101/sam-3.1.11-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "77b6141dcd701bc2e62aca2a793495787c6ee89ae3d5a6095c76124cd9fbe81e",
                "md5": "e956f8bc4fadc92dc7779e506262d9bd",
                "sha256": "d65ef1a55af5eac1053014ae540cd2fa198d021a96ad06cc0b657c0f02a33e44"
            },
            "downloads": -1,
            "filename": "sam-3.1.11.tar.gz",
            "has_sig": false,
            "md5_digest": "e956f8bc4fadc92dc7779e506262d9bd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 1988598,
            "upload_time": "2023-07-13T06:59:54",
            "upload_time_iso_8601": "2023-07-13T06:59:54.243129Z",
            "url": "https://files.pythonhosted.org/packages/77/b6/141dcd701bc2e62aca2a793495787c6ee89ae3d5a6095c76124cd9fbe81e/sam-3.1.11.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-13 06:59:54",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "RoyalHaskoningDHV",
    "github_project": "sam",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "sam"
}
        
Elapsed time: 0.12263s