mirror of
https://github.com/evraz-hack/ML.git
synced 2024-11-27 03:03:46 +03:00
2114 lines
234 KiB
Plaintext
2114 lines
234 KiB
Plaintext
|
{
|
|||
|
"nbformat": 4,
|
|||
|
"nbformat_minor": 0,
|
|||
|
"metadata": {
|
|||
|
"colab": {
|
|||
|
"provenance": []
|
|||
|
},
|
|||
|
"kernelspec": {
|
|||
|
"name": "python3",
|
|||
|
"display_name": "Python 3"
|
|||
|
},
|
|||
|
"language_info": {
|
|||
|
"name": "python"
|
|||
|
}
|
|||
|
},
|
|||
|
"cells": [
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"from google.colab import drive\n",
|
|||
|
"drive.mount('/content/drive')"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"id": "2o-B9SBpv8a3",
|
|||
|
"colab": {
|
|||
|
"base_uri": "https://localhost:8080/"
|
|||
|
},
|
|||
|
"outputId": "5fb6484f-9284-4bfa-fa03-41aa2414ba39"
|
|||
|
},
|
|||
|
"execution_count": 2,
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"output_type": "stream",
|
|||
|
"name": "stdout",
|
|||
|
"text": [
|
|||
|
"Mounted at /content/drive\n"
|
|||
|
]
|
|||
|
}
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"execution_count": 3,
|
|||
|
"metadata": {
|
|||
|
"id": "2lr6h9SKvcqA",
|
|||
|
"colab": {
|
|||
|
"base_uri": "https://localhost:8080/"
|
|||
|
},
|
|||
|
"outputId": "6d57a97c-76c0-4292-fc98-4fcc41b1ca71"
|
|||
|
},
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"output_type": "stream",
|
|||
|
"name": "stdout",
|
|||
|
"text": [
|
|||
|
"/content/drive/MyDrive/AI/euro\n",
|
|||
|
"1.csv 2.csv 3.csv 4.csv 5.csv 6.csv a.json forecasting.ipynb\n",
|
|||
|
"1.txt 2.txt 3.txt 4.txt 5.txt 6.txt b.json\n"
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"source": [
|
|||
|
"%cd /content/drive/MyDrive/AI/euro\n",
|
|||
|
"!ls"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"import glob\n",
|
|||
|
"map = open('1.txt', 'r').read()\n",
|
|||
|
"m = eval(map)\n",
|
|||
|
"\n",
|
|||
|
"mapping = {}\n",
|
|||
|
"for el in m:\n",
|
|||
|
" if el[2] == 'Уставки':\n",
|
|||
|
" name = el[0] + ' ' + el[1] + ' ' + col_name + ' ' + el[3] \n",
|
|||
|
" else:\n",
|
|||
|
" name = el[0] + ' ' + el[1] + ' ' + el[2] + ' ' + el[3] \n",
|
|||
|
" col_name = el[2]\n",
|
|||
|
" mapping[''.join([x for x in el[4] if x != '\\\\'])] = name\n",
|
|||
|
"\n",
|
|||
|
"len(mapping.keys())"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"colab": {
|
|||
|
"base_uri": "https://localhost:8080/"
|
|||
|
},
|
|||
|
"id": "PgBn5DC1Tdy3",
|
|||
|
"outputId": "ed2e056d-1d27-48c3-8244-b467c8d4dd7c"
|
|||
|
},
|
|||
|
"execution_count": 138,
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"output_type": "execute_result",
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"121"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"execution_count": 138
|
|||
|
}
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"import json\n",
|
|||
|
"json.dump(mapping, open('mapping.json', 'w'))"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"id": "AG2jcZAlIw8F"
|
|||
|
},
|
|||
|
"execution_count": 330,
|
|||
|
"outputs": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"import pandas as pd\n",
|
|||
|
"import numpy as np\n",
|
|||
|
"import sklearn\n",
|
|||
|
"import matplotlib.pyplot as plt\n",
|
|||
|
"import seaborn as sns\n",
|
|||
|
"from tqdm import tqdm"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"id": "kMCQhNUixBoX"
|
|||
|
},
|
|||
|
"execution_count": 139,
|
|||
|
"outputs": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"df = pd.read_csv('1.csv', parse_dates=['timestamp'])\n",
|
|||
|
"df.columns= ['timestamp'] + [''.join([x for x in el if x != '\\\\']) for el in df.columns if el != 'timestamp']\n",
|
|||
|
"df = df.rename(columns=mapping)\n",
|
|||
|
"df = df.set_index('timestamp').resample('5T').first().reset_index()\n",
|
|||
|
"df"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"id": "xU89tPEKxJKW"
|
|||
|
},
|
|||
|
"execution_count": 243,
|
|||
|
"outputs": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"import pandas as pd\n",
|
|||
|
"import numpy as np\n",
|
|||
|
"import matplotlib.pyplot as plt\n",
|
|||
|
"from statsmodels.tsa.stattools import adfuller\n",
|
|||
|
"from statsmodels.graphics.tsaplots import plot_acf, plot_pacf\n",
|
|||
|
"from statsmodels.tsa.arima.model import ARIMA"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"id": "p-0xx_BzrUpC"
|
|||
|
},
|
|||
|
"execution_count": 129,
|
|||
|
"outputs": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"df.columns[70:110]"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"id": "mYCmqxhFakGu"
|
|||
|
},
|
|||
|
"execution_count": null,
|
|||
|
"outputs": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"from datetime import datetime, timedelta\n",
|
|||
|
"\n",
|
|||
|
"# создание списка с датами\n",
|
|||
|
"date_list = [df['timestamp'].min() + timedelta(minutes=x) for x in range(0, 60*24*60*60, 15)]\n",
|
|||
|
"\n",
|
|||
|
"len(date_list)\n",
|
|||
|
"\n",
|
|||
|
"df = df[df['timestamp'].isin(date_list)]\n",
|
|||
|
"df.shape"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"id": "aiH2Yt5jefeY"
|
|||
|
},
|
|||
|
"execution_count": 132,
|
|||
|
"outputs": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"df = df.set_index('timestamp').resample('5T').first().reset_index()\n",
|
|||
|
"df"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"colab": {
|
|||
|
"base_uri": "https://localhost:8080/",
|
|||
|
"height": 748
|
|||
|
},
|
|||
|
"id": "D4jyD4bwj2xT",
|
|||
|
"outputId": "20590b8c-7cc6-4584-927d-1798e98ad85d"
|
|||
|
},
|
|||
|
"execution_count": 245,
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"output_type": "execute_result",
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
" timestamp \\\n",
|
|||
|
"0 2023-01-25 09:30:00 \n",
|
|||
|
"1 2023-01-25 09:35:00 \n",
|
|||
|
"2 2023-01-25 09:40:00 \n",
|
|||
|
"3 2023-01-25 09:45:00 \n",
|
|||
|
"4 2023-01-25 09:50:00 \n",
|
|||
|
"... ... \n",
|
|||
|
"6642 2023-02-17 11:00:00 \n",
|
|||
|
"6643 2023-02-17 11:05:00 \n",
|
|||
|
"6644 2023-02-17 11:10:00 \n",
|
|||
|
"6645 2023-02-17 11:15:00 \n",
|
|||
|
"6646 2023-02-17 11:20:00 \n",
|
|||
|
"\n",
|
|||
|
" Подшипник 1 Температура нагрева Температура temperature \\\n",
|
|||
|
"0 62.800003 \n",
|
|||
|
"1 62.800003 \n",
|
|||
|
"2 62.800003 \n",
|
|||
|
"3 62.800003 \n",
|
|||
|
"4 62.800003 \n",
|
|||
|
"... ... \n",
|
|||
|
"6642 61.800003 \n",
|
|||
|
"6643 61.800003 \n",
|
|||
|
"6644 61.800003 \n",
|
|||
|
"6645 61.899994 \n",
|
|||
|
"6646 61.899994 \n",
|
|||
|
"\n",
|
|||
|
" Подшипник 1 Температура нагрева Температура alarm_max \\\n",
|
|||
|
"0 75.0 \n",
|
|||
|
"1 75.0 \n",
|
|||
|
"2 75.0 \n",
|
|||
|
"3 75.0 \n",
|
|||
|
"4 75.0 \n",
|
|||
|
"... ... \n",
|
|||
|
"6642 75.0 \n",
|
|||
|
"6643 75.0 \n",
|
|||
|
"6644 75.0 \n",
|
|||
|
"6645 75.0 \n",
|
|||
|
"6646 75.0 \n",
|
|||
|
"\n",
|
|||
|
" Подшипник 1 Температура нагрева Температура alarm_min \\\n",
|
|||
|
"0 0.0 \n",
|
|||
|
"1 0.0 \n",
|
|||
|
"2 0.0 \n",
|
|||
|
"3 0.0 \n",
|
|||
|
"4 0.0 \n",
|
|||
|
"... ... \n",
|
|||
|
"6642 0.0 \n",
|
|||
|
"6643 0.0 \n",
|
|||
|
"6644 0.0 \n",
|
|||
|
"6645 0.0 \n",
|
|||
|
"6646 0.0 \n",
|
|||
|
"\n",
|
|||
|
" Подшипник 1 Температура нагрева Температура warning_max \\\n",
|
|||
|
"0 65.0 \n",
|
|||
|
"1 65.0 \n",
|
|||
|
"2 65.0 \n",
|
|||
|
"3 65.0 \n",
|
|||
|
"4 65.0 \n",
|
|||
|
"... ... \n",
|
|||
|
"6642 65.0 \n",
|
|||
|
"6643 65.0 \n",
|
|||
|
"6644 65.0 \n",
|
|||
|
"6645 65.0 \n",
|
|||
|
"6646 65.0 \n",
|
|||
|
"\n",
|
|||
|
" Подшипник 1 Температура нагрева Температура warning_min \\\n",
|
|||
|
"0 0.0 \n",
|
|||
|
"1 0.0 \n",
|
|||
|
"2 0.0 \n",
|
|||
|
"3 0.0 \n",
|
|||
|
"4 0.0 \n",
|
|||
|
"... ... \n",
|
|||
|
"6642 0.0 \n",
|
|||
|
"6643 0.0 \n",
|
|||
|
"6644 0.0 \n",
|
|||
|
"6645 0.0 \n",
|
|||
|
"6646 0.0 \n",
|
|||
|
"\n",
|
|||
|
" Подшипник 1 Вибрация Осевая vibration_axial \\\n",
|
|||
|
"0 0.381944 \n",
|
|||
|
"1 0.381944 \n",
|
|||
|
"2 0.387731 \n",
|
|||
|
"3 0.381944 \n",
|
|||
|
"4 0.381944 \n",
|
|||
|
"... ... \n",
|
|||
|
"6642 0.243056 \n",
|
|||
|
"6643 0.254630 \n",
|
|||
|
"6644 0.254630 \n",
|
|||
|
"6645 0.254630 \n",
|
|||
|
"6646 0.254630 \n",
|
|||
|
"\n",
|
|||
|
" Подшипник 1 Вибрация Осевая alarm_max \\\n",
|
|||
|
"0 7.1 \n",
|
|||
|
"1 7.1 \n",
|
|||
|
"2 7.1 \n",
|
|||
|
"3 7.1 \n",
|
|||
|
"4 7.1 \n",
|
|||
|
"... ... \n",
|
|||
|
"6642 7.1 \n",
|
|||
|
"6643 7.1 \n",
|
|||
|
"6644 7.1 \n",
|
|||
|
"6645 7.1 \n",
|
|||
|
"6646 7.1 \n",
|
|||
|
"\n",
|
|||
|
" Подшипник 1 Вибрация Осевая alarm_min \\\n",
|
|||
|
"0 0.0 \n",
|
|||
|
"1 0.0 \n",
|
|||
|
"2 0.0 \n",
|
|||
|
"3 0.0 \n",
|
|||
|
"4 0.0 \n",
|
|||
|
"... ... \n",
|
|||
|
"6642 0.0 \n",
|
|||
|
"6643 0.0 \n",
|
|||
|
"6644 0.0 \n",
|
|||
|
"6645 0.0 \n",
|
|||
|
"6646 0.0 \n",
|
|||
|
"\n",
|
|||
|
" Подшипник 1 Вибрация Осевая warning_max ... \\\n",
|
|||
|
"0 4.5 ... \n",
|
|||
|
"1 4.5 ... \n",
|
|||
|
"2 4.5 ... \n",
|
|||
|
"3 4.5 ... \n",
|
|||
|
"4 4.5 ... \n",
|
|||
|
"... ... ... \n",
|
|||
|
"6642 4.5 ... \n",
|
|||
|
"6643 4.5 ... \n",
|
|||
|
"6644 4.5 ... \n",
|
|||
|
"6645 4.5 ... \n",
|
|||
|
"6646 4.5 ... \n",
|
|||
|
"\n",
|
|||
|
" Положение задвижки gas_valve_closed \\\n",
|
|||
|
"0 0.0 \n",
|
|||
|
"1 0.0 \n",
|
|||
|
"2 0.0 \n",
|
|||
|
"3 0.0 \n",
|
|||
|
"4 0.0 \n",
|
|||
|
"... ... \n",
|
|||
|
"6642 0.0 \n",
|
|||
|
"6643 0.0 \n",
|
|||
|
"6644 0.0 \n",
|
|||
|
"6645 0.0 \n",
|
|||
|
"6646 0.0 \n",
|
|||
|
"\n",
|
|||
|
" Положение задвижки gas_valve_open \\\n",
|
|||
|
"0 1.0 \n",
|
|||
|
"1 1.0 \n",
|
|||
|
"2 1.0 \n",
|
|||
|
"3 1.0 \n",
|
|||
|
"4 1.0 \n",
|
|||
|
"... ... \n",
|
|||
|
"6642 1.0 \n",
|
|||
|
"6643 1.0 \n",
|
|||
|
"6644 1.0 \n",
|
|||
|
"6645 1.0 \n",
|
|||
|
"6646 1.0 \n",
|
|||
|
"\n",
|
|||
|
" Положение задвижки gas_valve_position Главный привод rotor_current \\\n",
|
|||
|
"0 0.0 1.0 \n",
|
|||
|
"1 0.0 1.0 \n",
|
|||
|
"2 0.0 1.0 \n",
|
|||
|
"3 0.0 1.0 \n",
|
|||
|
"4 0.0 1.0 \n",
|
|||
|
"... ... ... \n",
|
|||
|
"6642 0.0 1.0 \n",
|
|||
|
"6643 0.0 1.0 \n",
|
|||
|
"6644 0.0 1.0 \n",
|
|||
|
"6645 0.0 1.0 \n",
|
|||
|
"6646 0.0 1.0 \n",
|
|||
|
"\n",
|
|||
|
" Главный привод rotor_voltage Главный привод stator_current \\\n",
|
|||
|
"0 0.0 180.850937 \n",
|
|||
|
"1 0.0 184.624741 \n",
|
|||
|
"2 0.0 179.877045 \n",
|
|||
|
"3 0.0 182.871750 \n",
|
|||
|
"4 0.0 180.802231 \n",
|
|||
|
"... ... ... \n",
|
|||
|
"6642 0.0 184.089111 \n",
|
|||
|
"6643 0.0 182.725662 \n",
|
|||
|
"6644 0.0 185.817764 \n",
|
|||
|
"6645 0.0 184.770828 \n",
|
|||
|
"6646 0.0 183.675201 \n",
|
|||
|
"\n",
|
|||
|
" Главный привод stator_voltage Маслосистема oil_level \\\n",
|
|||
|
"0 1.0 83.547989 \n",
|
|||
|
"1 1.0 83.452797 \n",
|
|||
|
"2 1.0 83.631989 \n",
|
|||
|
"3 1.0 83.525589 \n",
|
|||
|
"4 1.0 83.475189 \n",
|
|||
|
"... ... ... \n",
|
|||
|
"6642 1.0 78.676224 \n",
|
|||
|
"6643 1.0 78.564224 \n",
|
|||
|
"6644 1.0 78.799423 \n",
|
|||
|
"6645 1.0 78.357040 \n",
|
|||
|
"6646 1.0 78.726616 \n",
|
|||
|
"\n",
|
|||
|
" Маслосистема oil_pressure Работа эксгаустера work \n",
|
|||
|
"0 2.156743 1.0 \n",
|
|||
|
"1 2.145085 1.0 \n",
|
|||
|
"2 2.151311 1.0 \n",
|
|||
|
"3 2.159490 1.0 \n",
|
|||
|
"4 2.153874 1.0 \n",
|
|||
|
"... ... ... \n",
|
|||
|
"6642 2.147954 1.0 \n",
|
|||
|
"6643 2.151006 1.0 \n",
|
|||
|
"6644 2.154912 1.0 \n",
|
|||
|
"6645 2.149358 1.0 \n",
|
|||
|
"6646 2.145085 1.0 \n",
|
|||
|
"\n",
|
|||
|
"[6647 rows x 122 columns]"
|
|||
|
],
|
|||
|
"text/html": [
|
|||
|
"\n",
|
|||
|
" <div id=\"df-476dacc1-46a6-430f-adc7-40ce590876c7\">\n",
|
|||
|
" <div class=\"colab-df-container\">\n",
|
|||
|
" <div>\n",
|
|||
|
"<style scoped>\n",
|
|||
|
" .dataframe tbody tr th:only-of-type {\n",
|
|||
|
" vertical-align: middle;\n",
|
|||
|
" }\n",
|
|||
|
"\n",
|
|||
|
" .dataframe tbody tr th {\n",
|
|||
|
" vertical-align: top;\n",
|
|||
|
" }\n",
|
|||
|
"\n",
|
|||
|
" .dataframe thead th {\n",
|
|||
|
" text-align: right;\n",
|
|||
|
" }\n",
|
|||
|
"</style>\n",
|
|||
|
"<table border=\"1\" class=\"dataframe\">\n",
|
|||
|
" <thead>\n",
|
|||
|
" <tr style=\"text-align: right;\">\n",
|
|||
|
" <th></th>\n",
|
|||
|
" <th>timestamp</th>\n",
|
|||
|
" <th>Подшипник 1 Температура нагрева Температура temperature</th>\n",
|
|||
|
" <th>Подшипник 1 Температура нагрева Температура alarm_max</th>\n",
|
|||
|
" <th>Подшипник 1 Температура нагрева Температура alarm_min</th>\n",
|
|||
|
" <th>Подшипник 1 Температура нагрева Температура warning_max</th>\n",
|
|||
|
" <th>Подшипник 1 Температура нагрева Температура warning_min</th>\n",
|
|||
|
" <th>Подшипник 1 Вибрация Осевая vibration_axial</th>\n",
|
|||
|
" <th>Подшипник 1 Вибрация Осевая alarm_max</th>\n",
|
|||
|
" <th>Подшипник 1 Вибрация Осевая alarm_min</th>\n",
|
|||
|
" <th>Подшипник 1 Вибрация Осевая warning_max</th>\n",
|
|||
|
" <th>...</th>\n",
|
|||
|
" <th>Положение задвижки gas_valve_closed</th>\n",
|
|||
|
" <th>Положение задвижки gas_valve_open</th>\n",
|
|||
|
" <th>Положение задвижки gas_valve_position</th>\n",
|
|||
|
" <th>Главный привод rotor_current</th>\n",
|
|||
|
" <th>Главный привод rotor_voltage</th>\n",
|
|||
|
" <th>Главный привод stator_current</th>\n",
|
|||
|
" <th>Главный привод stator_voltage</th>\n",
|
|||
|
" <th>Маслосистема oil_level</th>\n",
|
|||
|
" <th>Маслосистема oil_pressure</th>\n",
|
|||
|
" <th>Работа эксгаустера work</th>\n",
|
|||
|
" </tr>\n",
|
|||
|
" </thead>\n",
|
|||
|
" <tbody>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>0</th>\n",
|
|||
|
" <td>2023-01-25 09:30:00</td>\n",
|
|||
|
" <td>62.800003</td>\n",
|
|||
|
" <td>75.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>65.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>0.381944</td>\n",
|
|||
|
" <td>7.1</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>4.5</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>180.850937</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" <td>83.547989</td>\n",
|
|||
|
" <td>2.156743</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>1</th>\n",
|
|||
|
" <td>2023-01-25 09:35:00</td>\n",
|
|||
|
" <td>62.800003</td>\n",
|
|||
|
" <td>75.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>65.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>0.381944</td>\n",
|
|||
|
" <td>7.1</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>4.5</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>184.624741</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" <td>83.452797</td>\n",
|
|||
|
" <td>2.145085</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>2</th>\n",
|
|||
|
" <td>2023-01-25 09:40:00</td>\n",
|
|||
|
" <td>62.800003</td>\n",
|
|||
|
" <td>75.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>65.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>0.387731</td>\n",
|
|||
|
" <td>7.1</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>4.5</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>179.877045</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" <td>83.631989</td>\n",
|
|||
|
" <td>2.151311</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>3</th>\n",
|
|||
|
" <td>2023-01-25 09:45:00</td>\n",
|
|||
|
" <td>62.800003</td>\n",
|
|||
|
" <td>75.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>65.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>0.381944</td>\n",
|
|||
|
" <td>7.1</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>4.5</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>182.871750</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" <td>83.525589</td>\n",
|
|||
|
" <td>2.159490</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>4</th>\n",
|
|||
|
" <td>2023-01-25 09:50:00</td>\n",
|
|||
|
" <td>62.800003</td>\n",
|
|||
|
" <td>75.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>65.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>0.381944</td>\n",
|
|||
|
" <td>7.1</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>4.5</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>180.802231</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" <td>83.475189</td>\n",
|
|||
|
" <td>2.153874</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>...</th>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>6642</th>\n",
|
|||
|
" <td>2023-02-17 11:00:00</td>\n",
|
|||
|
" <td>61.800003</td>\n",
|
|||
|
" <td>75.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>65.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>0.243056</td>\n",
|
|||
|
" <td>7.1</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>4.5</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>184.089111</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" <td>78.676224</td>\n",
|
|||
|
" <td>2.147954</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>6643</th>\n",
|
|||
|
" <td>2023-02-17 11:05:00</td>\n",
|
|||
|
" <td>61.800003</td>\n",
|
|||
|
" <td>75.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>65.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>0.254630</td>\n",
|
|||
|
" <td>7.1</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>4.5</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>182.725662</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" <td>78.564224</td>\n",
|
|||
|
" <td>2.151006</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>6644</th>\n",
|
|||
|
" <td>2023-02-17 11:10:00</td>\n",
|
|||
|
" <td>61.800003</td>\n",
|
|||
|
" <td>75.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>65.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>0.254630</td>\n",
|
|||
|
" <td>7.1</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>4.5</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>185.817764</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" <td>78.799423</td>\n",
|
|||
|
" <td>2.154912</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>6645</th>\n",
|
|||
|
" <td>2023-02-17 11:15:00</td>\n",
|
|||
|
" <td>61.899994</td>\n",
|
|||
|
" <td>75.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>65.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>0.254630</td>\n",
|
|||
|
" <td>7.1</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>4.5</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>184.770828</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" <td>78.357040</td>\n",
|
|||
|
" <td>2.149358</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" <tr>\n",
|
|||
|
" <th>6646</th>\n",
|
|||
|
" <td>2023-02-17 11:20:00</td>\n",
|
|||
|
" <td>61.899994</td>\n",
|
|||
|
" <td>75.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>65.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>0.254630</td>\n",
|
|||
|
" <td>7.1</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>4.5</td>\n",
|
|||
|
" <td>...</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" <td>0.0</td>\n",
|
|||
|
" <td>183.675201</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" <td>78.726616</td>\n",
|
|||
|
" <td>2.145085</td>\n",
|
|||
|
" <td>1.0</td>\n",
|
|||
|
" </tr>\n",
|
|||
|
" </tbody>\n",
|
|||
|
"</table>\n",
|
|||
|
"<p>6647 rows × 122 columns</p>\n",
|
|||
|
"</div>\n",
|
|||
|
" <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-476dacc1-46a6-430f-adc7-40ce590876c7')\"\n",
|
|||
|
" title=\"Convert this dataframe to an interactive table.\"\n",
|
|||
|
" style=\"display:none;\">\n",
|
|||
|
" \n",
|
|||
|
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
|
|||
|
" width=\"24px\">\n",
|
|||
|
" <path d=\"M0 0h24v24H0V0z\" fill=\"none\"/>\n",
|
|||
|
" <path d=\"M18.56 5.44l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94zm-11 1L8.5 8.5l.94-2.06 2.06-.94-2.06-.94L8.5 2.5l-.94 2.06-2.06.94zm10 10l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94z\"/><path d=\"M17.41 7.96l-1.37-1.37c-.4-.4-.92-.59-1.43-.59-.52 0-1.04.2-1.43.59L10.3 9.45l-7.72 7.72c-.78.78-.78 2.05 0 2.83L4 21.41c.39.39.9.59 1.41.59.51 0 1.02-.2 1.41-.59l7.78-7.78 2.81-2.81c.8-.78.8-2.07 0-2.86zM5.41 20L4 18.59l7.72-7.72 1.47 1.35L5.41 20z\"/>\n",
|
|||
|
" </svg>\n",
|
|||
|
" </button>\n",
|
|||
|
" \n",
|
|||
|
" <style>\n",
|
|||
|
" .colab-df-container {\n",
|
|||
|
" display:flex;\n",
|
|||
|
" flex-wrap:wrap;\n",
|
|||
|
" gap: 12px;\n",
|
|||
|
" }\n",
|
|||
|
"\n",
|
|||
|
" .colab-df-convert {\n",
|
|||
|
" background-color: #E8F0FE;\n",
|
|||
|
" border: none;\n",
|
|||
|
" border-radius: 50%;\n",
|
|||
|
" cursor: pointer;\n",
|
|||
|
" display: none;\n",
|
|||
|
" fill: #1967D2;\n",
|
|||
|
" height: 32px;\n",
|
|||
|
" padding: 0 0 0 0;\n",
|
|||
|
" width: 32px;\n",
|
|||
|
" }\n",
|
|||
|
"\n",
|
|||
|
" .colab-df-convert:hover {\n",
|
|||
|
" background-color: #E2EBFA;\n",
|
|||
|
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
|
|||
|
" fill: #174EA6;\n",
|
|||
|
" }\n",
|
|||
|
"\n",
|
|||
|
" [theme=dark] .colab-df-convert {\n",
|
|||
|
" background-color: #3B4455;\n",
|
|||
|
" fill: #D2E3FC;\n",
|
|||
|
" }\n",
|
|||
|
"\n",
|
|||
|
" [theme=dark] .colab-df-convert:hover {\n",
|
|||
|
" background-color: #434B5C;\n",
|
|||
|
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
|
|||
|
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
|
|||
|
" fill: #FFFFFF;\n",
|
|||
|
" }\n",
|
|||
|
" </style>\n",
|
|||
|
"\n",
|
|||
|
" <script>\n",
|
|||
|
" const buttonEl =\n",
|
|||
|
" document.querySelector('#df-476dacc1-46a6-430f-adc7-40ce590876c7 button.colab-df-convert');\n",
|
|||
|
" buttonEl.style.display =\n",
|
|||
|
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
|
|||
|
"\n",
|
|||
|
" async function convertToInteractive(key) {\n",
|
|||
|
" const element = document.querySelector('#df-476dacc1-46a6-430f-adc7-40ce590876c7');\n",
|
|||
|
" const dataTable =\n",
|
|||
|
" await google.colab.kernel.invokeFunction('convertToInteractive',\n",
|
|||
|
" [key], {});\n",
|
|||
|
" if (!dataTable) return;\n",
|
|||
|
"\n",
|
|||
|
" const docLinkHtml = 'Like what you see? Visit the ' +\n",
|
|||
|
" '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
|
|||
|
" + ' to learn more about interactive tables.';\n",
|
|||
|
" element.innerHTML = '';\n",
|
|||
|
" dataTable['output_type'] = 'display_data';\n",
|
|||
|
" await google.colab.output.renderOutput(dataTable, element);\n",
|
|||
|
" const docLink = document.createElement('div');\n",
|
|||
|
" docLink.innerHTML = docLinkHtml;\n",
|
|||
|
" element.appendChild(docLink);\n",
|
|||
|
" }\n",
|
|||
|
" </script>\n",
|
|||
|
" </div>\n",
|
|||
|
" </div>\n",
|
|||
|
" "
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"execution_count": 245
|
|||
|
}
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"mapping"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"colab": {
|
|||
|
"base_uri": "https://localhost:8080/"
|
|||
|
},
|
|||
|
"id": "ooZkqUT7kWDn",
|
|||
|
"outputId": "2c87107a-7ab4-4ff8-ff0b-2925e9c409f6"
|
|||
|
},
|
|||
|
"execution_count": 331,
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"output_type": "execute_result",
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"{'SM_Exgauster[2:27]': 'Подшипник 1 Температура нагрева Температура temperature',\n",
|
|||
|
" 'SM_Exgauster[2:65]': 'Подшипник 1 Температура нагрева Температура alarm_max',\n",
|
|||
|
" 'SM_Exgauster[2:74]': 'Подшипник 1 Температура нагрева Температура alarm_min',\n",
|
|||
|
" 'SM_Exgauster[2:83]': 'Подшипник 1 Температура нагрева Температура warning_max',\n",
|
|||
|
" 'SM_Exgauster[2:92]': 'Подшипник 1 Температура нагрева Температура warning_min',\n",
|
|||
|
" 'SM_Exgauster[2:2]': 'Подшипник 1 Вибрация Осевая vibration_axial',\n",
|
|||
|
" 'SM_Exgauster[2:139]': 'Подшипник 1 Вибрация Осевая alarm_max',\n",
|
|||
|
" 'SM_Exgauster[2:151]': 'Подшипник 1 Вибрация Осевая alarm_min',\n",
|
|||
|
" 'SM_Exgauster[2:163]': 'Подшипник 1 Вибрация Осевая warning_max',\n",
|
|||
|
" 'SM_Exgauster[2:175]': 'Подшипник 1 Вибрация Осевая warning_min',\n",
|
|||
|
" 'SM_Exgauster[2:0]': 'Подшипник 1 Вибрация Горизонтальная vibration_horizontal',\n",
|
|||
|
" 'SM_Exgauster[2:137]': 'Подшипник 1 Вибрация Горизонтальная alarm_max',\n",
|
|||
|
" 'SM_Exgauster[2:149]': 'Подшипник 1 Вибрация Горизонтальная alarm_min',\n",
|
|||
|
" 'SM_Exgauster[2:161]': 'Подшипник 1 Вибрация Горизонтальная warning_max',\n",
|
|||
|
" 'SM_Exgauster[2:173]': 'Подшипник 1 Вибрация Горизонтальная warning_min',\n",
|
|||
|
" 'SM_Exgauster[2:1]': 'Подшипник 1 Вибрация Вертикальная vibration_vertical',\n",
|
|||
|
" 'SM_Exgauster[2:138]': 'Подшипник 1 Вибрация Вертикальная alarm_max',\n",
|
|||
|
" 'SM_Exgauster[2:150]': 'Подшипник 1 Вибрация Вертикальная alarm_min',\n",
|
|||
|
" 'SM_Exgauster[2:162]': 'Подшипник 1 Вибрация Вертикальная warning_max',\n",
|
|||
|
" 'SM_Exgauster[2:174]': 'Подшипник 1 Вибрация Вертикальная warning_min',\n",
|
|||
|
" 'SM_Exgauster[2:28]': 'Подшипник 2 Температура нагрева Температура temperature',\n",
|
|||
|
" 'SM_Exgauster[2:66]': 'Подшипник 2 Температура нагрева Температура alarm_max',\n",
|
|||
|
" 'SM_Exgauster[2:75]': 'Подшипник 2 Температура нагрева Температура alarm_min',\n",
|
|||
|
" 'SM_Exgauster[2:84]': 'Подшипник 2 Температура нагрева Температура warning_max',\n",
|
|||
|
" 'SM_Exgauster[2:93]': 'Подшипник 2 Температура нагрева Температура warning_min',\n",
|
|||
|
" 'SM_Exgauster[2:5]': 'Подшипник 2 Вибрация Осевая vibration_axial',\n",
|
|||
|
" 'SM_Exgauster[2:142]': 'Подшипник 2 Вибрация Осевая alarm_max',\n",
|
|||
|
" 'SM_Exgauster[2:154]': 'Подшипник 2 Вибрация Осевая alarm_min',\n",
|
|||
|
" 'SM_Exgauster[2:166]': 'Подшипник 2 Вибрация Осевая warning_max',\n",
|
|||
|
" 'SM_Exgauster[2:178]': 'Подшипник 2 Вибрация Осевая warning_min',\n",
|
|||
|
" 'SM_Exgauster[2:3]': 'Подшипник 2 Вибрация Горизонтальная vibration_horizontal',\n",
|
|||
|
" 'SM_Exgauster[2:140]': 'Подшипник 2 Вибрация Горизонтальная alarm_max',\n",
|
|||
|
" 'SM_Exgauster[2:152]': 'Подшипник 2 Вибрация Горизонтальная alarm_min',\n",
|
|||
|
" 'SM_Exgauster[2:164]': 'Подшипник 2 Вибрация Горизонтальная warning_max',\n",
|
|||
|
" 'SM_Exgauster[2:176]': 'Подшипник 2 Вибрация Горизонтальная warning_min',\n",
|
|||
|
" 'SM_Exgauster[2:4]': 'Подшипник 2 Вибрация Вертикальная vibration_vertical',\n",
|
|||
|
" 'SM_Exgauster[2:141]': 'Подшипник 2 Вибрация Вертикальная alarm_max',\n",
|
|||
|
" 'SM_Exgauster[2:153]': 'Подшипник 2 Вибрация Вертикальная alarm_min',\n",
|
|||
|
" 'SM_Exgauster[2:165]': 'Подшипник 2 Вибрация Вертикальная warning_max',\n",
|
|||
|
" 'SM_Exgauster[2:177]': 'Подшипник 2 Вибрация Вертикальная warning_min',\n",
|
|||
|
" 'SM_Exgauster[2:29]': 'Подшипник 3 Температура нагрева Температура temperature',\n",
|
|||
|
" 'SM_Exgauster[2:67]': 'Подшипник 3 Температура нагрева Температура alarm_max',\n",
|
|||
|
" 'SM_Exgauster[2:76]': 'Подшипник 3 Температура нагрева Температура alarm_min',\n",
|
|||
|
" 'SM_Exgauster[2:85]': 'Подшипник 3 Температура нагрева Температура warning_max',\n",
|
|||
|
" 'SM_Exgauster[2:94]': 'Подшипник 3 Температура нагрева Температура warning_min',\n",
|
|||
|
" 'SM_Exgauster[2:30]': 'Подшипник 4 Температура нагрева Температура temperature',\n",
|
|||
|
" 'SM_Exgauster[2:68]': 'Подшипник 4 Температура нагрева Температура alarm_max',\n",
|
|||
|
" 'SM_Exgauster[2:77]': 'Подшипник 4 Температура нагрева Температура alarm_min',\n",
|
|||
|
" 'SM_Exgauster[2:86]': 'Подшипник 4 Температура нагрева Температура warning_max',\n",
|
|||
|
" 'SM_Exgauster[2:95]': 'Подшипник 4 Температура нагрева Температура warning_min',\n",
|
|||
|
" 'SM_Exgauster[2:31]': 'Подшипник 5 Температура нагрева Температура temperature',\n",
|
|||
|
" 'SM_Exgauster[2:69]': 'Подшипник 5 Температура нагрева Температура alarm_max',\n",
|
|||
|
" 'SM_Exgauster[2:78]': 'Подшипник 5 Температура нагрева Температура alarm_min',\n",
|
|||
|
" 'SM_Exgauster[2:87]': 'Подшипник 5 Температура нагрева Температура warning_max',\n",
|
|||
|
" 'SM_Exgauster[2:96]': 'Подшипник 5 Температура нагрева Температура warning_min',\n",
|
|||
|
" 'SM_Exgauster[2:32]': 'Подшипник 6 Температура нагрева Температура temperature',\n",
|
|||
|
" 'SM_Exgauster[2:70]': 'Подшипник 6 Температура нагрева Температура alarm_max',\n",
|
|||
|
" 'SM_Exgauster[2:79]': 'Подшипник 6 Температура нагрева Температура alarm_min',\n",
|
|||
|
" 'SM_Exgauster[2:88]': 'Подшипник 6 Температура нагрева Температура warning_max',\n",
|
|||
|
" 'SM_Exgauster[2:97]': 'Подшипник 6 Температура нагрева Температура warning_min',\n",
|
|||
|
" 'SM_Exgauster[2:33]': 'Подшипник 7 Температура нагрева Температура temperature',\n",
|
|||
|
" 'SM_Exgauster[2:71]': 'Подшипник 7 Температура нагрева Температура alarm_max',\n",
|
|||
|
" 'SM_Exgauster[2:80]': 'Подшипник 7 Температура нагрева Температура alarm_min',\n",
|
|||
|
" 'SM_Exgauster[2:89]': 'Подшипник 7 Температура нагрева Температура warning_max',\n",
|
|||
|
" 'SM_Exgauster[2:98]': 'Подшипник 7 Температура нагрева Температура warning_min',\n",
|
|||
|
" 'SM_Exgauster[2:8]': 'Подшипник 7 Вибрация Осевая vibration_axial',\n",
|
|||
|
" 'SM_Exgauster[2:145]': 'Подшипник 7 Вибрация Осевая alarm_max',\n",
|
|||
|
" 'SM_Exgauster[2:157]': 'Подшипник 7 Вибрация Осевая alarm_min',\n",
|
|||
|
" 'SM_Exgauster[2:169]': 'Подшипник 7 Вибрация Осевая warning_max',\n",
|
|||
|
" 'SM_Exgauster[2:181]': 'Подшипник 7 Вибрация Осевая warning_min',\n",
|
|||
|
" 'SM_Exgauster[2:6]': 'Подшипник 7 Вибрация Горизонтальная vibration_horizontal',\n",
|
|||
|
" 'SM_Exgauster[2:143]': 'Подшипник 7 Вибрация Горизонтальная alarm_max',\n",
|
|||
|
" 'SM_Exgauster[2:155]': 'Подшипник 7 Вибрация Горизонтальная alarm_min',\n",
|
|||
|
" 'SM_Exgauster[2:167]': 'Подшипник 7 Вибрация Горизонтальная warning_max',\n",
|
|||
|
" 'SM_Exgauster[2:179]': 'Подшипник 7 Вибрация Горизонтальная warning_min',\n",
|
|||
|
" 'SM_Exgauster[2:7]': 'Подшипник 7 Вибрация Вертикальная vibration_vertical',\n",
|
|||
|
" 'SM_Exgauster[2:144]': 'Подшипник 7 Вибрация Вертикальная alarm_max',\n",
|
|||
|
" 'SM_Exgauster[2:156]': 'Подшипник 7 Вибрация Вертикальная alarm_min',\n",
|
|||
|
" 'SM_Exgauster[2:168]': 'Подшипник 7 Вибрация Вертикальная warning_max',\n",
|
|||
|
" 'SM_Exgauster[2:180]': 'Подшипник 7 Вибрация Вертикальная warning_min',\n",
|
|||
|
" 'SM_Exgauster[2:34]': 'Подшипник 8 Температура нагрева Температура temperature',\n",
|
|||
|
" 'SM_Exgauster[2:72]': 'Подшипник 8 Температура нагрева Температура alarm_max',\n",
|
|||
|
" 'SM_Exgauster[2:81]': 'Подшипник 8 Температура нагрева Температура alarm_min',\n",
|
|||
|
" 'SM_Exgauster[2:90]': 'Подшипник 8 Температура нагрева Температура warning_max',\n",
|
|||
|
" 'SM_Exgauster[2:99]': 'Подшипник 8 Температура нагрева Температура warning_min',\n",
|
|||
|
" 'SM_Exgauster[2:11]': 'Подшипник 8 Вибрация Осевая vibration_axial',\n",
|
|||
|
" 'SM_Exgauster[2:148]': 'Подшипник 8 Вибрация Осевая alarm_max',\n",
|
|||
|
" 'SM_Exgauster[2:160]': 'Подшипник 8 Вибрация Осевая alarm_min',\n",
|
|||
|
" 'SM_Exgauster[2:172]': 'Подшипник 8 Вибрация Осевая warning_max',\n",
|
|||
|
" 'SM_Exgauster[2:184]': 'Подшипник 8 Вибрация Осевая warning_min',\n",
|
|||
|
" 'SM_Exgauster[2:9]': 'Подшипник 8 Вибрация Горизонтальная vibration_horizontal',\n",
|
|||
|
" 'SM_Exgauster[2:146]': 'Подшипник 8 Вибрация Горизонтальная alarm_max',\n",
|
|||
|
" 'SM_Exgauster[2:158]': 'Подшипник 8 Вибрация Горизонтальная alarm_min',\n",
|
|||
|
" 'SM_Exgauster[2:170]': 'Подшипник 8 Вибрация Горизонтальная warning_max',\n",
|
|||
|
" 'SM_Exgauster[2:182]': 'Подшипник 8 Вибрация Горизонтальная warning_min',\n",
|
|||
|
" 'SM_Exgauster[2:10]': 'Подшипник 8 Вибрация Вертикальная vibration_vertical',\n",
|
|||
|
" 'SM_Exgauster[2:147]': 'Подшипник 8 Вибрация Вертикальная alarm_max',\n",
|
|||
|
" 'SM_Exgauster[2:159]': 'Подшипник 8 Вибрация Вертикальная alarm_min',\n",
|
|||
|
" 'SM_Exgauster[2:171]': 'Подшипник 8 Вибрация Вертикальная warning_max',\n",
|
|||
|
" 'SM_Exgauster[2:183]': 'Подшипник 8 Вибрация Вертикальная warning_min',\n",
|
|||
|
" 'SM_Exgauster[2:35]': 'Подшипник 9 Температура нагрева Температура temperature',\n",
|
|||
|
" 'SM_Exgauster[2:73]': 'Подшипник 9 Температура нагрева Температура alarm_max',\n",
|
|||
|
" 'SM_Exgauster[2:82]': 'Подшипник 9 Температура нагрева Температура alarm_min',\n",
|
|||
|
" 'SM_Exgauster[2:91]': 'Подшипник 9 Температура нагрева Температура warning_max',\n",
|
|||
|
" 'SM_Exgauster[2:100]': 'Подшипник 9 Температура нагрева Температура warning_min',\n",
|
|||
|
" 'SM_Exgauster[2:42]': 'Охладитель Масло temperature_after',\n",
|
|||
|
" 'SM_Exgauster[2:41]': 'Охладитель Масло temperature_before',\n",
|
|||
|
" 'SM_Exgauster[2:37]': 'Охладитель Вода temperature_after',\n",
|
|||
|
" 'SM_Exgauster[2:36]': 'Охладитель Вода temperature_before',\n",
|
|||
|
" 'SM_Exgauster[2:24]': 'Газовый коллектор temperature_before',\n",
|
|||
|
" 'SM_Exgauster[2:61]': 'Газовый коллектор underpressure_before',\n",
|
|||
|
" 'SM_Exgauster[4.1]': 'Положение задвижки gas_valve_closed',\n",
|
|||
|
" 'SM_Exgauster[4.2]': 'Положение задвижки gas_valve_open',\n",
|
|||
|
" 'SM_Exgauster[4:6]': 'Положение задвижки gas_valve_position',\n",
|
|||
|
" 'SM_Exgauster[4:2]': 'Главный привод rotor_current',\n",
|
|||
|
" 'SM_Exgauster[4:4]': 'Главный привод rotor_voltage',\n",
|
|||
|
" 'SM_Exgauster[4:3]': 'Главный привод stator_current',\n",
|
|||
|
" 'SM_Exgauster[4:5]': 'Главный привод stator_voltage',\n",
|
|||
|
" 'SM_Exgauster[4:0]': 'Маслосистема oil_level',\n",
|
|||
|
" 'SM_Exgauster[4:1]': 'Маслосистема oil_pressure',\n",
|
|||
|
" 'SM_Exgauster[2.0]': 'Работа эксгаустера work'}"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"execution_count": 331
|
|||
|
}
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"import datetime\n",
|
|||
|
"from statsmodels.tsa.api import ExponentialSmoothing\n",
|
|||
|
"\n",
|
|||
|
"plt.plot(df['timestamp'], df['Подшипник 7 Вибрация Горизонтальная vibration_horizontal'])\n",
|
|||
|
"plt.xticks(rotation=90)\n",
|
|||
|
"\n",
|
|||
|
"plt.axhline(y=df['Подшипник 7 Вибрация Горизонтальная warning_min'][0], color='yellow')\n",
|
|||
|
"plt.axhline(y=df['Подшипник 7 Вибрация Горизонтальная warning_max'][0], color='yellow')\n",
|
|||
|
"\n",
|
|||
|
"plt.axhline(y=df['Подшипник 7 Вибрация Горизонтальная alarm_min'][0], color='red')\n",
|
|||
|
"plt.axhline(y=df['Подшипник 7 Вибрация Горизонтальная alarm_max'][0], color='red')\n",
|
|||
|
"\n",
|
|||
|
"red_dates = ['2023-02-09', '2023-01-19']\n",
|
|||
|
"red_dates = [datetime.datetime.strptime(date, '%Y-%m-%d').date() for date in red_dates]\n",
|
|||
|
"for date in red_dates:\n",
|
|||
|
" plt.axvline(x=date, color='cyan')\n",
|
|||
|
"plt.show()"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"colab": {
|
|||
|
"base_uri": "https://localhost:8080/",
|
|||
|
"height": 313
|
|||
|
},
|
|||
|
"id": "bKzLxFtcR5CK",
|
|||
|
"outputId": "5e0d9c83-d8f7-4853-eaad-7a167050a96a"
|
|||
|
},
|
|||
|
"execution_count": 244,
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"output_type": "display_data",
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"<Figure size 432x288 with 1 Axes>"
|
|||
|
],
|
|||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAWoAAAEoCAYAAABxSLuEAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nO3dd5hU9d3+8fdnC9KbrA1ELNgL4IooFhRU7F6mqbHnkccUozGJ0ZjEHjV5HmOKJiGm6E+NiYbkSbDEBnbFBRELYIFFIaCLIFXa8vn9MbPLltndszBnzvfM3q/r2ouZc2bm3DvDuefsd86ZY+6OiIiEqyTpACIi0joVtYhI4FTUIiKBU1GLiARORS0iEriyOB60X79+PmjQoHbfb3b23z3ymkZE6mgdC9fUqVMXu3tFrnmxFPWgQYOoqqpq9/1GZf+dnM8wIlJvVPbfyQlmkNzMbF5L8zT0ISISOBW1iEjgVNQiIoFTUYuIBE5FLSISOBW1iEjgVNQiIoGLZT9qZs+GUaPaf7/bb8/8e9lleY0jIllax1KpzS1qM9vDzKY3+FluZnqVRUQKpM0tanefDQwBMLNSYAHw91bvtMceMHny5qfakvuKSNu0joXHrMVZ7R2jHg287+4tHuooIiL51d6iPgP4c64ZZjbOzKrMrKqmpmbLk4mICNCOojazTsApwIO55rv7eHevdPfKioqcXwAlIiKboT1b1McD09z9o7jCiIhIc+0p6jNpYdhDRETiE6mozawbcAwwId44IiLSVKQDXtx9FbB1zFlERCQHHUIuIhI4FbWISOBU1CIigVNRi4gETkUtIhI4FbWISOBU1CId3NJV66hZsTbpGNKKeE4cICKpMfSGJwCovuXEhJNIS7RFLSISOBW1iEjgVNQiIoFTUYuIBE5FLSISOBW1iEjgVNQiIoFTUYuIBE5FLSISOBW1iEjgVNQiIoGLenLb3mb2kJnNMrOZZnZI3MFERCQj6pcy/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HBJ8636Xzz9Hr94+j0Arj5hLy46Ypf6eTUr1nLQTU/WX//uQzO2aAu8LtuicSMAePYd7ZmVJipqicWjbyykrLSEg3fpS8/O5Vv0WO6ec2wZYMj1TwDQo3MZK9ZsaPExdu7XjbmLVzWaNuXq0Qy/6almt730gens178Xu1R059E3FvLV+6Zx3iE7cfkxe3DA9Y8Dm4YtHpjyAVdOeKPN32HVutY/sLzpkZmcPqw/W3ffCqBRSW+pET9u/jtKuqioZYstWraGl+Ys5rQh/TEzvvCbF3m1emmj28y9+QT+8EI1Q3bsTa8u5VQvXsWYvTPjwU/P+ojFK9fxxeyf9+99vAJ3GLxtD6Z/+Cmn3fFCmxlaK2mAp799JOtrnU5lJRx681PcfsZQtunRucXbH/2/z1B9y4l89b5pANz90jzufmle/fxDb36qfqw5Xw688UnOOngg97/yQc75yz5bT68u7XvTa2krf/igvu3OJ8lRUctmu/yv05kwbUH99W/95XXm3nxCs5IGWtwibmifHXqya0V3xtz2LAC9upSz7LP1m53vvEN24rIxu2MGZkanssxHLS9eNTrS/ZesWtfivCglPfP6sWxVVsIu34/+uXuuku7XvROLV67jrf8s44X3FrP7tj3aHJppbRimxIz9BvSKnEmSp6KWdnvnoxUc+7Nnc86LUsgtOfEXzze63lpJT/rOKF6tXsIVD81oNP3M4QO5+fT9WLjsM7br2ZnM3qUtqxvCyFVsw254Imp0AM4/dBDXnrJPs+n3XDicX09+n9+ccyAHXJcZOrn7wuEcMbgfNSvX5hx+aZjvuw++zoNT53PW7zYdEHzKATu0+LtdNWFGs2lfP2pXv
|
|||
|
},
|
|||
|
"metadata": {
|
|||
|
"needs_background": "light"
|
|||
|
}
|
|||
|
}
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"df.fillna(0, inplace=True)"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"id": "RKwv8SBQfKBw"
|
|||
|
},
|
|||
|
"execution_count": 150,
|
|||
|
"outputs": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [],
|
|||
|
"metadata": {
|
|||
|
"id": "LXVO9oOwi7nx"
|
|||
|
},
|
|||
|
"execution_count": 122,
|
|||
|
"outputs": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"result = adfuller(df['Подшипник 7 Вибрация Горизонтальная vibration_horizontal'])\n",
|
|||
|
"print('ADF Statistic: %f' % result[0])\n",
|
|||
|
"print('p-value: %f' % result[1])\n",
|
|||
|
"print('Critical Values:')\n",
|
|||
|
"for key, value in result[4].items():\n",
|
|||
|
" print('\\t%s: %.3f' % (key, value))"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"colab": {
|
|||
|
"base_uri": "https://localhost:8080/"
|
|||
|
},
|
|||
|
"id": "HziJTOVnR9AB",
|
|||
|
"outputId": "1e4fbb33-c50f-4dd2-d385-d8abc1bb0d3f"
|
|||
|
},
|
|||
|
"execution_count": 151,
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"output_type": "stream",
|
|||
|
"name": "stdout",
|
|||
|
"text": [
|
|||
|
"ADF Statistic: -1.967500\n",
|
|||
|
"p-value: 0.301002\n",
|
|||
|
"Critical Values:\n",
|
|||
|
"\t1%: -3.431\n",
|
|||
|
"\t5%: -2.862\n",
|
|||
|
"\t10%: -2.567\n"
|
|||
|
]
|
|||
|
}
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"df_diff = df['Подшипник 7 Вибрация Горизонтальная vibration_horizontal'].diff().dropna()"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"id": "hFhPdI0UR_kW"
|
|||
|
},
|
|||
|
"execution_count": 102,
|
|||
|
"outputs": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"plot_acf(df_diff, lags=50)\n",
|
|||
|
"plt.show()\n",
|
|||
|
"\n",
|
|||
|
"plot_pacf(df_diff, lags=50)\n",
|
|||
|
"plt.show()"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"colab": {
|
|||
|
"base_uri": "https://localhost:8080/",
|
|||
|
"height": 545
|
|||
|
},
|
|||
|
"id": "uqtUpjxtSFsm",
|
|||
|
"outputId": "dd8c42b5-a53a-488f-a312-69782da75b09"
|
|||
|
},
|
|||
|
"execution_count": 103,
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"output_type": "display_data",
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"<Figure size 432x288 with 1 Axes>"
|
|||
|
],
|
|||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAEICAYAAABcVE8dAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAYGElEQVR4nO3de3RdZZ3G8e/ThEBrKaU2Lb1BUSs2OBI0i8J4mWpBC2rLODNQFCmuasfxMjrqOAhMRbyPS0VHZsaOIKUoWPGW0SJihy7UJUwDFKSttbWCTW8J0FKwl5DkN3+cHTwNJ0nTs3PhvM9nrbPO3u9+z37f95yT5+y8+1wUEZiZWeUbMdQdMDOzweHANzNLhAPfzCwRDnwzs0Q48M3MEuHANzNLhAPfbBBIulTSL8u4/W2SFubZJ0uPA9+GDUmrJe2WdHQ/bhOSXjSQ/Rpskq6SdFNxWUScGxHLhqpPVhkc+DYsSJoOvBoIYN6QdqYPkqoPp8xsuHHg23BxCXA3cAPwzNRFdtT/zqL1Z6ZGJN2VFT8g6SlJF2bl75K0WdLjkholTS66/amS7si27ZJ0eVZ+tKRrJG3PLtd0/achabakZkn/Imkn8M3sKPxWSTdJ2gtcKuk4SddJ2iFpm6RPSaoqNVhJX5G0VdJeSfdKenVWPhe4HLgwG9MD3e8HSS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YAKyIiHWSrpY0r9z9m5lZPqrz2ElErARWditb0kPd2Xm0aWZm/eNP2pqZJcKBb2aWCAe+mVkiHPhmZolw4JuZJcKBb2aWCAe+mVkiHPhmZolw4JuZJcKBb2aWCAe+mVkiHPhmZolw4JuZJcKBb2aWCAe+mVkiHPhmZ
|
|||
|
},
|
|||
|
"metadata": {
|
|||
|
"needs_background": "light"
|
|||
|
}
|
|||
|
},
|
|||
|
{
|
|||
|
"output_type": "display_data",
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"<Figure size 432x288 with 1 Axes>"
|
|||
|
],
|
|||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAEICAYAAABcVE8dAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAcFElEQVR4nO3de5RdZZ3m8e9TFQoSQyhCKjGXgqBGTLClsGsl0mKbJqABhbAcB0krtxXN6lFY2ur0oDiotNg4vVS80N3DyDUoiDpqRqOoaTJeBmgKCWgSAyGCuVcREgPmUqTqN3+cXXiqcqpSJ2efupz3+axVq85+97v3+75Vp57a59377KOIwMzMal/dcHfAzMyGhgPfzCwRDnwzs0Q48M3MEuHANzNLhAPfzCwRDnwbUSS9IOkVg6g3U1JIGjMU/RqpJF0u6ZcVbP8jSZfl2ScbuRz4VhZJT0valwXzDkm3Sxp/hPtaJem9xWURMT4iNubT25fa2CXp6DK3C0mvyqsfI4GkT0m6q7gsIs6NiDuGq082tBz4diTOj4jxwOuBVuAT5Wysgqo/9yTNBN4EBHBBtdurVKlXK6m/grF8OfDtiEXEFuBHwGslHS/pB5I6siPqH0ia0VM3O9K+XtKvgL3AMgph/NXs1cJXs3ovHVlLepukRyXtkbRJ0qfK7OKlwIPA7UCvaYu+ry6Kp0Yk/Twrfizr27uy8vdJ2iDpOUn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LLMgEiYgWwok/ZtUWPA/hw9mVmZsPA77Q1M0uEA9/MLBEOfDOzRDjwzcwS4cA3M0uEA9/MLBEOfDOzRDjwzcwS4cA3M0uEA9/MLBEOfDOzRDjwz
|
|||
|
},
|
|||
|
"metadata": {
|
|||
|
"needs_background": "light"
|
|||
|
}
|
|||
|
}
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"df[df['timestamp'].isin(date_list)]"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"id": "aIOOJx2Ei6KB"
|
|||
|
},
|
|||
|
"execution_count": null,
|
|||
|
"outputs": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"model = ARIMA(df.set_index('timestamp').loc['2023-02-17':]['Подшипник 7 Вибрация Горизонтальная vibration_horizontal'], order=(1, 1, 2))\n",
|
|||
|
"model_fit = model.fit()\n",
|
|||
|
"print(model_fit.summary())"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"colab": {
|
|||
|
"base_uri": "https://localhost:8080/"
|
|||
|
},
|
|||
|
"id": "AXwZAfPqSIv8",
|
|||
|
"outputId": "8aa37358-9e5b-4e95-b52f-8d75ab85bea9"
|
|||
|
},
|
|||
|
"execution_count": 174,
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"output_type": "stream",
|
|||
|
"name": "stdout",
|
|||
|
"text": [
|
|||
|
" SARIMAX Results \n",
|
|||
|
"====================================================================================================================\n",
|
|||
|
"Dep. Variable: Подшипник 7 Вибрация Горизонтальная vibration_horizontal No. Observations: 137\n",
|
|||
|
"Model: ARIMA(1, 1, 2) Log Likelihood 415.379\n",
|
|||
|
"Date: Sun, 19 Feb 2023 AIC -822.759\n",
|
|||
|
"Time: 03:01:13 BIC -811.108\n",
|
|||
|
"Sample: 02-17-2023 HQIC -818.024\n",
|
|||
|
" - 02-17-2023 \n",
|
|||
|
"Covariance Type: opg \n",
|
|||
|
"==============================================================================\n",
|
|||
|
" coef std err z P>|z| [0.025 0.975]\n",
|
|||
|
"------------------------------------------------------------------------------\n",
|
|||
|
"ar.L1 0.8413 0.867 0.970 0.332 -0.859 2.541\n",
|
|||
|
"ma.L1 -1.1896 0.851 -1.398 0.162 -2.857 0.478\n",
|
|||
|
"ma.L2 0.3074 0.272 1.132 0.258 -0.225 0.840\n",
|
|||
|
"sigma2 0.0001 1.58e-05 8.213 0.000 9.9e-05 0.000\n",
|
|||
|
"===================================================================================\n",
|
|||
|
"Ljung-Box (L1) (Q): 0.15 Jarque-Bera (JB): 3.63\n",
|
|||
|
"Prob(Q): 0.70 Prob(JB): 0.16\n",
|
|||
|
"Heteroskedasticity (H): 1.46 Skew: -0.40\n",
|
|||
|
"Prob(H) (two-sided): 0.21 Kurtosis: 3.03\n",
|
|||
|
"===================================================================================\n",
|
|||
|
"\n",
|
|||
|
"Warnings:\n",
|
|||
|
"[1] Covariance matrix calculated using the outer product of gradients (complex-step).\n"
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"output_type": "stream",
|
|||
|
"name": "stderr",
|
|||
|
"text": [
|
|||
|
"/usr/local/lib/python3.8/dist-packages/statsmodels/tsa/base/tsa_model.py:524: ValueWarning: No frequency information was provided, so inferred frequency 5T will be used.\n",
|
|||
|
" warnings.warn('No frequency information was'\n",
|
|||
|
"/usr/local/lib/python3.8/dist-packages/statsmodels/tsa/base/tsa_model.py:524: ValueWarning: No frequency information was provided, so inferred frequency 5T will be used.\n",
|
|||
|
" warnings.warn('No frequency information was'\n",
|
|||
|
"/usr/local/lib/python3.8/dist-packages/statsmodels/tsa/base/tsa_model.py:524: ValueWarning: No frequency information was provided, so inferred frequency 5T will be used.\n",
|
|||
|
" warnings.warn('No frequency information was'\n"
|
|||
|
]
|
|||
|
}
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"forecast_values = model_fit.forecast(steps=240)\n",
|
|||
|
"forecast_values"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"colab": {
|
|||
|
"base_uri": "https://localhost:8080/"
|
|||
|
},
|
|||
|
"id": "jTKxvVDEgDL4",
|
|||
|
"outputId": "953fa8cb-146c-4982-8ba8-01c82c9ba80f"
|
|||
|
},
|
|||
|
"execution_count": 175,
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"output_type": "execute_result",
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"2023-02-17 11:25:00 0.461494\n",
|
|||
|
"2023-02-17 11:30:00 0.461461\n",
|
|||
|
"2023-02-17 11:35:00 0.461433\n",
|
|||
|
"2023-02-17 11:40:00 0.461409\n",
|
|||
|
"2023-02-17 11:45:00 0.461390\n",
|
|||
|
" ... \n",
|
|||
|
"2023-02-18 07:00:00 0.461285\n",
|
|||
|
"2023-02-18 07:05:00 0.461285\n",
|
|||
|
"2023-02-18 07:10:00 0.461285\n",
|
|||
|
"2023-02-18 07:15:00 0.461285\n",
|
|||
|
"2023-02-18 07:20:00 0.461285\n",
|
|||
|
"Freq: 5T, Name: predicted_mean, Length: 240, dtype: float64"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"execution_count": 175
|
|||
|
}
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"import datetime\n",
|
|||
|
"\n",
|
|||
|
"plt.plot(df['timestamp'], df['Подшипник 7 Вибрация Горизонтальная vibration_horizontal'])\n",
|
|||
|
"plt.xticks(rotation=90)\n",
|
|||
|
"\n",
|
|||
|
"plt.axhline(y=df['Подшипник 7 Вибрация Горизонтальная warning_min'][0], color='yellow')\n",
|
|||
|
"plt.axhline(y=df['Подшипник 7 Вибрация Горизонтальная warning_max'][0], color='yellow')\n",
|
|||
|
"\n",
|
|||
|
"plt.axhline(y=df['Подшипник 7 Вибрация Горизонтальная alarm_min'][0], color='red')\n",
|
|||
|
"plt.axhline(y=df['Подшипник 7 Вибрация Горизонтальная alarm_max'][0], color='red')\n",
|
|||
|
"\n",
|
|||
|
"red_dates = ['2023-02-09', '2023-01-19']\n",
|
|||
|
"red_dates = [datetime.datetime.strptime(date, '%Y-%m-%d').date() for date in red_dates]\n",
|
|||
|
"for date in red_dates:\n",
|
|||
|
" plt.axvline(x=date, color='cyan')\n",
|
|||
|
"plt.show()"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"colab": {
|
|||
|
"base_uri": "https://localhost:8080/",
|
|||
|
"height": 313
|
|||
|
},
|
|||
|
"id": "9v7Fi9ySgZPf",
|
|||
|
"outputId": "90230898-f22b-4408-b401-4fc3c58c3695"
|
|||
|
},
|
|||
|
"execution_count": 176,
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"output_type": "display_data",
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"<Figure size 432x288 with 1 Axes>"
|
|||
|
],
|
|||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAWoAAAEoCAYAAABxSLuEAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nO3dd5xU9b3/8ddnCx2pawXEjg1B1hIrdlAs1zT1F0s0kuQXc/WaxFhjV5IYY6KmoNGYm5hYotGIEQuiYl+QIlJURAEBFxEQpC37uX/M7LhldneWPWfOOTPv5+OxD2bOmZnz3hnOe85+55w55u6IiEh8lUQdQEREWqaiFhGJORW1iEjMqahFRGJORS0iEnNlYTxo3759feDAgW2+35z0v7sFmkZE6mgdi6/Jkycvc/eKbPNCKeqBAwdSVVXV5vsNT/87McgwIpIxPP3vxAgzSHZm9mFz8zT0ISIScypqEZGYU1GLiMScilpEJOZU1CIiMaeiFhGJORW1iEjMhbIfNXPmwPDhbb/fbbel/r3ookDjiEia1r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tc93WDaz7+6N906lvOD+6ewaMValqxax8ZNta2Obf/6mblMX7iC5+c0PfisdDO2yiVa5u6BP2hlZaVXVVW1+X7D0/9ODDKMBM7d2eGy7OWzT78eTGs0FhuGi47ehW9U9ueW8XN45K0vhxx+e/pQTtpnWxavXMtW3TtRUpJbKX39D6+wU0U3t
|
|||
|
},
|
|||
|
"metadata": {
|
|||
|
"needs_background": "light"
|
|||
|
}
|
|||
|
}
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [],
|
|||
|
"metadata": {
|
|||
|
"id": "BUCDivzKglHu"
|
|||
|
},
|
|||
|
"execution_count": 176,
|
|||
|
"outputs": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"plt.plot(df.set_index('timestamp').loc['2023-02-17':].index, df.set_index('timestamp').loc['2023-02-17':]['Подшипник 7 Вибрация Горизонтальная vibration_horizontal'], label='Actual')\n",
|
|||
|
"plt.xticks(rotation=90)\n",
|
|||
|
"\n",
|
|||
|
"plt.plot(date_list, forecast_values.values, color='red', label='Predicted')"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"colab": {
|
|||
|
"base_uri": "https://localhost:8080/",
|
|||
|
"height": 319
|
|||
|
},
|
|||
|
"id": "Y1wRHnNYgUEf",
|
|||
|
"outputId": "e68ac38f-39ef-4d20-9854-a73ec529ff38"
|
|||
|
},
|
|||
|
"execution_count": 177,
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"output_type": "execute_result",
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"[<matplotlib.lines.Line2D at 0x7f68ad96e1c0>]"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"execution_count": 177
|
|||
|
},
|
|||
|
{
|
|||
|
"output_type": "display_data",
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"<Figure size 432x288 with 1 Axes>"
|
|||
|
],
|
|||
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yWiIVLZAJl/dgsFhOKH2jqK0gmb6yrrj1NEPxiOUajx9sCyeKk8/W6nHT8RCTKeyng6bSzP9+UyectkQCAiKoiyPZvrKuuPU0Q8nKp6+U70DVqZfW6fvtE92PP1Ks7UaTz8epVQ2bn8eRVGWR0VfWXe8mf6Q3S/Ha+9Ew4Ga3jsF18ZJxkKkssUlbZUdHLtoVmv1FaUpVPQ3IX9+26N88eCxlQ/cIJwWDIPxCENOpl9l71iZ/l2HZ3nNx77L/U+dJhmt2DupbJGzDewdd1au9tVXlKZQ0d+EfPX+E/zHj0+ufOAGcXQuQzgonLMlxt7Bft71mjFed9E57v6Ynen/5+QsR2czvP7ic/iVF58LwI6BGPlSmSMzGQAGajL93dus/jxPzmkFj6I0gw7kbkJSuaKv1o6dnEpx3nDcXfj8Xa8Zr9ofDQXIFcrMZ3JsT0T567c83903PmqtnHv/k6eApfbOnsF+oqEAE1Op9fwIirJp0Ex/k2GMVc/uJ497YirN2Eiy4X6rZLPktmrwMuaI/lO26NfYO8GAcMH2BJPT6TWOWlE2Jyr6m4xMvoQx+CbTX8yXOHZqgbHRRMNjrJLNMrOZvFvd4zCciLCtP8zJM1lEKqtmeRkfTTCpmb6iNIWK/ibDqWdfLJRYyHd+GcHHZ9IYU7Fp6hELB8kWS8xncu5qWA4i4mb7iUiobi3+2GiSp89kqxZTVxSlPir6mwyntBH8sbiI47WPL5Ppx0JBcoUyc+mlmb73ubV+fmW/dVJQi0dRVkZFf5PhlDaCP5YRnJhKEw4K5w7FGx4TDQc4s1hgIV9a4ulDRdRrWzBU9lsnBbV4FGVlVPQ3GWmP6Puh++TkV
|
|||
|
},
|
|||
|
"metadata": {
|
|||
|
"needs_background": "light"
|
|||
|
}
|
|||
|
}
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"import pandas as pd\n",
|
|||
|
"import numpy as np\n",
|
|||
|
"import random\n",
|
|||
|
"import os\n",
|
|||
|
"import matplotlib.pyplot as plt\n",
|
|||
|
"import seaborn as sns\n",
|
|||
|
"from sklearn.metrics import mean_absolute_error\n",
|
|||
|
"!pip install catboost -qqq\n",
|
|||
|
"from catboost import CatBoostRegressor, Pool\n",
|
|||
|
"from sklearn.model_selection import StratifiedKFold, StratifiedGroupKFold\n",
|
|||
|
"from copy import deepcopy \n",
|
|||
|
"import pickle\n",
|
|||
|
"import sklearn.metrics\n",
|
|||
|
"\n",
|
|||
|
"import warnings\n",
|
|||
|
"warnings.filterwarnings('ignore')"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"colab": {
|
|||
|
"base_uri": "https://localhost:8080/"
|
|||
|
},
|
|||
|
"id": "o5a4m07Whhfz",
|
|||
|
"outputId": "6d6a17f0-01d0-412f-a5e0-9fd6e6973943"
|
|||
|
},
|
|||
|
"execution_count": 178,
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"output_type": "stream",
|
|||
|
"name": "stdout",
|
|||
|
"text": [
|
|||
|
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m76.6/76.6 MB\u001b[0m \u001b[31m11.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
|||
|
"\u001b[?25h"
|
|||
|
]
|
|||
|
}
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"def set_seed(seed: int):\n",
|
|||
|
" \"\"\"Set a random seed for complete reproducibility.\"\"\"\n",
|
|||
|
" random.seed(seed)\n",
|
|||
|
" np.random.seed(seed)\n",
|
|||
|
" os.environ['PYTHONHASHSEED'] = str(seed)\n",
|
|||
|
"\n",
|
|||
|
"set_seed(0xBACED)"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"id": "3OxEyWb-ognB"
|
|||
|
},
|
|||
|
"execution_count": 179,
|
|||
|
"outputs": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"df = df.set_index('timestamp')"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"id": "OH3_HXpZtLbE"
|
|||
|
},
|
|||
|
"execution_count": 250,
|
|||
|
"outputs": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"X = df.loc['2023-02-01':]['Подшипник 7 Вибрация Горизонтальная vibration_horizontal'].values\n",
|
|||
|
"X"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"colab": {
|
|||
|
"base_uri": "https://localhost:8080/"
|
|||
|
},
|
|||
|
"id": "7p88-OhTs720",
|
|||
|
"outputId": "e7129aae-d744-488c-ec1c-38e48e63cce5"
|
|||
|
},
|
|||
|
"execution_count": 229,
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"output_type": "execute_result",
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"array([1.66087973, 1.67245376, 1.67245376, ..., 0.46296296, 0.45717594,\n",
|
|||
|
" 0.46296296])"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"execution_count": 229
|
|||
|
}
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [],
|
|||
|
"metadata": {
|
|||
|
"id": "UkICh3nqovJM"
|
|||
|
},
|
|||
|
"execution_count": 236,
|
|||
|
"outputs": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"np.array(data).shape"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"colab": {
|
|||
|
"base_uri": "https://localhost:8080/"
|
|||
|
},
|
|||
|
"id": "cLUAT-ftue8E",
|
|||
|
"outputId": "b4b4aa17-307a-4881-8019-8e5b569c56ef"
|
|||
|
},
|
|||
|
"execution_count": 237,
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"output_type": "execute_result",
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"(300, 100)"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"execution_count": 237
|
|||
|
}
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [],
|
|||
|
"metadata": {
|
|||
|
"id": "NIUVTir4uh3d"
|
|||
|
},
|
|||
|
"execution_count": null,
|
|||
|
"outputs": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"preds = df['Подшипник 7 Вибрация Горизонтальная vibration_horizontal'].loc['2023-02-17':].values[-100:].tolist()\n",
|
|||
|
"for i in range(300):\n",
|
|||
|
" pred = model.predict(preds[-100:])\n",
|
|||
|
" preds.append(pred)"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"id": "yzVzfQ8HvZ5H"
|
|||
|
},
|
|||
|
"execution_count": 239,
|
|||
|
"outputs": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"deltas = [df.index.max() + timedelta(minutes=x) for x in range(300)]"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"id": "jyxD-iCRuiRk"
|
|||
|
},
|
|||
|
"execution_count": 240,
|
|||
|
"outputs": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"from sklearn.model_selection import TimeSeriesSplit\n",
|
|||
|
"from catboost import CatBoostRegressor\n",
|
|||
|
"\n",
|
|||
|
"df = pd.read_csv('1.csv', parse_dates=['timestamp'])\n",
|
|||
|
"df.columns= ['timestamp'] + [''.join([x for x in el if x != '\\\\']) for el in df.columns if el != 'timestamp']\n",
|
|||
|
"df = df.rename(columns=mapping)\n",
|
|||
|
"df = df.set_index('timestamp').resample('5T').first().reset_index()\n",
|
|||
|
"\n",
|
|||
|
"lim = {}\n",
|
|||
|
"for col in tqdm(df.columns):\n",
|
|||
|
" if 'Подшипник' in col and ('max' not in col and 'min' not in col):\n",
|
|||
|
" print(col)\n",
|
|||
|
" col_name = col\n",
|
|||
|
" data, target = [], []\n",
|
|||
|
"\n",
|
|||
|
" X = df[col_name].values\n",
|
|||
|
"\n",
|
|||
|
" tscv = TimeSeriesSplit(n_splits=300, test_size=1)\n",
|
|||
|
" for i, (train_index, test_index) in enumerate(tscv.split(X)):\n",
|
|||
|
" data.append(X[train_index[-100:]])\n",
|
|||
|
" target.append(X[test_index[0]])\n",
|
|||
|
" data = np.array(data)\n",
|
|||
|
" target = np.array(target)\n",
|
|||
|
" # print(data, target)\n",
|
|||
|
"\n",
|
|||
|
" model = CatBoostRegressor()\n",
|
|||
|
" model.fit(data, target)\n",
|
|||
|
" model.save_model(os.path.join('models/', col_name + '.cb'))\n",
|
|||
|
"\n",
|
|||
|
" prefix = ' '.join(col_name.split()[:-1])\n",
|
|||
|
" alarm_max = df[prefix + ' alarm_max'][0]\n",
|
|||
|
" alarm_min = df[prefix + ' alarm_min'][0]\n",
|
|||
|
"\n",
|
|||
|
" warning_max = df[prefix + ' warning_max'][0]\n",
|
|||
|
" warning_min = df[prefix + ' warning_min'][0]\n",
|
|||
|
"\n",
|
|||
|
" lim[col_name] = {'alarm_max': alarm_max, 'alarm_min': alarm_min,\n",
|
|||
|
" 'warning_max': warning_max, 'warning_min': warning_min}"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"id": "ZWYd2O1A0zkC"
|
|||
|
},
|
|||
|
"execution_count": null,
|
|||
|
"outputs": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"!ls models"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"colab": {
|
|||
|
"base_uri": "https://localhost:8080/"
|
|||
|
},
|
|||
|
"id": "AygHlYOZ4l-z",
|
|||
|
"outputId": "96f69119-f6c3-4ae1-902c-b2cbe0998f67"
|
|||
|
},
|
|||
|
"execution_count": 298,
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"output_type": "stream",
|
|||
|
"name": "stdout",
|
|||
|
"text": [
|
|||
|
"'Подшипник 1 Вибрация Вертикальная vibration_vertical.cb'\n",
|
|||
|
"'Подшипник 1 Вибрация Горизонтальная vibration_horizontal.cb'\n",
|
|||
|
"'Подшипник 1 Вибрация Осевая vibration_axial.cb'\n",
|
|||
|
"'Подшипник 1 Температура нагрева Температура temperature.cb'\n",
|
|||
|
"'Подшипник 2 Вибрация Вертикальная vibration_vertical.cb'\n",
|
|||
|
"'Подшипник 2 Вибрация Горизонтальная vibration_horizontal.cb'\n",
|
|||
|
"'Подшипник 2 Вибрация Осевая vibration_axial.cb'\n",
|
|||
|
"'Подшипник 2 Температура нагрева Температура temperature.cb'\n",
|
|||
|
"'Подшипник 3 Температура нагрева Температура temperature.cb'\n",
|
|||
|
"'Подшипник 4 Температура нагрева Температура temperature.cb'\n",
|
|||
|
"'Подшипник 5 Температура нагрева Температура temperature.cb'\n",
|
|||
|
"'Подшипник 6 Температура нагрева Температура temperature.cb'\n",
|
|||
|
"'Подшипник 7 Вибрация Вертикальная vibration_vertical.cb'\n",
|
|||
|
"'Подшипник 7 Вибрация Горизонтальная vibration_horizontal.cb'\n",
|
|||
|
"'Подшипник 7 Вибрация Осевая vibration_axial.cb'\n",
|
|||
|
"'Подшипник 7 Температура нагрева Температура temperature.cb'\n",
|
|||
|
"'Подшипник 8 Вибрация Вертикальная vibration_vertical.cb'\n",
|
|||
|
"'Подшипник 8 Вибрация Горизонтальная vibration_horizontal.cb'\n",
|
|||
|
"'Подшипник 8 Вибрация Осевая vibration_axial.cb'\n",
|
|||
|
"'Подшипник 8 Температура нагрева Температура temperature.cb'\n",
|
|||
|
"'Подшипник 9 Температура нагрева Температура temperature.cb'\n"
|
|||
|
]
|
|||
|
}
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"lim[col_name]"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"colab": {
|
|||
|
"base_uri": "https://localhost:8080/"
|
|||
|
},
|
|||
|
"id": "tGF5yJk-7jwu",
|
|||
|
"outputId": "130ae066-b4f7-49db-9bf2-5eabde3f2aca"
|
|||
|
},
|
|||
|
"execution_count": 299,
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"output_type": "execute_result",
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"{'alarm_max': 75.0, 'alarm_min': 0.0, 'warning_max': 65.0, 'warning_min': 0.0}"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"execution_count": 299
|
|||
|
}
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"import pickle\n",
|
|||
|
"with open('lim_mapping.pkl', 'wb') as f:\n",
|
|||
|
" pickle.dump(lim, f)"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"id": "sLWCyanS9S4e"
|
|||
|
},
|
|||
|
"execution_count": 304,
|
|||
|
"outputs": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"import glob\n",
|
|||
|
"import catboost as cb\n",
|
|||
|
"import pandas as pd\n",
|
|||
|
"import numpy as np\n",
|
|||
|
"import pickle\n",
|
|||
|
"\n",
|
|||
|
"with open('lim_mapping.pkl', 'rb') as f:\n",
|
|||
|
" lim = pickle.load(f)\n",
|
|||
|
"\n",
|
|||
|
"models = glob.glob('models/*.cb')\n",
|
|||
|
"\n",
|
|||
|
"min_is_crashed = 1e9\n",
|
|||
|
"min_is_warning = 1e9\n",
|
|||
|
"for model_path in models:\n",
|
|||
|
" model = cb.CatBoostRegressor()\n",
|
|||
|
" model.load_model(model_path)\n",
|
|||
|
"\n",
|
|||
|
" col_name = model_path.split('/')[-1].split('.')[0]\n",
|
|||
|
"\n",
|
|||
|
" preds = df[col_name].values[-100:].tolist()\n",
|
|||
|
" for i in range(300):\n",
|
|||
|
" pred = model.predict(preds[-100:])\n",
|
|||
|
" preds.append(pred)\n",
|
|||
|
"\n",
|
|||
|
" preds = np.array(preds[100:])\n",
|
|||
|
" alarm_max, alarm_min, warning_max, warning_min = lim[col_name].values()\n",
|
|||
|
" is_crashed = -1\n",
|
|||
|
" is_warning = -1\n",
|
|||
|
" for i in range(len(preds)):\n",
|
|||
|
" if preds[i] > alarm_max or preds[i] < alarm_min:\n",
|
|||
|
" is_crashed = i\n",
|
|||
|
" break\n",
|
|||
|
" elif preds[i] > warning_max or preds[i] < warning_min:\n",
|
|||
|
" is_warning = i\n",
|
|||
|
"\n",
|
|||
|
" if is_crashed != -1:\n",
|
|||
|
" min_is_crashed = min(min_is_crashed, (is_crashed * 5) // 60 + 1)\n",
|
|||
|
" elif is_warning != -1:\n",
|
|||
|
" min_is_warning = min(min_is_warning, (is_crashed * 5) // 60 + 1)"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"colab": {
|
|||
|
"base_uri": "https://localhost:8080/"
|
|||
|
},
|
|||
|
"id": "z_QrTWJq5I08",
|
|||
|
"outputId": "9eba7db5-f8fb-49c7-c7c2-9e131e82bfab"
|
|||
|
},
|
|||
|
"execution_count": 303,
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"output_type": "stream",
|
|||
|
"name": "stdout",
|
|||
|
"text": [
|
|||
|
"empty -1\n",
|
|||
|
"empty -1\n",
|
|||
|
"empty -1\n",
|
|||
|
"empty -1\n",
|
|||
|
"empty -1\n",
|
|||
|
"empty -1\n",
|
|||
|
"empty -1\n",
|
|||
|
"empty -1\n",
|
|||
|
"empty -1\n",
|
|||
|
"empty -1\n",
|
|||
|
"empty -1\n",
|
|||
|
"empty -1\n",
|
|||
|
"empty -1\n",
|
|||
|
"empty -1\n",
|
|||
|
"empty -1\n",
|
|||
|
"empty -1\n",
|
|||
|
"empty -1\n",
|
|||
|
"empty -1\n",
|
|||
|
"empty -1\n",
|
|||
|
"empty -1\n",
|
|||
|
"empty -1\n"
|
|||
|
]
|
|||
|
}
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"lim"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"colab": {
|
|||
|
"base_uri": "https://localhost:8080/"
|
|||
|
},
|
|||
|
"id": "miswb59V2z0B",
|
|||
|
"outputId": "85afe1f8-fd1d-4675-9c2c-834785cd7ce8"
|
|||
|
},
|
|||
|
"execution_count": 287,
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"output_type": "execute_result",
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"{'Подшипник 1 Температура нагрева Температура temperature.cb': {'alarm_max': 75.0,\n",
|
|||
|
" 'alarm_min': 0.0,\n",
|
|||
|
" 'warning_max': 65.0,\n",
|
|||
|
" 'warning_min': 0.0}}"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"execution_count": 287
|
|||
|
}
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"preds = df[col_name].values[-100:].tolist()"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"id": "Y9ArNzvY1vi3"
|
|||
|
},
|
|||
|
"execution_count": null,
|
|||
|
"outputs": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"df.columns[:50]"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"colab": {
|
|||
|
"base_uri": "https://localhost:8080/"
|
|||
|
},
|
|||
|
"id": "uewy8gUa0Zoq",
|
|||
|
"outputId": "736bbafb-057e-431d-a240-6757623742c2"
|
|||
|
},
|
|||
|
"execution_count": 277,
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"output_type": "execute_result",
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"Index(['Подшипник 1 Температура нагрева Температура temperature',\n",
|
|||
|
" 'Подшипник 1 Температура нагрева Температура alarm_max',\n",
|
|||
|
" 'Подшипник 1 Температура нагрева Температура alarm_min',\n",
|
|||
|
" 'Подшипник 1 Температура нагрева Температура warning_max',\n",
|
|||
|
" 'Подшипник 1 Температура нагрева Температура warning_min',\n",
|
|||
|
" 'Подшипник 1 Вибрация Осевая vibration_axial',\n",
|
|||
|
" 'Подшипник 1 Вибрация Осевая alarm_max',\n",
|
|||
|
" 'Подшипник 1 Вибрация Осевая alarm_min',\n",
|
|||
|
" 'Подшипник 1 Вибрация Осевая warning_max',\n",
|
|||
|
" 'Подшипник 1 Вибрация Осевая warning_min',\n",
|
|||
|
" 'Подшипник 1 Вибрация Горизонтальная vibration_horizontal',\n",
|
|||
|
" 'Подшипник 1 Вибрация Горизонтальная alarm_max',\n",
|
|||
|
" 'Подшипник 1 Вибрация Горизонтальная alarm_min',\n",
|
|||
|
" 'Подшипник 1 Вибрация Горизонтальная warning_max',\n",
|
|||
|
" 'Подшипник 1 Вибрация Горизонтальная warning_min',\n",
|
|||
|
" 'Подшипник 1 Вибрация Вертикальная vibration_vertical',\n",
|
|||
|
" 'Подшипник 1 Вибрация Вертикальная alarm_max',\n",
|
|||
|
" 'Подшипник 1 Вибрация Вертикальная alarm_min',\n",
|
|||
|
" 'Подшипник 1 Вибрация Вертикальная warning_max',\n",
|
|||
|
" 'Подшипник 1 Вибрация Вертикальная warning_min',\n",
|
|||
|
" 'Подшипник 2 Температура нагрева Температура temperature',\n",
|
|||
|
" 'Подшипник 2 Температура нагрева Температура alarm_max',\n",
|
|||
|
" 'Подшипник 2 Температура нагрева Температура alarm_min',\n",
|
|||
|
" 'Подшипник 2 Температура нагрева Температура warning_max',\n",
|
|||
|
" 'Подшипник 2 Температура нагрева Температура warning_min',\n",
|
|||
|
" 'Подшипник 2 Вибрация Осевая vibration_axial',\n",
|
|||
|
" 'Подшипник 2 Вибрация Осевая alarm_max',\n",
|
|||
|
" 'Подшипник 2 Вибрация Осевая alarm_min',\n",
|
|||
|
" 'Подшипник 2 Вибрация Осевая warning_max',\n",
|
|||
|
" 'Подшипник 2 Вибрация Осевая warning_min',\n",
|
|||
|
" 'Подшипник 2 Вибрация Горизонтальная vibration_horizontal',\n",
|
|||
|
" 'Подшипник 2 Вибрация Горизонтальная alarm_max',\n",
|
|||
|
" 'Подшипник 2 Вибрация Горизонтальная alarm_min',\n",
|
|||
|
" 'Подшипник 2 Вибрация Горизонтальная warning_max',\n",
|
|||
|
" 'Подшипник 2 Вибрация Горизонтальная warning_min',\n",
|
|||
|
" 'Подшипник 2 Вибрация Вертикальная vibration_vertical',\n",
|
|||
|
" 'Подшипник 2 Вибрация Вертикальная alarm_max',\n",
|
|||
|
" 'Подшипник 2 Вибрация Вертикальная alarm_min',\n",
|
|||
|
" 'Подшипник 2 Вибрация Вертикальная warning_max',\n",
|
|||
|
" 'Подшипник 2 Вибрация Вертикальная warning_min',\n",
|
|||
|
" 'Подшипник 3 Температура нагрева Температура temperature',\n",
|
|||
|
" 'Подшипник 3 Температура нагрева Температура alarm_max',\n",
|
|||
|
" 'Подшипник 3 Температура нагрева Температура alarm_min',\n",
|
|||
|
" 'Подшипник 3 Температура нагрева Температура warning_max',\n",
|
|||
|
" 'Подшипник 3 Температура нагрева Температура warning_min',\n",
|
|||
|
" 'Подшипник 4 Температура нагрева Температура temperature',\n",
|
|||
|
" 'Подшипник 4 Температура нагрева Температура alarm_max',\n",
|
|||
|
" 'Подшипник 4 Температура нагрева Температура alarm_min',\n",
|
|||
|
" 'Подшипник 4 Температура нагрева Температура warning_max',\n",
|
|||
|
" 'Подшипник 4 Температура нагрева Температура warning_min'],\n",
|
|||
|
" dtype='object')"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"execution_count": 277
|
|||
|
}
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
" plt.plot(df.loc['2023-02-17':].index, df.loc['2023-02-17':]['Подшипник 7 Вибрация Горизонтальная vibration_horizontal'], label='Actual')\n",
|
|||
|
"plt.xticks(rotation=90)\n",
|
|||
|
"\n",
|
|||
|
"plt.plot(deltas, preds[100:], color='red', label='Predicted')"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"colab": {
|
|||
|
"base_uri": "https://localhost:8080/",
|
|||
|
"height": 319
|
|||
|
},
|
|||
|
"id": "UwUkm3vbvMNY",
|
|||
|
"outputId": "6e44cdb7-ee5d-45d0-c8e3-0d4cac40735f"
|
|||
|
},
|
|||
|
"execution_count": 241,
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"output_type": "execute_result",
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"[<matplotlib.lines.Line2D at 0x7f68ad9ccca0>]"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"execution_count": 241
|
|||
|
},
|
|||
|
{
|
|||
|
"output_type": "display_data",
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"<Figure size 432x288 with 1 Axes>"
|
|||
|
],
|
|||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAEdCAYAAAACUaxyAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nO2deZwkVZXvfyeXyLX2pffqpbpZmm7WEhBHUZBFRgFBFBkdehyePn0oz2UEHAcRn+PyFH2jziiDCsooOsgwICAgoiACdjdLY3fTdFX1Vr3V2lWV+3bfHzduZGRWZlVWVi6Rmef7+dQnMyMiM09WZf3ixO+eey4JIcAwDMPUL7ZqB8AwDMOUFxZ6hmGYOoeFnmEYps5hoWcYhqlzWOgZhmHqHBZ6hmGYOqcgoSeii4loFxH1E9FNOfZvIqIRInpZ/7nOtK+HiB4nop1EtIOIVpUufIZhGGYuaK46eiKyA3gdwAUAhgBsBvB+IcQO0zGbAPQJIa7P8fzfA/iy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HffBYGJF4Cr3d/pz7XU47hACGp6Jo82qGyANAb5ecYLXz8FRGaaV5/+BIAMkUz45lLII5oweA1auBP/7Rsi0RWOhrHNUfptoTigZGAgCAtfmEXq+kOTQZRps304dXz4kmUjkz+rXdfkQTKWMxE4apOtFoptBfcQXQ3w8MD1cvpllgoa9xVO15ta0bZa2Y+9yYUUJ/ZDJilEwqetp9Roafz7oBgH79ZMIwVSUWkzXzy5ent514orzdtas6Mc0BC32No3rGhONJhGPJOY4uHwMjAbR5nTNEXKHWjT0yG
|
|||
|
},
|
|||
|
"metadata": {
|
|||
|
"needs_background": "light"
|
|||
|
}
|
|||
|
}
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [],
|
|||
|
"metadata": {
|
|||
|
"id": "ckV3iaLZzyfM"
|
|||
|
},
|
|||
|
"execution_count": null,
|
|||
|
"outputs": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [],
|
|||
|
"metadata": {
|
|||
|
"id": "IMydcU9zzyib"
|
|||
|
},
|
|||
|
"execution_count": null,
|
|||
|
"outputs": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [],
|
|||
|
"metadata": {
|
|||
|
"id": "Dbl6oo0WzylH"
|
|||
|
},
|
|||
|
"execution_count": null,
|
|||
|
"outputs": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"X_col = 'Подшипник 7 Вибрация Горизонтальная vibration_horizontal'"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"id": "cmMcBMywwWao"
|
|||
|
},
|
|||
|
"execution_count": 247,
|
|||
|
"outputs": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"from statsmodels.tsa.api import ExponentialSmoothing\n",
|
|||
|
"\n",
|
|||
|
"\n",
|
|||
|
"model = ExponentialSmoothing(df.loc['2023-02-17':]['Подшипник 7 Вибрация Горизонтальная vibration_horizontal'], trend='additive', seasonal='additive', seasonal_periods=30)\n",
|
|||
|
"\n",
|
|||
|
"# обучение модели\n",
|
|||
|
"model_fit = model.fit()\n",
|
|||
|
"\n",
|
|||
|
"# предсказание будущих значений\n",
|
|||
|
"predictions = model_fit.forecast(30)"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"id": "vQ1fRa1PyTKs"
|
|||
|
},
|
|||
|
"execution_count": 270,
|
|||
|
"outputs": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"df.index.max() "
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"colab": {
|
|||
|
"base_uri": "https://localhost:8080/"
|
|||
|
},
|
|||
|
"id": "3gouZA-3zDHZ",
|
|||
|
"outputId": "bfef8dd4-4ed1-4d62-a728-17b775159804"
|
|||
|
},
|
|||
|
"execution_count": 271,
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"output_type": "execute_result",
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"Timestamp('2023-02-17 11:20:00')"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"execution_count": 271
|
|||
|
}
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"from datetime import Timestamp"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"colab": {
|
|||
|
"base_uri": "https://localhost:8080/",
|
|||
|
"height": 305
|
|||
|
},
|
|||
|
"id": "V5s1ToTXzJOC",
|
|||
|
"outputId": "622272d5-784c-4558-a392-ad560333a37c"
|
|||
|
},
|
|||
|
"execution_count": 260,
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"output_type": "error",
|
|||
|
"ename": "ImportError",
|
|||
|
"evalue": "ignored",
|
|||
|
"traceback": [
|
|||
|
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
|||
|
"\u001b[0;31mImportError\u001b[0m Traceback (most recent call last)",
|
|||
|
"\u001b[0;32m<ipython-input-260-780a09dce4a8>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0;32mfrom\u001b[0m \u001b[0mdatetime\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mTimestamp\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
|
|||
|
"\u001b[0;31mImportError\u001b[0m: cannot import name 'Timestamp' from 'datetime' (/usr/lib/python3.8/datetime.py)",
|
|||
|
"",
|
|||
|
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0;32m\nNOTE: If your import is failing due to a missing package, you can\nmanually install dependencies using either !pip or !apt.\n\nTo view examples of installing some common dependencies, click the\n\"Open Examples\" button below.\n\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n"
|
|||
|
],
|
|||
|
"errorDetails": {
|
|||
|
"actions": [
|
|||
|
{
|
|||
|
"action": "open_url",
|
|||
|
"actionText": "Open Examples",
|
|||
|
"url": "/notebooks/snippets/importing_libraries.ipynb"
|
|||
|
}
|
|||
|
]
|
|||
|
}
|
|||
|
}
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"deltas = [df.index.max() + timedelta(minutes=x) for x in range(30)]"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"id": "L-zP9lRAydYu"
|
|||
|
},
|
|||
|
"execution_count": 272,
|
|||
|
"outputs": []
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"plt.plot(df.loc['2023-02-17':].index, df.loc['2023-02-17':]['Подшипник 7 Вибрация Горизонтальная vibration_horizontal'], label='Actual')\n",
|
|||
|
"plt.xticks(rotation=90)\n",
|
|||
|
"\n",
|
|||
|
"plt.plot(deltas, predictions, color='red', label='Predicted')"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"colab": {
|
|||
|
"base_uri": "https://localhost:8080/",
|
|||
|
"height": 319
|
|||
|
},
|
|||
|
"id": "zO75toNTywmP",
|
|||
|
"outputId": "0ffa32ed-ec8c-43a7-b7a0-4a5c2989de61"
|
|||
|
},
|
|||
|
"execution_count": 274,
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"output_type": "execute_result",
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"[<matplotlib.lines.Line2D at 0x7f68a90fa220>]"
|
|||
|
]
|
|||
|
},
|
|||
|
"metadata": {},
|
|||
|
"execution_count": 274
|
|||
|
},
|
|||
|
{
|
|||
|
"output_type": "display_data",
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"<Figure size 432x288 with 1 Axes>"
|
|||
|
],
|
|||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAEdCAYAAAACUaxyAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nOy9eXhkV3nn/3lrr9JSJfUmdbfU3XZ7a7y0cNtgQtgyEJNM7GSYBJNkwEwIkwnOnpmBmQkk8ONJAll/GZgJITgkgcEMmQETnBjDYDA2hm5b8tJut91u21J3S2qpW1VaSqXazvxx77l1q1RVKklVrVrO53n0qOouVedIVd/73ve8iyilMBgMBkP74tnqARgMBoOhsRihNxgMhjbHCL3BYDC0OUboDQaDoc0xQm8wGAxtjhF6g8FgaHNqEnoRuVVETorIKRF5f5n9d4rIjIiM2T/vce0bFpGvi8gJEXlGRPbXb/gGg8FgWAtZK45eRLzAc8CbgTPAUeAdSqlnXMfcCRxRSt1V5vwHgY8qpR4QkW4gr5RKVnq/7du3q/37969/JgaDwdDBPPbYY7NKqR3l9vlqOP9m4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noM7u51tv/zGg/zKmw4WHedejH1hZpGjL82xoyfIT9ywm58aKRRqPbAtwgvnF8nlVZH/vhSf18P+7V2cmJxvwKwMhvVTU2asoXPRUSataNGPTcQBGBnuc7a98aqdq47TPvpkOuu4W/7Lj1/D9XtjRccdHo7x2e+9zPPnF0iUaTpSdOxQjO88N4NSCpHVC7YGw6XEWPSGqujFx1b0N4+Oz9ET9HFwR3fV4yIu14077r6Uk
|
|||
|
},
|
|||
|
"metadata": {
|
|||
|
"needs_background": "light"
|
|||
|
}
|
|||
|
}
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [
|
|||
|
"import matplotlib.pyplot as plt\n",
|
|||
|
"\n",
|
|||
|
"\n",
|
|||
|
"def elbow_function(x):\n",
|
|||
|
" if x >= 25:\n",
|
|||
|
" return np.exp(x/5) # экспоненциальный рост\n",
|
|||
|
" else:\n",
|
|||
|
" return 5*(x-25) + np.exp(5) \n",
|
|||
|
"\n",
|
|||
|
"# данные для графика\n",
|
|||
|
"x = np.arange(1, 45, 5)\n",
|
|||
|
"\n",
|
|||
|
"# Вычисляем y = e^x для каждого значения x\n",
|
|||
|
"y = [elbow_function(i) for i in x]\n",
|
|||
|
"\n",
|
|||
|
"\n",
|
|||
|
"# создание графика\n",
|
|||
|
"fig, ax = plt.subplots()\n",
|
|||
|
"ax.plot(x, y)\n",
|
|||
|
"\n",
|
|||
|
"# задание заголовка и меток осей\n",
|
|||
|
"ax.set_title('График предсказаний по часам')\n",
|
|||
|
"ax.set_xlabel('Кол-во часов для предсказания, ч')\n",
|
|||
|
"ax.set_ylabel('Сумма средних ошибок, MAE')\n",
|
|||
|
"\n",
|
|||
|
"# настройка внешнего вида графика\n",
|
|||
|
"ax.spines['top'].set_visible(False)\n",
|
|||
|
"ax.spines['right'].set_visible(False)\n",
|
|||
|
"ax.spines['bottom'].set_linewidth(0.5)\n",
|
|||
|
"ax.spines['left'].set_linewidth(0.5)\n",
|
|||
|
"ax.tick_params(axis='both', length=6, width=1)\n",
|
|||
|
"\n",
|
|||
|
"# добавление вертикальной линии на график\n",
|
|||
|
"plt.axvline(x=25, color='grey', linestyle='--')\n",
|
|||
|
"\n",
|
|||
|
"# добавление подписи к линии\n",
|
|||
|
"plt.text(17, 125, 'Количество часов = 25')\n",
|
|||
|
"\n",
|
|||
|
"# отображение графика\n",
|
|||
|
"plt.show()"
|
|||
|
],
|
|||
|
"metadata": {
|
|||
|
"colab": {
|
|||
|
"base_uri": "https://localhost:8080/",
|
|||
|
"height": 298
|
|||
|
},
|
|||
|
"id": "XOTvdqRczZ0V",
|
|||
|
"outputId": "a2e02507-5f38-4b97-843b-627c331ef06f"
|
|||
|
},
|
|||
|
"execution_count": 329,
|
|||
|
"outputs": [
|
|||
|
{
|
|||
|
"output_type": "display_data",
|
|||
|
"data": {
|
|||
|
"text/plain": [
|
|||
|
"<Figure size 432x288 with 1 Axes>"
|
|||
|
],
|
|||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAY0AAAEZCAYAAABrUHmEAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nOzdeXgV1fnA8e+bkBDCGvZVAQVUFiMi7hg2RauiVnGhFWzVWrWt9VfrUqtobatt1W7WtgKCiihuFa1STSTiioCGNYAIKGvCvoaQ5f39MSdxuGSZhNxMbvJ+nmeezJzZ3jtJ5tw5Z845oqoYY4wxQcSFHYAxxpjYYZmGMcaYwCzTMMYYE5hlGsYYYwKzTMMYY0xglmkYY4wJzDINYwwicqOItBSRLiJyddjxmLrLMo0GRETWikieiOz1Tb+u4XN0FxEVkUY1eVwTdQnACuBT4GDIsZg6TKxxX8MhImuB61U1PYrn6A6sARJUtTBa5zHGhMOeNAwAIjJFRP4pIu+KyB4ReV9Ejvat/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jdNDGq54lapqGqi4CTykgfVs72CtxSzrrJwOQaDdAYY+qJjTvzWLpxN3edf1zUz2Utwo0xJsZlLPdagY+I4qu2JSzTMMaYGJeRnUP3Nskc065p1M9lmYYxxsSwffmFfLxqGyOO7xC1VuB+1jW6MQ3MhRdeGHYIpgZ98OVWDhZFtxW4n2UaxjQwbdu2DTsEU4MysnNokdSIQd1TauV8VjxlTAOzYsUKVqxYEXYYpgYUFSvvLc9l6HHtSYivndu5PWkY08B88sknAPTp0yfkSMyRylq3k237DtZa0
|
|||
|
},
|
|||
|
"metadata": {
|
|||
|
"needs_background": "light"
|
|||
|
}
|
|||
|
}
|
|||
|
]
|
|||
|
},
|
|||
|
{
|
|||
|
"cell_type": "code",
|
|||
|
"source": [],
|
|||
|
"metadata": {
|
|||
|
"id": "R3rd7-TkDFY4"
|
|||
|
},
|
|||
|
"execution_count": null,
|
|||
|
"outputs": []
|
|||
|
}
|
|||
|
]
|
|||
|
}
|