File size: 5,341 Bytes
eeaf86d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2c18c58
eeaf86d
 
 
 
 
 
 
 
2c18c58
eeaf86d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2c18c58
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
eeaf86d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from data_loading import create_features_and_targets\n",
    "from data_api_calls import get_data\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "dataset = pd.read_csv(\"dataset.csv\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Number of rows with missing values dropped: 7\n"
     ]
    }
   ],
   "source": [
    "test_data = create_features_and_targets(\n",
    "    data=dataset,\n",
    "    target_particle=\"NO2\",\n",
    "    lag_days=7,\n",
    "    sma_days=7,\n",
    "    days_ahead=3,\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<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>NO2</th>\n",
       "      <th>O3</th>\n",
       "      <th>wind_speed</th>\n",
       "      <th>mean_temp</th>\n",
       "      <th>global_radiation</th>\n",
       "      <th>percipitation</th>\n",
       "      <th>pressure</th>\n",
       "      <th>minimum_visibility</th>\n",
       "      <th>humidity</th>\n",
       "      <th>weekday_sin</th>\n",
       "      <th>...</th>\n",
       "      <th>O3_last_year_4_days_before</th>\n",
       "      <th>NO2_last_year_4_days_before</th>\n",
       "      <th>O3_last_year_5_days_before</th>\n",
       "      <th>NO2_last_year_5_days_before</th>\n",
       "      <th>O3_last_year_6_days_before</th>\n",
       "      <th>NO2_last_year_6_days_before</th>\n",
       "      <th>O3_last_year_7_days_before</th>\n",
       "      <th>NO2_last_year_7_days_before</th>\n",
       "      <th>O3_last_year_3_days_after</th>\n",
       "      <th>NO2_last_year_3_days_after</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>20.281667</td>\n",
       "      <td>25.787521</td>\n",
       "      <td>76</td>\n",
       "      <td>121</td>\n",
       "      <td>54</td>\n",
       "      <td>97</td>\n",
       "      <td>10266</td>\n",
       "      <td>116</td>\n",
       "      <td>87</td>\n",
       "      <td>0.781831</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1 rows × 103 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "         NO2         O3  wind_speed  mean_temp  global_radiation  \\\n",
       "0  20.281667  25.787521          76        121                54   \n",
       "\n",
       "   percipitation  pressure  minimum_visibility  humidity  weekday_sin  ...  \\\n",
       "0             97     10266                 116        87     0.781831  ...   \n",
       "\n",
       "   O3_last_year_4_days_before  NO2_last_year_4_days_before  \\\n",
       "0                           0                            0   \n",
       "\n",
       "   O3_last_year_5_days_before  NO2_last_year_5_days_before  \\\n",
       "0                           0                            0   \n",
       "\n",
       "   O3_last_year_6_days_before  NO2_last_year_6_days_before  \\\n",
       "0                           0                            0   \n",
       "\n",
       "   O3_last_year_7_days_before  NO2_last_year_7_days_before  \\\n",
       "0                           0                            0   \n",
       "\n",
       "   O3_last_year_3_days_after  NO2_last_year_3_days_after  \n",
       "0                          0                           0  \n",
       "\n",
       "[1 rows x 103 columns]"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test_data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "ml-industry",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}