Skip to main content

PriceAnomalyTracker is a Python library for detecting anomalies in time series data. Using unsupervised learning methods, it applies clustering techniques (such as K-Means and DBSCAN) and normality tests (such as the Shapiro Test) to identify anomalies in a wide range of data.

Project description

PriceAnomalyTracker

PriceAnomalyTracker é uma biblioteca Python para detecção de anomalias em séries de dados. Utilizando métodos de aprendizado não supervisionado, ela aplica técnicas de clusterização (como K-Means e DBSCAN) e testes de normalidade (como o Teste de Shapiro) para identificar anomalias em uma ampla variedade de dados.

PriceAnomalyTracker pode ser aplicado em várias áreas, incluindo finanças, detecção de fraudes, monitoramento de sensores, análise de preços de produtos e muito mais.

PriceAnomalyTracker é especialmente útil quando você precisa detectar anomalias em dados de um mesmo grupo. Por exemplo, pode ser usado para identificar preços anômalos na venda de um modelo específico de carro, onde os preços devem estar próximos e seguir uma tendência semelhante. A biblioteca é versátil o suficiente para ser aplicada em várias situações em que você deseja encontrar discrepâncias em dados que compartilham características comuns.

Instalação e Utilização

From PyPI:

pip install PriceAnomalyTracker
# Exemplo de uso para detectar anomalias em preços de um determinado produto

import PriceAnomalyTracker

data = [4250.2, 6665.5, 6665.6, 6665.56, 6135.12, 6665.6, 6672.2, 7221.1, 7221.1, 7799.0, 7852.9]

results = PriceAnomalyTracker(data)

for item in results:
    value, is_anomaly = item
    if is_anomaly:
        print(f"Anomalia detectada: {value}")
    else:
        print(f"Valor normal: {value}")

From GitHub:

!git clone https://github.com/RobertoJuniorXYZ/PriceAnomalyTracker.git
# Exemplo de uso para detectar anomalias em preços de um determinado produto

import sys
sys.path.append('PriceAnomalyTracker')

from PriceAnomalyTracker import PriceAnomalyTracker

data = [4250.2, 6665.5, 6665.6, 6665.56, 6135.12, 6665.6, 6672.2, 7221.1, 7221.1, 7799.0, 7852.9]

results = PriceAnomalyTracker(data)

for item in results:
    value, is_anomaly = item
    if is_anomaly:
        print(f"Anomalia detectada: {value}")
    else:
        print(f"Valor normal: {value}")

Parâmetros

data (Obrigatório):

Uma lista contendo os valores a serem analisados.

threshold_shapiro (Opcional):

O valor de significância para o teste de normalidade de Shapiro (padrão é 0.05).

init_clusters (Opcional):

Número máximo de clusters a serem testados no método K-Means (padrão é 10).

min_samples (Opcional):

Número mínimo de amostras para formar um cluster no DBSCAN (padrão é 2).

min_lenght (Opcional):

Comprimento mínimo dos dados para definir min_samples como metade desse valor (padrão é 5).

sense (Opcional):

Um fator para ajustar o limiar de anomalia (padrão é 1).

Contribuição

Se você encontrar algum problema ou quiser contribuir para melhorar o PriceAnomalyTracker, sinta-se à vontade para criar um problema no repositório ou enviar um pedido de pull.

Licença

The MIT License (MIT)

Copyright (c) 2023 Roberto Junior

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PriceAnomalyTracker-1.1.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

PriceAnomalyTracker-1.1.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file PriceAnomalyTracker-1.1.0.tar.gz.

File metadata

  • Download URL: PriceAnomalyTracker-1.1.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for PriceAnomalyTracker-1.1.0.tar.gz
Algorithm Hash digest
SHA256 dacadb085ef8ae22f7473847667debee21e7d505ebc836434f957e7bd3cbb5b8
MD5 ba2d4e1c49942e0ea60f017b071e9be3
BLAKE2b-256 92547d658953242c5ebd8e947cc9ac7884c42e097fe9d201a2f728e1b0f76e7e

See more details on using hashes here.

File details

Details for the file PriceAnomalyTracker-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for PriceAnomalyTracker-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 832641eca1ab3d9c215ba6c750e9f8f6f5a1deaef6ef3fc72d77213467f77c94
MD5 41b856e436fa97ead71aa8ff73fc1e3e
BLAKE2b-256 a1ee005d1d71126bb8366c1404eff55350a49b6742afd3d76c104fed45774e8a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page