add some notebooks
This commit is contained in:
parent
c69b2be56a
commit
bb4bc174cb
@ -6,13 +6,20 @@ scipy
|
||||
fastapi
|
||||
requests
|
||||
|
||||
pyFTS @ git+https://git.athene.tech/sam/pyFTS.git
|
||||
# pip install -U --force-reinstall --no-deps -e git+https://git.athene.tech/sam/pyFTS.git#egg=pyFTS
|
||||
xgboost-cpu
|
||||
# pip3 install -U --force-reinstall torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
|
||||
|
||||
scikit-learn
|
||||
keras
|
||||
tensorflow
|
||||
|
||||
darts
|
||||
|
||||
pyFTS @ git+https://git.athene.tech/sam/pyFTS.git
|
||||
# pip install -U --force-reinstall --no-deps -e git+https://git.athene.tech/sam/pyFTS.git#egg=pyFTS
|
||||
|
||||
|
||||
|
||||
influxdb-client
|
||||
|
||||
darts
|
||||
|
||||
|
84
tutorial/darts/anomaly.ipynb
Normal file
84
tutorial/darts/anomaly.ipynb
Normal file
@ -0,0 +1,84 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Anomaly Detection"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Darts"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Загрузите многомерный ряд, обрежьте его, сохраните 2 компонента, разделите поезд и наборы проверки:\n",
|
||||
"\n",
|
||||
"from darts.datasets import ETTh2Dataset\n",
|
||||
"\n",
|
||||
"series = ETTh2Dataset().load()[:10000][[\"MUFL\", \"LULL\"]]\n",
|
||||
"train, val = series.split_before(0.6)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Создайте систему оценки аномалий k-средних, \n",
|
||||
"# обучите ее на наборе поездов и используйте в проверочном наборе для получения оценок аномалий:\n",
|
||||
"\n",
|
||||
"from darts.ad import KMeansScorer\n",
|
||||
"\n",
|
||||
"scorer = KMeansScorer(k=2, window=5)\n",
|
||||
"scorer.fit(train)\n",
|
||||
"anom_score = scorer.score(val)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Создайте детектор бинарных аномалий и обучите его на основе оценок поезда, а затем используйте его на результатах проверки, чтобы получить классификацию бинарных аномалий:\n",
|
||||
"\n",
|
||||
"from darts.ad import QuantileDetector\n",
|
||||
"\n",
|
||||
"detector = QuantileDetector(high_quantile=0.99)\n",
|
||||
"detector.fit(scorer.score(train))\n",
|
||||
"binary_anom = detector.detect(anom_score)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"language_info": {
|
||||
"name": "python"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 2
|
||||
}
|
Loading…
Reference in New Issue
Block a user