Spaces:
No application file
No application file
Updated_preprocessing_done
Browse files- TSLA_stock_price.csv +1 -0
- __pycache__/feature_pipeline.cpython-311.pyc +0 -0
- __pycache__/news_preprocessing.cpython-311.pyc +0 -0
- feature_pipeline.ipynb +179 -261
- feature_pipeline.py +1 -1
- feature_view_freddie.ipynb +24 -136
- historical_news.ipynb +153 -729
- historical_stock.ipynb +8 -8
- news_articles.csv +0 -0
- news_articles_ema.csv +0 -0
- news_preprocessing.ipynb +1 -0
- news_preprocessing.py +1 -0
- requirements.txt +1 -1
- training_pipeline.ipynb +245 -0
TSLA_stock_price.csv
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
date,1. open,2. high,3. low,4. close,5. volume,ticker
|
|
|
2 |
2024-05-02,182.86,184.6,176.02,180.01,89148041.0,TSLA
|
3 |
2024-05-01,182.0,185.86,179.01,179.99,92829719.0,TSLA
|
4 |
2024-04-30,186.98,190.95,182.8401,183.28,127031787.0,TSLA
|
|
|
1 |
date,1. open,2. high,3. low,4. close,5. volume,ticker
|
2 |
+
2024-05-03,182.1,184.78,178.42,181.19,75491539.0,TSLA
|
3 |
2024-05-02,182.86,184.6,176.02,180.01,89148041.0,TSLA
|
4 |
2024-05-01,182.0,185.86,179.01,179.99,92829719.0,TSLA
|
5 |
2024-04-30,186.98,190.95,182.8401,183.28,127031787.0,TSLA
|
__pycache__/feature_pipeline.cpython-311.pyc
CHANGED
Binary files a/__pycache__/feature_pipeline.cpython-311.pyc and b/__pycache__/feature_pipeline.cpython-311.pyc differ
|
|
__pycache__/news_preprocessing.cpython-311.pyc
CHANGED
Binary files a/__pycache__/news_preprocessing.cpython-311.pyc and b/__pycache__/news_preprocessing.cpython-311.pyc differ
|
|
feature_pipeline.ipynb
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
"cells": [
|
3 |
{
|
4 |
"cell_type": "code",
|
5 |
-
"execution_count":
|
6 |
"metadata": {},
|
7 |
"outputs": [],
|
8 |
"source": [
|
@@ -12,136 +12,109 @@
|
|
12 |
},
|
13 |
{
|
14 |
"cell_type": "code",
|
15 |
-
"execution_count":
|
16 |
"metadata": {},
|
17 |
"outputs": [
|
18 |
{
|
19 |
"name": "stdout",
|
20 |
"output_type": "stream",
|
21 |
"text": [
|
22 |
-
"
|
23 |
-
"
|
24 |
-
"Requirement already satisfied:
|
25 |
-
"Requirement already satisfied:
|
26 |
-
"Requirement already satisfied:
|
27 |
-
"Requirement already satisfied:
|
28 |
-
"Requirement already satisfied:
|
29 |
-
"Requirement already satisfied:
|
30 |
-
"Requirement already satisfied:
|
31 |
-
"Requirement already satisfied:
|
32 |
-
"Requirement already satisfied:
|
33 |
-
"Requirement already satisfied:
|
34 |
-
"Requirement already satisfied:
|
35 |
-
"Requirement already satisfied:
|
36 |
-
"Requirement already satisfied:
|
37 |
-
"Requirement already satisfied:
|
38 |
-
"Requirement already satisfied:
|
39 |
-
"Requirement already satisfied:
|
40 |
-
"Requirement already satisfied:
|
41 |
-
"Requirement already satisfied:
|
42 |
-
"Requirement already satisfied:
|
43 |
-
"Requirement already satisfied:
|
44 |
-
"Requirement already satisfied:
|
45 |
-
"Requirement already satisfied:
|
46 |
-
"Requirement already satisfied:
|
47 |
-
"Requirement already satisfied:
|
48 |
-
"Requirement already satisfied:
|
49 |
-
"Requirement already satisfied:
|
50 |
-
"Requirement already satisfied:
|
51 |
-
"Requirement already satisfied:
|
52 |
-
"Requirement already satisfied:
|
53 |
-
"Requirement already satisfied:
|
54 |
-
"Requirement already satisfied:
|
55 |
-
"Requirement already satisfied: decorator in
|
56 |
-
"Requirement already satisfied: jedi>=0.16 in
|
57 |
-
"Requirement already satisfied: matplotlib-inline in
|
58 |
-
"Requirement already satisfied:
|
59 |
-
"Requirement already satisfied:
|
60 |
-
"Requirement already satisfied:
|
61 |
-
"Requirement already satisfied:
|
62 |
-
"Requirement already satisfied:
|
63 |
-
"Requirement already satisfied:
|
64 |
-
"Requirement already satisfied:
|
65 |
-
"Requirement already satisfied:
|
66 |
-
"Requirement already satisfied:
|
67 |
-
"Requirement already satisfied:
|
68 |
-
"Requirement already satisfied:
|
69 |
-
"Requirement already satisfied:
|
70 |
-
"Requirement already satisfied:
|
71 |
-
"Requirement already satisfied:
|
72 |
-
"Requirement already satisfied:
|
73 |
-
"Requirement already satisfied: jupyter-
|
74 |
-
"Requirement already satisfied:
|
75 |
-
"Requirement already satisfied:
|
76 |
-
"Requirement already satisfied:
|
77 |
-
"Requirement already satisfied:
|
78 |
-
"Requirement already satisfied:
|
79 |
-
"Requirement already satisfied:
|
80 |
-
"Requirement already satisfied:
|
81 |
-
"Requirement already satisfied:
|
82 |
-
"Requirement already satisfied:
|
83 |
-
"Requirement already satisfied:
|
84 |
-
"Requirement already satisfied:
|
85 |
-
"Requirement already satisfied:
|
86 |
-
"Requirement already satisfied:
|
87 |
-
"Requirement already satisfied:
|
88 |
-
"Requirement already satisfied:
|
89 |
-
"Requirement already satisfied:
|
90 |
-
"Requirement already satisfied:
|
91 |
-
"Requirement already satisfied:
|
92 |
-
"Requirement already satisfied:
|
93 |
-
"Requirement already satisfied:
|
94 |
-
"Requirement already satisfied:
|
95 |
-
"Requirement already satisfied:
|
96 |
-
"Requirement already satisfied:
|
97 |
-
"Requirement already satisfied:
|
98 |
-
"Requirement already satisfied:
|
99 |
-
"Requirement already satisfied:
|
100 |
-
"Requirement already satisfied:
|
101 |
-
"Requirement already satisfied:
|
102 |
-
"Requirement already satisfied:
|
103 |
-
"Requirement already satisfied:
|
104 |
-
"Requirement already satisfied:
|
105 |
-
"Requirement already satisfied:
|
106 |
-
"Requirement already satisfied:
|
107 |
-
"Requirement already satisfied:
|
108 |
-
"Requirement already satisfied: wcwidth in
|
109 |
-
"Requirement already satisfied:
|
110 |
-
"Requirement already satisfied:
|
111 |
-
"Requirement already satisfied:
|
112 |
-
"Requirement already satisfied:
|
113 |
-
"Requirement already satisfied:
|
114 |
-
"Requirement already satisfied:
|
115 |
-
"Requirement already satisfied:
|
116 |
-
"Requirement already satisfied:
|
117 |
-
"Requirement already satisfied:
|
118 |
-
"Requirement already satisfied: psutil in c:\\users\\frede\\onedrive\\dokumenter\\master\\mlops\\mlops_mod-2\\.conda\\lib\\site-packages (from ipykernel>=6.5.0->jupyterlab<4.2,>=4.1.1->notebook>=6.4.10->great_expectations==0.18.12) (5.9.0)\n",
|
119 |
-
"Requirement already satisfied: python-json-logger>=2.0.4 in c:\\users\\frede\\onedrive\\dokumenter\\master\\mlops\\mlops_mod-2\\.conda\\lib\\site-packages (from jupyter-events>=0.9.0->jupyter-server<3,>=2.4.0->notebook>=6.4.10->great_expectations==0.18.12) (2.0.7)\n",
|
120 |
-
"Requirement already satisfied: pyyaml>=5.3 in c:\\users\\frede\\onedrive\\dokumenter\\master\\mlops\\mlops_mod-2\\.conda\\lib\\site-packages (from jupyter-events>=0.9.0->jupyter-server<3,>=2.4.0->notebook>=6.4.10->great_expectations==0.18.12) (6.0.1)\n",
|
121 |
-
"Requirement already satisfied: rfc3339-validator in c:\\users\\frede\\onedrive\\dokumenter\\master\\mlops\\mlops_mod-2\\.conda\\lib\\site-packages (from jupyter-events>=0.9.0->jupyter-server<3,>=2.4.0->notebook>=6.4.10->great_expectations==0.18.12) (0.1.4)\n",
|
122 |
-
"Requirement already satisfied: rfc3986-validator>=0.1.1 in c:\\users\\frede\\onedrive\\dokumenter\\master\\mlops\\mlops_mod-2\\.conda\\lib\\site-packages (from jupyter-events>=0.9.0->jupyter-server<3,>=2.4.0->notebook>=6.4.10->great_expectations==0.18.12) (0.1.1)\n",
|
123 |
-
"Requirement already satisfied: beautifulsoup4 in c:\\users\\frede\\onedrive\\dokumenter\\master\\mlops\\mlops_mod-2\\.conda\\lib\\site-packages (from nbconvert>=6.4.4->jupyter-server<3,>=2.4.0->notebook>=6.4.10->great_expectations==0.18.12) (4.12.3)\n",
|
124 |
-
"Requirement already satisfied: bleach!=5.0.0 in c:\\users\\frede\\onedrive\\dokumenter\\master\\mlops\\mlops_mod-2\\.conda\\lib\\site-packages (from nbconvert>=6.4.4->jupyter-server<3,>=2.4.0->notebook>=6.4.10->great_expectations==0.18.12) (6.1.0)\n",
|
125 |
-
"Requirement already satisfied: defusedxml in c:\\users\\frede\\onedrive\\dokumenter\\master\\mlops\\mlops_mod-2\\.conda\\lib\\site-packages (from nbconvert>=6.4.4->jupyter-server<3,>=2.4.0->notebook>=6.4.10->great_expectations==0.18.12) (0.7.1)\n",
|
126 |
-
"Requirement already satisfied: jupyterlab-pygments in c:\\users\\frede\\onedrive\\dokumenter\\master\\mlops\\mlops_mod-2\\.conda\\lib\\site-packages (from nbconvert>=6.4.4->jupyter-server<3,>=2.4.0->notebook>=6.4.10->great_expectations==0.18.12) (0.3.0)\n",
|
127 |
-
"Requirement already satisfied: nbclient>=0.5.0 in c:\\users\\frede\\onedrive\\dokumenter\\master\\mlops\\mlops_mod-2\\.conda\\lib\\site-packages (from nbconvert>=6.4.4->jupyter-server<3,>=2.4.0->notebook>=6.4.10->great_expectations==0.18.12) (0.10.0)\n",
|
128 |
-
"Requirement already satisfied: pandocfilters>=1.4.1 in c:\\users\\frede\\onedrive\\dokumenter\\master\\mlops\\mlops_mod-2\\.conda\\lib\\site-packages (from nbconvert>=6.4.4->jupyter-server<3,>=2.4.0->notebook>=6.4.10->great_expectations==0.18.12) (1.5.1)\n",
|
129 |
-
"Requirement already satisfied: tinycss2 in c:\\users\\frede\\onedrive\\dokumenter\\master\\mlops\\mlops_mod-2\\.conda\\lib\\site-packages (from nbconvert>=6.4.4->jupyter-server<3,>=2.4.0->notebook>=6.4.10->great_expectations==0.18.12) (1.3.0)\n",
|
130 |
-
"Requirement already satisfied: webencodings in c:\\users\\frede\\onedrive\\dokumenter\\master\\mlops\\mlops_mod-2\\.conda\\lib\\site-packages (from bleach!=5.0.0->nbconvert>=6.4.4->jupyter-server<3,>=2.4.0->notebook>=6.4.10->great_expectations==0.18.12) (0.5.1)\n",
|
131 |
-
"Requirement already satisfied: fqdn in c:\\users\\frede\\onedrive\\dokumenter\\master\\mlops\\mlops_mod-2\\.conda\\lib\\site-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=2.4.0->notebook>=6.4.10->great_expectations==0.18.12) (1.5.1)\n",
|
132 |
-
"Requirement already satisfied: isoduration in c:\\users\\frede\\onedrive\\dokumenter\\master\\mlops\\mlops_mod-2\\.conda\\lib\\site-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=2.4.0->notebook>=6.4.10->great_expectations==0.18.12) (20.11.0)\n",
|
133 |
-
"Requirement already satisfied: uri-template in c:\\users\\frede\\onedrive\\dokumenter\\master\\mlops\\mlops_mod-2\\.conda\\lib\\site-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=2.4.0->notebook>=6.4.10->great_expectations==0.18.12) (1.3.0)\n",
|
134 |
-
"Requirement already satisfied: webcolors>=1.11 in c:\\users\\frede\\onedrive\\dokumenter\\master\\mlops\\mlops_mod-2\\.conda\\lib\\site-packages (from jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=2.4.0->notebook>=6.4.10->great_expectations==0.18.12) (1.13)\n",
|
135 |
-
"Requirement already satisfied: soupsieve>1.2 in c:\\users\\frede\\onedrive\\dokumenter\\master\\mlops\\mlops_mod-2\\.conda\\lib\\site-packages (from beautifulsoup4->nbconvert>=6.4.4->jupyter-server<3,>=2.4.0->notebook>=6.4.10->great_expectations==0.18.12) (2.5)\n",
|
136 |
-
"Requirement already satisfied: arrow>=0.15.0 in c:\\users\\frede\\onedrive\\dokumenter\\master\\mlops\\mlops_mod-2\\.conda\\lib\\site-packages (from isoduration->jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=2.4.0->notebook>=6.4.10->great_expectations==0.18.12) (1.3.0)\n",
|
137 |
-
"Requirement already satisfied: types-python-dateutil>=2.8.10 in c:\\users\\frede\\onedrive\\dokumenter\\master\\mlops\\mlops_mod-2\\.conda\\lib\\site-packages (from arrow>=0.15.0->isoduration->jsonschema[format-nongpl]>=4.18.0->jupyter-events>=0.9.0->jupyter-server<3,>=2.4.0->notebook>=6.4.10->great_expectations==0.18.12) (2.9.0.20240316)\n",
|
138 |
-
"Using cached great_expectations-0.18.12-py3-none-any.whl (5.4 MB)\n",
|
139 |
-
"Installing collected packages: great_expectations\n",
|
140 |
-
" Attempting uninstall: great_expectations\n",
|
141 |
-
" Found existing installation: great-expectations 0.18.13\n",
|
142 |
-
" Uninstalling great-expectations-0.18.13:\n",
|
143 |
-
" Successfully uninstalled great-expectations-0.18.13\n",
|
144 |
-
"Successfully installed great_expectations-0.18.12\n"
|
145 |
]
|
146 |
}
|
147 |
],
|
@@ -151,7 +124,7 @@
|
|
151 |
},
|
152 |
{
|
153 |
"cell_type": "code",
|
154 |
-
"execution_count":
|
155 |
"metadata": {},
|
156 |
"outputs": [],
|
157 |
"source": [
|
@@ -172,23 +145,9 @@
|
|
172 |
},
|
173 |
{
|
174 |
"cell_type": "code",
|
175 |
-
"execution_count":
|
176 |
"metadata": {},
|
177 |
-
"outputs": [
|
178 |
-
{
|
179 |
-
"name": "stdout",
|
180 |
-
"output_type": "stream",
|
181 |
-
"text": [
|
182 |
-
" 1. open 2. high 3. low 4. close 5. volume\n",
|
183 |
-
"date \n",
|
184 |
-
"2024-05-03 182.10 184.78 178.4200 181.19 75491539.0\n",
|
185 |
-
"2024-05-02 182.86 184.60 176.0200 180.01 89148041.0\n",
|
186 |
-
"2024-05-01 182.00 185.86 179.0100 179.99 92829719.0\n",
|
187 |
-
"2024-04-30 186.98 190.95 182.8401 183.28 127031787.0\n",
|
188 |
-
"2024-04-29 188.42 198.87 184.5400 194.05 243869678.0\n"
|
189 |
-
]
|
190 |
-
}
|
191 |
-
],
|
192 |
"source": [
|
193 |
"#from alpha_vantage.timeseries import TimeSeries\n",
|
194 |
"#import pandas as pd\n",
|
@@ -206,69 +165,27 @@
|
|
206 |
},
|
207 |
{
|
208 |
"cell_type": "code",
|
209 |
-
"execution_count":
|
210 |
"metadata": {},
|
211 |
-
"outputs": [
|
212 |
-
{
|
213 |
-
"name": "stdout",
|
214 |
-
"output_type": "stream",
|
215 |
-
"text": [
|
216 |
-
"<class 'pandas.core.frame.DataFrame'>\n",
|
217 |
-
"DatetimeIndex: 3483 entries, 2024-04-30 to 2010-06-29\n",
|
218 |
-
"Data columns (total 5 columns):\n",
|
219 |
-
" # Column Non-Null Count Dtype \n",
|
220 |
-
"--- ------ -------------- ----- \n",
|
221 |
-
" 0 1. open 3483 non-null float64\n",
|
222 |
-
" 1 2. high 3483 non-null float64\n",
|
223 |
-
" 2 3. low 3483 non-null float64\n",
|
224 |
-
" 3 4. close 3483 non-null float64\n",
|
225 |
-
" 4 5. volume 3483 non-null float64\n",
|
226 |
-
"dtypes: float64(5)\n",
|
227 |
-
"memory usage: 163.3 KB\n"
|
228 |
-
]
|
229 |
-
}
|
230 |
-
],
|
231 |
"source": [
|
232 |
"#data.info()"
|
233 |
]
|
234 |
},
|
235 |
{
|
236 |
"cell_type": "code",
|
237 |
-
"execution_count":
|
238 |
"metadata": {},
|
239 |
-
"outputs": [
|
240 |
-
{
|
241 |
-
"data": {
|
242 |
-
"text/plain": [
|
243 |
-
"{'1. Information': 'Daily Prices (open, high, low, close) and Volumes',\n",
|
244 |
-
" '2. Symbol': 'TSLA',\n",
|
245 |
-
" '3. Last Refreshed': '2024-04-30',\n",
|
246 |
-
" '4. Output Size': 'Full size',\n",
|
247 |
-
" '5. Time Zone': 'US/Eastern'}"
|
248 |
-
]
|
249 |
-
},
|
250 |
-
"execution_count": 6,
|
251 |
-
"metadata": {},
|
252 |
-
"output_type": "execute_result"
|
253 |
-
}
|
254 |
-
],
|
255 |
"source": [
|
256 |
"#meta_data"
|
257 |
]
|
258 |
},
|
259 |
{
|
260 |
"cell_type": "code",
|
261 |
-
"execution_count":
|
262 |
"metadata": {},
|
263 |
-
"outputs": [
|
264 |
-
{
|
265 |
-
"name": "stdout",
|
266 |
-
"output_type": "stream",
|
267 |
-
"text": [
|
268 |
-
"Data saved to /Users/manos/Documents/BDS/MLops_mod/TSLA_stock_price.csv\n"
|
269 |
-
]
|
270 |
-
}
|
271 |
-
],
|
272 |
"source": [
|
273 |
"# Define your file path and name\n",
|
274 |
"#file_path = 'TSLA_stock_price.csv' # Customize the path and filename\n",
|
@@ -281,7 +198,7 @@
|
|
281 |
},
|
282 |
{
|
283 |
"cell_type": "code",
|
284 |
-
"execution_count":
|
285 |
"metadata": {},
|
286 |
"outputs": [
|
287 |
{
|
@@ -289,11 +206,11 @@
|
|
289 |
"output_type": "stream",
|
290 |
"text": [
|
291 |
" date 1. open 2. high 3. low 4. close 5. volume ticker\n",
|
292 |
-
"0 2024-05-
|
293 |
-
"1 2024-05-
|
294 |
-
"2 2024-
|
295 |
-
"3 2024-04-
|
296 |
-
"4 2024-04-
|
297 |
]
|
298 |
}
|
299 |
],
|
@@ -306,16 +223,17 @@
|
|
306 |
},
|
307 |
{
|
308 |
"cell_type": "code",
|
309 |
-
"execution_count":
|
310 |
"metadata": {},
|
311 |
"outputs": [
|
312 |
{
|
313 |
"name": "stdout",
|
314 |
"output_type": "stream",
|
315 |
"text": [
|
|
|
316 |
"Connected. Call `.close()` to terminate connection gracefully.\n",
|
317 |
"\n",
|
318 |
-
"Logged in to project, explore it here https://c.app.hopsworks.ai:443/p/
|
319 |
"Connected. Call `.close()` to terminate connection gracefully.\n"
|
320 |
]
|
321 |
}
|
@@ -328,7 +246,7 @@
|
|
328 |
},
|
329 |
{
|
330 |
"cell_type": "code",
|
331 |
-
"execution_count":
|
332 |
"metadata": {},
|
333 |
"outputs": [],
|
334 |
"source": [
|
@@ -337,7 +255,7 @@
|
|
337 |
},
|
338 |
{
|
339 |
"cell_type": "code",
|
340 |
-
"execution_count":
|
341 |
"metadata": {},
|
342 |
"outputs": [],
|
343 |
"source": [
|
@@ -349,7 +267,7 @@
|
|
349 |
},
|
350 |
{
|
351 |
"cell_type": "code",
|
352 |
-
"execution_count":
|
353 |
"metadata": {},
|
354 |
"outputs": [
|
355 |
{
|
@@ -385,6 +303,16 @@
|
|
385 |
" <tbody>\n",
|
386 |
" <tr>\n",
|
387 |
" <th>0</th>\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
388 |
" <td>2024-05-02</td>\n",
|
389 |
" <td>182.86</td>\n",
|
390 |
" <td>184.6000</td>\n",
|
@@ -394,7 +322,7 @@
|
|
394 |
" <td>TSLA</td>\n",
|
395 |
" </tr>\n",
|
396 |
" <tr>\n",
|
397 |
-
" <th>
|
398 |
" <td>2024-05-01</td>\n",
|
399 |
" <td>182.00</td>\n",
|
400 |
" <td>185.8600</td>\n",
|
@@ -404,7 +332,7 @@
|
|
404 |
" <td>TSLA</td>\n",
|
405 |
" </tr>\n",
|
406 |
" <tr>\n",
|
407 |
-
" <th>
|
408 |
" <td>2024-04-30</td>\n",
|
409 |
" <td>186.98</td>\n",
|
410 |
" <td>190.9500</td>\n",
|
@@ -414,7 +342,7 @@
|
|
414 |
" <td>TSLA</td>\n",
|
415 |
" </tr>\n",
|
416 |
" <tr>\n",
|
417 |
-
" <th>
|
418 |
" <td>2024-04-29</td>\n",
|
419 |
" <td>188.42</td>\n",
|
420 |
" <td>198.8700</td>\n",
|
@@ -424,16 +352,6 @@
|
|
424 |
" <td>TSLA</td>\n",
|
425 |
" </tr>\n",
|
426 |
" <tr>\n",
|
427 |
-
" <th>4</th>\n",
|
428 |
-
" <td>2024-04-26</td>\n",
|
429 |
-
" <td>168.85</td>\n",
|
430 |
-
" <td>172.1200</td>\n",
|
431 |
-
" <td>166.3700</td>\n",
|
432 |
-
" <td>168.29</td>\n",
|
433 |
-
" <td>109815725.0</td>\n",
|
434 |
-
" <td>TSLA</td>\n",
|
435 |
-
" </tr>\n",
|
436 |
-
" <tr>\n",
|
437 |
" <th>...</th>\n",
|
438 |
" <td>...</td>\n",
|
439 |
" <td>...</td>\n",
|
@@ -444,7 +362,7 @@
|
|
444 |
" <td>...</td>\n",
|
445 |
" </tr>\n",
|
446 |
" <tr>\n",
|
447 |
-
" <th>
|
448 |
" <td>2010-07-06</td>\n",
|
449 |
" <td>20.00</td>\n",
|
450 |
" <td>20.0000</td>\n",
|
@@ -454,7 +372,7 @@
|
|
454 |
" <td>TSLA</td>\n",
|
455 |
" </tr>\n",
|
456 |
" <tr>\n",
|
457 |
-
" <th>
|
458 |
" <td>2010-07-02</td>\n",
|
459 |
" <td>23.00</td>\n",
|
460 |
" <td>23.1000</td>\n",
|
@@ -464,7 +382,7 @@
|
|
464 |
" <td>TSLA</td>\n",
|
465 |
" </tr>\n",
|
466 |
" <tr>\n",
|
467 |
-
" <th>
|
468 |
" <td>2010-07-01</td>\n",
|
469 |
" <td>25.00</td>\n",
|
470 |
" <td>25.9200</td>\n",
|
@@ -474,7 +392,7 @@
|
|
474 |
" <td>TSLA</td>\n",
|
475 |
" </tr>\n",
|
476 |
" <tr>\n",
|
477 |
-
" <th>
|
478 |
" <td>2010-06-30</td>\n",
|
479 |
" <td>25.79</td>\n",
|
480 |
" <td>30.4192</td>\n",
|
@@ -484,7 +402,7 @@
|
|
484 |
" <td>TSLA</td>\n",
|
485 |
" </tr>\n",
|
486 |
" <tr>\n",
|
487 |
-
" <th>
|
488 |
" <td>2010-06-29</td>\n",
|
489 |
" <td>19.00</td>\n",
|
490 |
" <td>25.0000</td>\n",
|
@@ -495,27 +413,27 @@
|
|
495 |
" </tr>\n",
|
496 |
" </tbody>\n",
|
497 |
"</table>\n",
|
498 |
-
"<p>
|
499 |
"</div>"
|
500 |
],
|
501 |
"text/plain": [
|
502 |
" date 1. open 2. high 3. low 4. close 5. volume ticker\n",
|
503 |
-
"0 2024-05-
|
504 |
-
"1 2024-05-
|
505 |
-
"2 2024-
|
506 |
-
"3 2024-04-
|
507 |
-
"4 2024-04-
|
508 |
"... ... ... ... ... ... ... ...\n",
|
509 |
-
"
|
510 |
-
"
|
511 |
-
"
|
512 |
-
"
|
513 |
-
"
|
514 |
"\n",
|
515 |
-
"[
|
516 |
]
|
517 |
},
|
518 |
-
"execution_count":
|
519 |
"metadata": {},
|
520 |
"output_type": "execute_result"
|
521 |
}
|
@@ -526,7 +444,7 @@
|
|
526 |
},
|
527 |
{
|
528 |
"cell_type": "code",
|
529 |
-
"execution_count":
|
530 |
"metadata": {},
|
531 |
"outputs": [],
|
532 |
"source": [
|
@@ -536,7 +454,7 @@
|
|
536 |
},
|
537 |
{
|
538 |
"cell_type": "code",
|
539 |
-
"execution_count":
|
540 |
"metadata": {},
|
541 |
"outputs": [
|
542 |
{
|
@@ -553,7 +471,7 @@
|
|
553 |
},
|
554 |
{
|
555 |
"cell_type": "code",
|
556 |
-
"execution_count":
|
557 |
"metadata": {},
|
558 |
"outputs": [],
|
559 |
"source": [
|
@@ -566,14 +484,14 @@
|
|
566 |
},
|
567 |
{
|
568 |
"cell_type": "code",
|
569 |
-
"execution_count":
|
570 |
"metadata": {},
|
571 |
"outputs": [
|
572 |
{
|
573 |
"name": "stdout",
|
574 |
"output_type": "stream",
|
575 |
"text": [
|
576 |
-
"2024-05-
|
577 |
"\n"
|
578 |
]
|
579 |
}
|
@@ -583,7 +501,7 @@
|
|
583 |
"tesla_fg = fs.get_or_create_feature_group(\n",
|
584 |
" name=\"tesla_stock\",\n",
|
585 |
" description=\"Tesla stock dataset from alpha vantage\",\n",
|
586 |
-
" version=
|
587 |
" primary_key=[\"ticker\"],\n",
|
588 |
" event_time=['date'],\n",
|
589 |
" online_enabled=False,\n",
|
@@ -592,7 +510,7 @@
|
|
592 |
},
|
593 |
{
|
594 |
"cell_type": "code",
|
595 |
-
"execution_count":
|
596 |
"metadata": {},
|
597 |
"outputs": [
|
598 |
{
|
@@ -600,18 +518,18 @@
|
|
600 |
"output_type": "stream",
|
601 |
"text": [
|
602 |
"Feature Group created successfully, explore it at \n",
|
603 |
-
"https://c.app.hopsworks.ai:443/p/
|
604 |
]
|
605 |
},
|
606 |
{
|
607 |
"data": {
|
608 |
"application/vnd.jupyter.widget-view+json": {
|
609 |
-
"model_id": "
|
610 |
"version_major": 2,
|
611 |
"version_minor": 0
|
612 |
},
|
613 |
"text/plain": [
|
614 |
-
"Uploading Dataframe: 0.00% | | Rows 0/
|
615 |
]
|
616 |
},
|
617 |
"metadata": {},
|
@@ -621,18 +539,18 @@
|
|
621 |
"name": "stdout",
|
622 |
"output_type": "stream",
|
623 |
"text": [
|
624 |
-
"Launching job:
|
625 |
"Job started successfully, you can follow the progress at \n",
|
626 |
-
"https://c.app.hopsworks.ai/p/
|
627 |
]
|
628 |
},
|
629 |
{
|
630 |
"data": {
|
631 |
"text/plain": [
|
632 |
-
"(<hsfs.core.job.Job at
|
633 |
]
|
634 |
},
|
635 |
-
"execution_count":
|
636 |
"metadata": {},
|
637 |
"output_type": "execute_result"
|
638 |
}
|
@@ -643,7 +561,7 @@
|
|
643 |
},
|
644 |
{
|
645 |
"cell_type": "code",
|
646 |
-
"execution_count":
|
647 |
"metadata": {},
|
648 |
"outputs": [],
|
649 |
"source": [
|
@@ -652,7 +570,7 @@
|
|
652 |
},
|
653 |
{
|
654 |
"cell_type": "code",
|
655 |
-
"execution_count":
|
656 |
"metadata": {},
|
657 |
"outputs": [],
|
658 |
"source": [
|
@@ -661,7 +579,7 @@
|
|
661 |
},
|
662 |
{
|
663 |
"cell_type": "code",
|
664 |
-
"execution_count":
|
665 |
"metadata": {},
|
666 |
"outputs": [],
|
667 |
"source": [
|
@@ -670,14 +588,14 @@
|
|
670 |
},
|
671 |
{
|
672 |
"cell_type": "code",
|
673 |
-
"execution_count":
|
674 |
"metadata": {},
|
675 |
"outputs": [
|
676 |
{
|
677 |
"name": "stdout",
|
678 |
"output_type": "stream",
|
679 |
"text": [
|
680 |
-
"2024-05-
|
681 |
"\n"
|
682 |
]
|
683 |
}
|
@@ -686,7 +604,7 @@
|
|
686 |
"news_sentiment_fg = fs.get_or_create_feature_group(\n",
|
687 |
" name='news_sentiment_updated',\n",
|
688 |
" description='News sentiment from Polygon',\n",
|
689 |
-
" version=
|
690 |
" primary_key=['ticker'],\n",
|
691 |
" event_time=['date'],\n",
|
692 |
" online_enabled=False,\n",
|
@@ -695,7 +613,7 @@
|
|
695 |
},
|
696 |
{
|
697 |
"cell_type": "code",
|
698 |
-
"execution_count":
|
699 |
"metadata": {},
|
700 |
"outputs": [
|
701 |
{
|
@@ -703,18 +621,18 @@
|
|
703 |
"output_type": "stream",
|
704 |
"text": [
|
705 |
"Feature Group created successfully, explore it at \n",
|
706 |
-
"https://c.app.hopsworks.ai:443/p/
|
707 |
]
|
708 |
},
|
709 |
{
|
710 |
"data": {
|
711 |
"application/vnd.jupyter.widget-view+json": {
|
712 |
-
"model_id": "
|
713 |
"version_major": 2,
|
714 |
"version_minor": 0
|
715 |
},
|
716 |
"text/plain": [
|
717 |
-
"Uploading Dataframe: 0.00% | | Rows 0/
|
718 |
]
|
719 |
},
|
720 |
"metadata": {},
|
@@ -724,18 +642,18 @@
|
|
724 |
"name": "stdout",
|
725 |
"output_type": "stream",
|
726 |
"text": [
|
727 |
-
"Launching job:
|
728 |
"Job started successfully, you can follow the progress at \n",
|
729 |
-
"https://c.app.hopsworks.ai/p/
|
730 |
]
|
731 |
},
|
732 |
{
|
733 |
"data": {
|
734 |
"text/plain": [
|
735 |
-
"(<hsfs.core.job.Job at
|
736 |
]
|
737 |
},
|
738 |
-
"execution_count":
|
739 |
"metadata": {},
|
740 |
"output_type": "execute_result"
|
741 |
}
|
@@ -761,7 +679,7 @@
|
|
761 |
"name": "python",
|
762 |
"nbconvert_exporter": "python",
|
763 |
"pygments_lexer": "ipython3",
|
764 |
-
"version": "3.11.
|
765 |
},
|
766 |
"orig_nbformat": 4
|
767 |
},
|
|
|
2 |
"cells": [
|
3 |
{
|
4 |
"cell_type": "code",
|
5 |
+
"execution_count": 24,
|
6 |
"metadata": {},
|
7 |
"outputs": [],
|
8 |
"source": [
|
|
|
12 |
},
|
13 |
{
|
14 |
"cell_type": "code",
|
15 |
+
"execution_count": 25,
|
16 |
"metadata": {},
|
17 |
"outputs": [
|
18 |
{
|
19 |
"name": "stdout",
|
20 |
"output_type": "stream",
|
21 |
"text": [
|
22 |
+
"Requirement already satisfied: great_expectations==0.18.12 in /Applications/anaconda3/lib/python3.11/site-packages (0.18.12)\n",
|
23 |
+
"Requirement already satisfied: altair<5.0.0,>=4.2.1 in /Applications/anaconda3/lib/python3.11/site-packages (from great_expectations==0.18.12) (4.2.2)\n",
|
24 |
+
"Requirement already satisfied: Click>=7.1.2 in /Applications/anaconda3/lib/python3.11/site-packages (from great_expectations==0.18.12) (8.1.7)\n",
|
25 |
+
"Requirement already satisfied: colorama>=0.4.3 in /Applications/anaconda3/lib/python3.11/site-packages (from great_expectations==0.18.12) (0.4.6)\n",
|
26 |
+
"Requirement already satisfied: cryptography>=3.2 in /Applications/anaconda3/lib/python3.11/site-packages (from great_expectations==0.18.12) (41.0.2)\n",
|
27 |
+
"Requirement already satisfied: Ipython>=7.16.3 in /Applications/anaconda3/lib/python3.11/site-packages (from great_expectations==0.18.12) (8.12.0)\n",
|
28 |
+
"Requirement already satisfied: ipywidgets>=7.5.1 in /Applications/anaconda3/lib/python3.11/site-packages (from great_expectations==0.18.12) (8.0.4)\n",
|
29 |
+
"Requirement already satisfied: jinja2>=2.10 in /Applications/anaconda3/lib/python3.11/site-packages (from great_expectations==0.18.12) (3.0.3)\n",
|
30 |
+
"Requirement already satisfied: jsonpatch>=1.22 in /Applications/anaconda3/lib/python3.11/site-packages (from great_expectations==0.18.12) (1.33)\n",
|
31 |
+
"Requirement already satisfied: jsonschema>=2.5.1 in /Applications/anaconda3/lib/python3.11/site-packages (from great_expectations==0.18.12) (4.17.3)\n",
|
32 |
+
"Requirement already satisfied: makefun<2,>=1.7.0 in /Applications/anaconda3/lib/python3.11/site-packages (from great_expectations==0.18.12) (1.15.2)\n",
|
33 |
+
"Requirement already satisfied: marshmallow<4.0.0,>=3.7.1 in /Applications/anaconda3/lib/python3.11/site-packages (from great_expectations==0.18.12) (3.21.1)\n",
|
34 |
+
"Requirement already satisfied: mistune>=0.8.4 in /Applications/anaconda3/lib/python3.11/site-packages (from great_expectations==0.18.12) (0.8.4)\n",
|
35 |
+
"Requirement already satisfied: nbformat>=5.0 in /Applications/anaconda3/lib/python3.11/site-packages (from great_expectations==0.18.12) (5.7.0)\n",
|
36 |
+
"Requirement already satisfied: notebook>=6.4.10 in /Applications/anaconda3/lib/python3.11/site-packages (from great_expectations==0.18.12) (6.5.4)\n",
|
37 |
+
"Requirement already satisfied: packaging in /Applications/anaconda3/lib/python3.11/site-packages (from great_expectations==0.18.12) (23.2)\n",
|
38 |
+
"Requirement already satisfied: pydantic>=1.9.2 in /Applications/anaconda3/lib/python3.11/site-packages (from great_expectations==0.18.12) (2.6.4)\n",
|
39 |
+
"Requirement already satisfied: pyparsing>=2.4 in /Applications/anaconda3/lib/python3.11/site-packages (from great_expectations==0.18.12) (2.4.7)\n",
|
40 |
+
"Requirement already satisfied: python-dateutil>=2.8.1 in /Applications/anaconda3/lib/python3.11/site-packages (from great_expectations==0.18.12) (2.8.2)\n",
|
41 |
+
"Requirement already satisfied: pytz>=2021.3 in /Applications/anaconda3/lib/python3.11/site-packages (from great_expectations==0.18.12) (2022.7)\n",
|
42 |
+
"Requirement already satisfied: requests>=2.20 in /Applications/anaconda3/lib/python3.11/site-packages (from great_expectations==0.18.12) (2.31.0)\n",
|
43 |
+
"Requirement already satisfied: ruamel.yaml<0.17.18,>=0.16 in /Applications/anaconda3/lib/python3.11/site-packages (from great_expectations==0.18.12) (0.17.17)\n",
|
44 |
+
"Requirement already satisfied: scipy>=1.6.0 in /Applications/anaconda3/lib/python3.11/site-packages (from great_expectations==0.18.12) (1.10.1)\n",
|
45 |
+
"Requirement already satisfied: tqdm>=4.59.0 in /Applications/anaconda3/lib/python3.11/site-packages (from great_expectations==0.18.12) (4.66.2)\n",
|
46 |
+
"Requirement already satisfied: typing-extensions>=3.10.0.0 in /Applications/anaconda3/lib/python3.11/site-packages (from great_expectations==0.18.12) (4.7.1)\n",
|
47 |
+
"Requirement already satisfied: tzlocal>=1.2 in /Applications/anaconda3/lib/python3.11/site-packages (from great_expectations==0.18.12) (2.1)\n",
|
48 |
+
"Requirement already satisfied: urllib3>=1.26 in /Applications/anaconda3/lib/python3.11/site-packages (from great_expectations==0.18.12) (2.2.1)\n",
|
49 |
+
"Requirement already satisfied: numpy<2.0.0,>=1.22.4 in /Applications/anaconda3/lib/python3.11/site-packages (from great_expectations==0.18.12) (1.24.3)\n",
|
50 |
+
"Requirement already satisfied: pandas>=1.3.0 in /Applications/anaconda3/lib/python3.11/site-packages (from great_expectations==0.18.12) (1.5.1)\n",
|
51 |
+
"Requirement already satisfied: entrypoints in /Applications/anaconda3/lib/python3.11/site-packages (from altair<5.0.0,>=4.2.1->great_expectations==0.18.12) (0.4)\n",
|
52 |
+
"Requirement already satisfied: toolz in /Applications/anaconda3/lib/python3.11/site-packages (from altair<5.0.0,>=4.2.1->great_expectations==0.18.12) (0.12.0)\n",
|
53 |
+
"Requirement already satisfied: cffi>=1.12 in /Applications/anaconda3/lib/python3.11/site-packages (from cryptography>=3.2->great_expectations==0.18.12) (1.15.1)\n",
|
54 |
+
"Requirement already satisfied: backcall in /Applications/anaconda3/lib/python3.11/site-packages (from Ipython>=7.16.3->great_expectations==0.18.12) (0.2.0)\n",
|
55 |
+
"Requirement already satisfied: decorator in /Applications/anaconda3/lib/python3.11/site-packages (from Ipython>=7.16.3->great_expectations==0.18.12) (5.1.1)\n",
|
56 |
+
"Requirement already satisfied: jedi>=0.16 in /Applications/anaconda3/lib/python3.11/site-packages (from Ipython>=7.16.3->great_expectations==0.18.12) (0.18.1)\n",
|
57 |
+
"Requirement already satisfied: matplotlib-inline in /Applications/anaconda3/lib/python3.11/site-packages (from Ipython>=7.16.3->great_expectations==0.18.12) (0.1.6)\n",
|
58 |
+
"Requirement already satisfied: pickleshare in /Applications/anaconda3/lib/python3.11/site-packages (from Ipython>=7.16.3->great_expectations==0.18.12) (0.7.5)\n",
|
59 |
+
"Requirement already satisfied: prompt-toolkit!=3.0.37,<3.1.0,>=3.0.30 in /Applications/anaconda3/lib/python3.11/site-packages (from Ipython>=7.16.3->great_expectations==0.18.12) (3.0.36)\n",
|
60 |
+
"Requirement already satisfied: pygments>=2.4.0 in /Applications/anaconda3/lib/python3.11/site-packages (from Ipython>=7.16.3->great_expectations==0.18.12) (2.15.1)\n",
|
61 |
+
"Requirement already satisfied: stack-data in /Applications/anaconda3/lib/python3.11/site-packages (from Ipython>=7.16.3->great_expectations==0.18.12) (0.2.0)\n",
|
62 |
+
"Requirement already satisfied: traitlets>=5 in /Applications/anaconda3/lib/python3.11/site-packages (from Ipython>=7.16.3->great_expectations==0.18.12) (5.7.1)\n",
|
63 |
+
"Requirement already satisfied: pexpect>4.3 in /Applications/anaconda3/lib/python3.11/site-packages (from Ipython>=7.16.3->great_expectations==0.18.12) (4.8.0)\n",
|
64 |
+
"Requirement already satisfied: appnope in /Applications/anaconda3/lib/python3.11/site-packages (from Ipython>=7.16.3->great_expectations==0.18.12) (0.1.2)\n",
|
65 |
+
"Requirement already satisfied: ipykernel>=4.5.1 in /Applications/anaconda3/lib/python3.11/site-packages (from ipywidgets>=7.5.1->great_expectations==0.18.12) (6.19.2)\n",
|
66 |
+
"Requirement already satisfied: widgetsnbextension~=4.0 in /Applications/anaconda3/lib/python3.11/site-packages (from ipywidgets>=7.5.1->great_expectations==0.18.12) (4.0.5)\n",
|
67 |
+
"Requirement already satisfied: jupyterlab-widgets~=3.0 in /Applications/anaconda3/lib/python3.11/site-packages (from ipywidgets>=7.5.1->great_expectations==0.18.12) (3.0.5)\n",
|
68 |
+
"Requirement already satisfied: MarkupSafe>=2.0 in /Applications/anaconda3/lib/python3.11/site-packages (from jinja2>=2.10->great_expectations==0.18.12) (2.0.1)\n",
|
69 |
+
"Requirement already satisfied: jsonpointer>=1.9 in /Applications/anaconda3/lib/python3.11/site-packages (from jsonpatch>=1.22->great_expectations==0.18.12) (2.1)\n",
|
70 |
+
"Requirement already satisfied: attrs>=17.4.0 in /Applications/anaconda3/lib/python3.11/site-packages (from jsonschema>=2.5.1->great_expectations==0.18.12) (22.1.0)\n",
|
71 |
+
"Requirement already satisfied: pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0 in /Applications/anaconda3/lib/python3.11/site-packages (from jsonschema>=2.5.1->great_expectations==0.18.12) (0.18.0)\n",
|
72 |
+
"Requirement already satisfied: fastjsonschema in /Applications/anaconda3/lib/python3.11/site-packages (from nbformat>=5.0->great_expectations==0.18.12) (2.16.2)\n",
|
73 |
+
"Requirement already satisfied: jupyter-core in /Applications/anaconda3/lib/python3.11/site-packages (from nbformat>=5.0->great_expectations==0.18.12) (5.3.0)\n",
|
74 |
+
"Requirement already satisfied: tornado>=6.1 in /Applications/anaconda3/lib/python3.11/site-packages (from notebook>=6.4.10->great_expectations==0.18.12) (6.3.2)\n",
|
75 |
+
"Requirement already satisfied: pyzmq>=17 in /Applications/anaconda3/lib/python3.11/site-packages (from notebook>=6.4.10->great_expectations==0.18.12) (23.2.0)\n",
|
76 |
+
"Requirement already satisfied: argon2-cffi in /Applications/anaconda3/lib/python3.11/site-packages (from notebook>=6.4.10->great_expectations==0.18.12) (21.3.0)\n",
|
77 |
+
"Requirement already satisfied: jupyter-client>=5.3.4 in /Applications/anaconda3/lib/python3.11/site-packages (from notebook>=6.4.10->great_expectations==0.18.12) (7.4.9)\n",
|
78 |
+
"Requirement already satisfied: ipython-genutils in /Applications/anaconda3/lib/python3.11/site-packages (from notebook>=6.4.10->great_expectations==0.18.12) (0.2.0)\n",
|
79 |
+
"Requirement already satisfied: nbconvert>=5 in /Applications/anaconda3/lib/python3.11/site-packages (from notebook>=6.4.10->great_expectations==0.18.12) (6.5.4)\n",
|
80 |
+
"Requirement already satisfied: nest-asyncio>=1.5 in /Applications/anaconda3/lib/python3.11/site-packages (from notebook>=6.4.10->great_expectations==0.18.12) (1.5.6)\n",
|
81 |
+
"Requirement already satisfied: Send2Trash>=1.8.0 in /Applications/anaconda3/lib/python3.11/site-packages (from notebook>=6.4.10->great_expectations==0.18.12) (1.8.0)\n",
|
82 |
+
"Requirement already satisfied: terminado>=0.8.3 in /Applications/anaconda3/lib/python3.11/site-packages (from notebook>=6.4.10->great_expectations==0.18.12) (0.17.1)\n",
|
83 |
+
"Requirement already satisfied: prometheus-client in /Applications/anaconda3/lib/python3.11/site-packages (from notebook>=6.4.10->great_expectations==0.18.12) (0.14.1)\n",
|
84 |
+
"Requirement already satisfied: nbclassic>=0.4.7 in /Applications/anaconda3/lib/python3.11/site-packages (from notebook>=6.4.10->great_expectations==0.18.12) (0.5.5)\n",
|
85 |
+
"Requirement already satisfied: annotated-types>=0.4.0 in /Applications/anaconda3/lib/python3.11/site-packages (from pydantic>=1.9.2->great_expectations==0.18.12) (0.6.0)\n",
|
86 |
+
"Requirement already satisfied: pydantic-core==2.16.3 in /Applications/anaconda3/lib/python3.11/site-packages (from pydantic>=1.9.2->great_expectations==0.18.12) (2.16.3)\n",
|
87 |
+
"Requirement already satisfied: six>=1.5 in /Applications/anaconda3/lib/python3.11/site-packages (from python-dateutil>=2.8.1->great_expectations==0.18.12) (1.16.0)\n",
|
88 |
+
"Requirement already satisfied: charset-normalizer<4,>=2 in /Applications/anaconda3/lib/python3.11/site-packages (from requests>=2.20->great_expectations==0.18.12) (2.0.4)\n",
|
89 |
+
"Requirement already satisfied: idna<4,>=2.5 in /Applications/anaconda3/lib/python3.11/site-packages (from requests>=2.20->great_expectations==0.18.12) (3.4)\n",
|
90 |
+
"Requirement already satisfied: certifi>=2017.4.17 in /Applications/anaconda3/lib/python3.11/site-packages (from requests>=2.20->great_expectations==0.18.12) (2023.7.22)\n",
|
91 |
+
"Requirement already satisfied: pycparser in /Applications/anaconda3/lib/python3.11/site-packages (from cffi>=1.12->cryptography>=3.2->great_expectations==0.18.12) (2.21)\n",
|
92 |
+
"Requirement already satisfied: comm>=0.1.1 in /Applications/anaconda3/lib/python3.11/site-packages (from ipykernel>=4.5.1->ipywidgets>=7.5.1->great_expectations==0.18.12) (0.1.2)\n",
|
93 |
+
"Requirement already satisfied: debugpy>=1.0 in /Applications/anaconda3/lib/python3.11/site-packages (from ipykernel>=4.5.1->ipywidgets>=7.5.1->great_expectations==0.18.12) (1.6.7)\n",
|
94 |
+
"Requirement already satisfied: psutil in /Applications/anaconda3/lib/python3.11/site-packages (from ipykernel>=4.5.1->ipywidgets>=7.5.1->great_expectations==0.18.12) (5.9.0)\n",
|
95 |
+
"Requirement already satisfied: parso<0.9.0,>=0.8.0 in /Applications/anaconda3/lib/python3.11/site-packages (from jedi>=0.16->Ipython>=7.16.3->great_expectations==0.18.12) (0.8.3)\n",
|
96 |
+
"Requirement already satisfied: platformdirs>=2.5 in /Applications/anaconda3/lib/python3.11/site-packages (from jupyter-core->nbformat>=5.0->great_expectations==0.18.12) (2.5.2)\n",
|
97 |
+
"Requirement already satisfied: jupyter-server>=1.8 in /Applications/anaconda3/lib/python3.11/site-packages (from nbclassic>=0.4.7->notebook>=6.4.10->great_expectations==0.18.12) (1.23.4)\n",
|
98 |
+
"Requirement already satisfied: notebook-shim>=0.1.0 in /Applications/anaconda3/lib/python3.11/site-packages (from nbclassic>=0.4.7->notebook>=6.4.10->great_expectations==0.18.12) (0.2.2)\n",
|
99 |
+
"Requirement already satisfied: lxml in /Applications/anaconda3/lib/python3.11/site-packages (from nbconvert>=5->notebook>=6.4.10->great_expectations==0.18.12) (4.9.2)\n",
|
100 |
+
"Requirement already satisfied: beautifulsoup4 in /Applications/anaconda3/lib/python3.11/site-packages (from nbconvert>=5->notebook>=6.4.10->great_expectations==0.18.12) (4.12.2)\n",
|
101 |
+
"Requirement already satisfied: bleach in /Applications/anaconda3/lib/python3.11/site-packages (from nbconvert>=5->notebook>=6.4.10->great_expectations==0.18.12) (4.1.0)\n",
|
102 |
+
"Requirement already satisfied: defusedxml in /Applications/anaconda3/lib/python3.11/site-packages (from nbconvert>=5->notebook>=6.4.10->great_expectations==0.18.12) (0.7.1)\n",
|
103 |
+
"Requirement already satisfied: jupyterlab-pygments in /Applications/anaconda3/lib/python3.11/site-packages (from nbconvert>=5->notebook>=6.4.10->great_expectations==0.18.12) (0.1.2)\n",
|
104 |
+
"Requirement already satisfied: nbclient>=0.5.0 in /Applications/anaconda3/lib/python3.11/site-packages (from nbconvert>=5->notebook>=6.4.10->great_expectations==0.18.12) (0.5.13)\n",
|
105 |
+
"Requirement already satisfied: pandocfilters>=1.4.1 in /Applications/anaconda3/lib/python3.11/site-packages (from nbconvert>=5->notebook>=6.4.10->great_expectations==0.18.12) (1.5.0)\n",
|
106 |
+
"Requirement already satisfied: tinycss2 in /Applications/anaconda3/lib/python3.11/site-packages (from nbconvert>=5->notebook>=6.4.10->great_expectations==0.18.12) (1.2.1)\n",
|
107 |
+
"Requirement already satisfied: ptyprocess>=0.5 in /Applications/anaconda3/lib/python3.11/site-packages (from pexpect>4.3->Ipython>=7.16.3->great_expectations==0.18.12) (0.7.0)\n",
|
108 |
+
"Requirement already satisfied: wcwidth in /Applications/anaconda3/lib/python3.11/site-packages (from prompt-toolkit!=3.0.37,<3.1.0,>=3.0.30->Ipython>=7.16.3->great_expectations==0.18.12) (0.2.5)\n",
|
109 |
+
"Requirement already satisfied: argon2-cffi-bindings in /Applications/anaconda3/lib/python3.11/site-packages (from argon2-cffi->notebook>=6.4.10->great_expectations==0.18.12) (21.2.0)\n",
|
110 |
+
"Requirement already satisfied: executing in /Applications/anaconda3/lib/python3.11/site-packages (from stack-data->Ipython>=7.16.3->great_expectations==0.18.12) (0.8.3)\n",
|
111 |
+
"Requirement already satisfied: asttokens in /Applications/anaconda3/lib/python3.11/site-packages (from stack-data->Ipython>=7.16.3->great_expectations==0.18.12) (2.0.5)\n",
|
112 |
+
"Requirement already satisfied: pure-eval in /Applications/anaconda3/lib/python3.11/site-packages (from stack-data->Ipython>=7.16.3->great_expectations==0.18.12) (0.2.2)\n",
|
113 |
+
"Requirement already satisfied: anyio<4,>=3.1.0 in /Applications/anaconda3/lib/python3.11/site-packages (from jupyter-server>=1.8->nbclassic>=0.4.7->notebook>=6.4.10->great_expectations==0.18.12) (3.7.1)\n",
|
114 |
+
"Requirement already satisfied: websocket-client in /Applications/anaconda3/lib/python3.11/site-packages (from jupyter-server>=1.8->nbclassic>=0.4.7->notebook>=6.4.10->great_expectations==0.18.12) (1.7.0)\n",
|
115 |
+
"Requirement already satisfied: soupsieve>1.2 in /Applications/anaconda3/lib/python3.11/site-packages (from beautifulsoup4->nbconvert>=5->notebook>=6.4.10->great_expectations==0.18.12) (2.4)\n",
|
116 |
+
"Requirement already satisfied: webencodings in /Applications/anaconda3/lib/python3.11/site-packages (from bleach->nbconvert>=5->notebook>=6.4.10->great_expectations==0.18.12) (0.5.1)\n",
|
117 |
+
"Requirement already satisfied: sniffio>=1.1 in /Applications/anaconda3/lib/python3.11/site-packages (from anyio<4,>=3.1.0->jupyter-server>=1.8->nbclassic>=0.4.7->notebook>=6.4.10->great_expectations==0.18.12) (1.2.0)\n"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
]
|
119 |
}
|
120 |
],
|
|
|
124 |
},
|
125 |
{
|
126 |
"cell_type": "code",
|
127 |
+
"execution_count": 26,
|
128 |
"metadata": {},
|
129 |
"outputs": [],
|
130 |
"source": [
|
|
|
145 |
},
|
146 |
{
|
147 |
"cell_type": "code",
|
148 |
+
"execution_count": 27,
|
149 |
"metadata": {},
|
150 |
+
"outputs": [],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
"source": [
|
152 |
"#from alpha_vantage.timeseries import TimeSeries\n",
|
153 |
"#import pandas as pd\n",
|
|
|
165 |
},
|
166 |
{
|
167 |
"cell_type": "code",
|
168 |
+
"execution_count": 28,
|
169 |
"metadata": {},
|
170 |
+
"outputs": [],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
"source": [
|
172 |
"#data.info()"
|
173 |
]
|
174 |
},
|
175 |
{
|
176 |
"cell_type": "code",
|
177 |
+
"execution_count": 29,
|
178 |
"metadata": {},
|
179 |
+
"outputs": [],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
"source": [
|
181 |
"#meta_data"
|
182 |
]
|
183 |
},
|
184 |
{
|
185 |
"cell_type": "code",
|
186 |
+
"execution_count": 30,
|
187 |
"metadata": {},
|
188 |
+
"outputs": [],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
189 |
"source": [
|
190 |
"# Define your file path and name\n",
|
191 |
"#file_path = 'TSLA_stock_price.csv' # Customize the path and filename\n",
|
|
|
198 |
},
|
199 |
{
|
200 |
"cell_type": "code",
|
201 |
+
"execution_count": 31,
|
202 |
"metadata": {},
|
203 |
"outputs": [
|
204 |
{
|
|
|
206 |
"output_type": "stream",
|
207 |
"text": [
|
208 |
" date 1. open 2. high 3. low 4. close 5. volume ticker\n",
|
209 |
+
"0 2024-05-03 182.10 184.78 178.4200 181.19 75491539.0 TSLA\n",
|
210 |
+
"1 2024-05-02 182.86 184.60 176.0200 180.01 89148041.0 TSLA\n",
|
211 |
+
"2 2024-05-01 182.00 185.86 179.0100 179.99 92829719.0 TSLA\n",
|
212 |
+
"3 2024-04-30 186.98 190.95 182.8401 183.28 127031787.0 TSLA\n",
|
213 |
+
"4 2024-04-29 188.42 198.87 184.5400 194.05 243869678.0 TSLA\n"
|
214 |
]
|
215 |
}
|
216 |
],
|
|
|
223 |
},
|
224 |
{
|
225 |
"cell_type": "code",
|
226 |
+
"execution_count": 32,
|
227 |
"metadata": {},
|
228 |
"outputs": [
|
229 |
{
|
230 |
"name": "stdout",
|
231 |
"output_type": "stream",
|
232 |
"text": [
|
233 |
+
"Connection closed.\n",
|
234 |
"Connected. Call `.close()` to terminate connection gracefully.\n",
|
235 |
"\n",
|
236 |
+
"Logged in to project, explore it here https://c.app.hopsworks.ai:443/p/549016\n",
|
237 |
"Connected. Call `.close()` to terminate connection gracefully.\n"
|
238 |
]
|
239 |
}
|
|
|
246 |
},
|
247 |
{
|
248 |
"cell_type": "code",
|
249 |
+
"execution_count": 33,
|
250 |
"metadata": {},
|
251 |
"outputs": [],
|
252 |
"source": [
|
|
|
255 |
},
|
256 |
{
|
257 |
"cell_type": "code",
|
258 |
+
"execution_count": 34,
|
259 |
"metadata": {},
|
260 |
"outputs": [],
|
261 |
"source": [
|
|
|
267 |
},
|
268 |
{
|
269 |
"cell_type": "code",
|
270 |
+
"execution_count": 35,
|
271 |
"metadata": {},
|
272 |
"outputs": [
|
273 |
{
|
|
|
303 |
" <tbody>\n",
|
304 |
" <tr>\n",
|
305 |
" <th>0</th>\n",
|
306 |
+
" <td>2024-05-03</td>\n",
|
307 |
+
" <td>182.10</td>\n",
|
308 |
+
" <td>184.7800</td>\n",
|
309 |
+
" <td>178.4200</td>\n",
|
310 |
+
" <td>181.19</td>\n",
|
311 |
+
" <td>75491539.0</td>\n",
|
312 |
+
" <td>TSLA</td>\n",
|
313 |
+
" </tr>\n",
|
314 |
+
" <tr>\n",
|
315 |
+
" <th>1</th>\n",
|
316 |
" <td>2024-05-02</td>\n",
|
317 |
" <td>182.86</td>\n",
|
318 |
" <td>184.6000</td>\n",
|
|
|
322 |
" <td>TSLA</td>\n",
|
323 |
" </tr>\n",
|
324 |
" <tr>\n",
|
325 |
+
" <th>2</th>\n",
|
326 |
" <td>2024-05-01</td>\n",
|
327 |
" <td>182.00</td>\n",
|
328 |
" <td>185.8600</td>\n",
|
|
|
332 |
" <td>TSLA</td>\n",
|
333 |
" </tr>\n",
|
334 |
" <tr>\n",
|
335 |
+
" <th>3</th>\n",
|
336 |
" <td>2024-04-30</td>\n",
|
337 |
" <td>186.98</td>\n",
|
338 |
" <td>190.9500</td>\n",
|
|
|
342 |
" <td>TSLA</td>\n",
|
343 |
" </tr>\n",
|
344 |
" <tr>\n",
|
345 |
+
" <th>4</th>\n",
|
346 |
" <td>2024-04-29</td>\n",
|
347 |
" <td>188.42</td>\n",
|
348 |
" <td>198.8700</td>\n",
|
|
|
352 |
" <td>TSLA</td>\n",
|
353 |
" </tr>\n",
|
354 |
" <tr>\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
355 |
" <th>...</th>\n",
|
356 |
" <td>...</td>\n",
|
357 |
" <td>...</td>\n",
|
|
|
362 |
" <td>...</td>\n",
|
363 |
" </tr>\n",
|
364 |
" <tr>\n",
|
365 |
+
" <th>3481</th>\n",
|
366 |
" <td>2010-07-06</td>\n",
|
367 |
" <td>20.00</td>\n",
|
368 |
" <td>20.0000</td>\n",
|
|
|
372 |
" <td>TSLA</td>\n",
|
373 |
" </tr>\n",
|
374 |
" <tr>\n",
|
375 |
+
" <th>3482</th>\n",
|
376 |
" <td>2010-07-02</td>\n",
|
377 |
" <td>23.00</td>\n",
|
378 |
" <td>23.1000</td>\n",
|
|
|
382 |
" <td>TSLA</td>\n",
|
383 |
" </tr>\n",
|
384 |
" <tr>\n",
|
385 |
+
" <th>3483</th>\n",
|
386 |
" <td>2010-07-01</td>\n",
|
387 |
" <td>25.00</td>\n",
|
388 |
" <td>25.9200</td>\n",
|
|
|
392 |
" <td>TSLA</td>\n",
|
393 |
" </tr>\n",
|
394 |
" <tr>\n",
|
395 |
+
" <th>3484</th>\n",
|
396 |
" <td>2010-06-30</td>\n",
|
397 |
" <td>25.79</td>\n",
|
398 |
" <td>30.4192</td>\n",
|
|
|
402 |
" <td>TSLA</td>\n",
|
403 |
" </tr>\n",
|
404 |
" <tr>\n",
|
405 |
+
" <th>3485</th>\n",
|
406 |
" <td>2010-06-29</td>\n",
|
407 |
" <td>19.00</td>\n",
|
408 |
" <td>25.0000</td>\n",
|
|
|
413 |
" </tr>\n",
|
414 |
" </tbody>\n",
|
415 |
"</table>\n",
|
416 |
+
"<p>3486 rows × 7 columns</p>\n",
|
417 |
"</div>"
|
418 |
],
|
419 |
"text/plain": [
|
420 |
" date 1. open 2. high 3. low 4. close 5. volume ticker\n",
|
421 |
+
"0 2024-05-03 182.10 184.7800 178.4200 181.19 75491539.0 TSLA\n",
|
422 |
+
"1 2024-05-02 182.86 184.6000 176.0200 180.01 89148041.0 TSLA\n",
|
423 |
+
"2 2024-05-01 182.00 185.8600 179.0100 179.99 92829719.0 TSLA\n",
|
424 |
+
"3 2024-04-30 186.98 190.9500 182.8401 183.28 127031787.0 TSLA\n",
|
425 |
+
"4 2024-04-29 188.42 198.8700 184.5400 194.05 243869678.0 TSLA\n",
|
426 |
"... ... ... ... ... ... ... ...\n",
|
427 |
+
"3481 2010-07-06 20.00 20.0000 15.8300 16.11 6866900.0 TSLA\n",
|
428 |
+
"3482 2010-07-02 23.00 23.1000 18.7100 19.20 5139800.0 TSLA\n",
|
429 |
+
"3483 2010-07-01 25.00 25.9200 20.2700 21.96 8218800.0 TSLA\n",
|
430 |
+
"3484 2010-06-30 25.79 30.4192 23.3000 23.83 17187100.0 TSLA\n",
|
431 |
+
"3485 2010-06-29 19.00 25.0000 17.5400 23.89 18766300.0 TSLA\n",
|
432 |
"\n",
|
433 |
+
"[3486 rows x 7 columns]"
|
434 |
]
|
435 |
},
|
436 |
+
"execution_count": 35,
|
437 |
"metadata": {},
|
438 |
"output_type": "execute_result"
|
439 |
}
|
|
|
444 |
},
|
445 |
{
|
446 |
"cell_type": "code",
|
447 |
+
"execution_count": 36,
|
448 |
"metadata": {},
|
449 |
"outputs": [],
|
450 |
"source": [
|
|
|
454 |
},
|
455 |
{
|
456 |
"cell_type": "code",
|
457 |
+
"execution_count": 37,
|
458 |
"metadata": {},
|
459 |
"outputs": [
|
460 |
{
|
|
|
471 |
},
|
472 |
{
|
473 |
"cell_type": "code",
|
474 |
+
"execution_count": 38,
|
475 |
"metadata": {},
|
476 |
"outputs": [],
|
477 |
"source": [
|
|
|
484 |
},
|
485 |
{
|
486 |
"cell_type": "code",
|
487 |
+
"execution_count": 39,
|
488 |
"metadata": {},
|
489 |
"outputs": [
|
490 |
{
|
491 |
"name": "stdout",
|
492 |
"output_type": "stream",
|
493 |
"text": [
|
494 |
+
"2024-05-06 11:35:29,224 WARNING: DeprecationWarning: Providing event_time as a single-element list is deprecated and will be dropped in future versions. Provide the feature_name string instead.\n",
|
495 |
"\n"
|
496 |
]
|
497 |
}
|
|
|
501 |
"tesla_fg = fs.get_or_create_feature_group(\n",
|
502 |
" name=\"tesla_stock\",\n",
|
503 |
" description=\"Tesla stock dataset from alpha vantage\",\n",
|
504 |
+
" version=1,\n",
|
505 |
" primary_key=[\"ticker\"],\n",
|
506 |
" event_time=['date'],\n",
|
507 |
" online_enabled=False,\n",
|
|
|
510 |
},
|
511 |
{
|
512 |
"cell_type": "code",
|
513 |
+
"execution_count": 40,
|
514 |
"metadata": {},
|
515 |
"outputs": [
|
516 |
{
|
|
|
518 |
"output_type": "stream",
|
519 |
"text": [
|
520 |
"Feature Group created successfully, explore it at \n",
|
521 |
+
"https://c.app.hopsworks.ai:443/p/549016/fs/544838/fg/787790\n"
|
522 |
]
|
523 |
},
|
524 |
{
|
525 |
"data": {
|
526 |
"application/vnd.jupyter.widget-view+json": {
|
527 |
+
"model_id": "52bb5493d0dd4abebd6f8b5781a2727c",
|
528 |
"version_major": 2,
|
529 |
"version_minor": 0
|
530 |
},
|
531 |
"text/plain": [
|
532 |
+
"Uploading Dataframe: 0.00% | | Rows 0/3486 | Elapsed Time: 00:00 | Remaining Time: ?"
|
533 |
]
|
534 |
},
|
535 |
"metadata": {},
|
|
|
539 |
"name": "stdout",
|
540 |
"output_type": "stream",
|
541 |
"text": [
|
542 |
+
"Launching job: tesla_stock_1_offline_fg_materialization\n",
|
543 |
"Job started successfully, you can follow the progress at \n",
|
544 |
+
"https://c.app.hopsworks.ai/p/549016/jobs/named/tesla_stock_1_offline_fg_materialization/executions\n"
|
545 |
]
|
546 |
},
|
547 |
{
|
548 |
"data": {
|
549 |
"text/plain": [
|
550 |
+
"(<hsfs.core.job.Job at 0x304ac0c90>, None)"
|
551 |
]
|
552 |
},
|
553 |
+
"execution_count": 40,
|
554 |
"metadata": {},
|
555 |
"output_type": "execute_result"
|
556 |
}
|
|
|
561 |
},
|
562 |
{
|
563 |
"cell_type": "code",
|
564 |
+
"execution_count": 41,
|
565 |
"metadata": {},
|
566 |
"outputs": [],
|
567 |
"source": [
|
|
|
570 |
},
|
571 |
{
|
572 |
"cell_type": "code",
|
573 |
+
"execution_count": 42,
|
574 |
"metadata": {},
|
575 |
"outputs": [],
|
576 |
"source": [
|
|
|
579 |
},
|
580 |
{
|
581 |
"cell_type": "code",
|
582 |
+
"execution_count": 43,
|
583 |
"metadata": {},
|
584 |
"outputs": [],
|
585 |
"source": [
|
|
|
588 |
},
|
589 |
{
|
590 |
"cell_type": "code",
|
591 |
+
"execution_count": 44,
|
592 |
"metadata": {},
|
593 |
"outputs": [
|
594 |
{
|
595 |
"name": "stdout",
|
596 |
"output_type": "stream",
|
597 |
"text": [
|
598 |
+
"2024-05-06 11:35:39,174 WARNING: DeprecationWarning: Providing event_time as a single-element list is deprecated and will be dropped in future versions. Provide the feature_name string instead.\n",
|
599 |
"\n"
|
600 |
]
|
601 |
}
|
|
|
604 |
"news_sentiment_fg = fs.get_or_create_feature_group(\n",
|
605 |
" name='news_sentiment_updated',\n",
|
606 |
" description='News sentiment from Polygon',\n",
|
607 |
+
" version=1,\n",
|
608 |
" primary_key=['ticker'],\n",
|
609 |
" event_time=['date'],\n",
|
610 |
" online_enabled=False,\n",
|
|
|
613 |
},
|
614 |
{
|
615 |
"cell_type": "code",
|
616 |
+
"execution_count": 45,
|
617 |
"metadata": {},
|
618 |
"outputs": [
|
619 |
{
|
|
|
621 |
"output_type": "stream",
|
622 |
"text": [
|
623 |
"Feature Group created successfully, explore it at \n",
|
624 |
+
"https://c.app.hopsworks.ai:443/p/549016/fs/544838/fg/785773\n"
|
625 |
]
|
626 |
},
|
627 |
{
|
628 |
"data": {
|
629 |
"application/vnd.jupyter.widget-view+json": {
|
630 |
+
"model_id": "150c7a2bb8aa49b3a9e2445b1374955e",
|
631 |
"version_major": 2,
|
632 |
"version_minor": 0
|
633 |
},
|
634 |
"text/plain": [
|
635 |
+
"Uploading Dataframe: 0.00% | | Rows 0/66 | Elapsed Time: 00:00 | Remaining Time: ?"
|
636 |
]
|
637 |
},
|
638 |
"metadata": {},
|
|
|
642 |
"name": "stdout",
|
643 |
"output_type": "stream",
|
644 |
"text": [
|
645 |
+
"Launching job: news_sentiment_updated_1_offline_fg_materialization\n",
|
646 |
"Job started successfully, you can follow the progress at \n",
|
647 |
+
"https://c.app.hopsworks.ai/p/549016/jobs/named/news_sentiment_updated_1_offline_fg_materialization/executions\n"
|
648 |
]
|
649 |
},
|
650 |
{
|
651 |
"data": {
|
652 |
"text/plain": [
|
653 |
+
"(<hsfs.core.job.Job at 0x17bc96990>, None)"
|
654 |
]
|
655 |
},
|
656 |
+
"execution_count": 45,
|
657 |
"metadata": {},
|
658 |
"output_type": "execute_result"
|
659 |
}
|
|
|
679 |
"name": "python",
|
680 |
"nbconvert_exporter": "python",
|
681 |
"pygments_lexer": "ipython3",
|
682 |
+
"version": "3.11.4"
|
683 |
},
|
684 |
"orig_nbformat": 4
|
685 |
},
|
feature_pipeline.py
CHANGED
@@ -96,7 +96,7 @@ tsla_df['date'] = pd.to_datetime(tsla_df['date'])
|
|
96 |
tesla_fg = fs.get_or_create_feature_group(
|
97 |
name="tesla_stock",
|
98 |
description="Tesla stock dataset from alpha vantage",
|
99 |
-
version=
|
100 |
primary_key=["ticker"],
|
101 |
event_time=['date'],
|
102 |
online_enabled=False,
|
|
|
96 |
tesla_fg = fs.get_or_create_feature_group(
|
97 |
name="tesla_stock",
|
98 |
description="Tesla stock dataset from alpha vantage",
|
99 |
+
version=2,
|
100 |
primary_key=["ticker"],
|
101 |
event_time=['date'],
|
102 |
online_enabled=False,
|
feature_view_freddie.ipynb
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
"cells": [
|
3 |
{
|
4 |
"cell_type": "code",
|
5 |
-
"execution_count":
|
6 |
"metadata": {},
|
7 |
"outputs": [],
|
8 |
"source": [
|
@@ -23,73 +23,9 @@
|
|
23 |
},
|
24 |
{
|
25 |
"cell_type": "code",
|
26 |
-
"execution_count":
|
27 |
"metadata": {},
|
28 |
-
"outputs": [
|
29 |
-
{
|
30 |
-
"name": "stdout",
|
31 |
-
"output_type": "stream",
|
32 |
-
"text": [
|
33 |
-
" date 1. open 2. high 3. low 4. close 5. volume ticker\n",
|
34 |
-
"0 2024-05-02 182.86 184.60 176.0200 180.01 89148041.0 TSLA\n",
|
35 |
-
"1 2024-05-01 182.00 185.86 179.0100 179.99 92829719.0 TSLA\n",
|
36 |
-
"2 2024-04-30 186.98 190.95 182.8401 183.28 127031787.0 TSLA\n",
|
37 |
-
"3 2024-04-29 188.42 198.87 184.5400 194.05 243869678.0 TSLA\n",
|
38 |
-
"4 2024-04-26 168.85 172.12 166.3700 168.29 109815725.0 TSLA\n",
|
39 |
-
"Connected. Call `.close()` to terminate connection gracefully.\n",
|
40 |
-
"\n",
|
41 |
-
"Logged in to project, explore it here https://c.app.hopsworks.ai:443/p/549015\n",
|
42 |
-
"Connected. Call `.close()` to terminate connection gracefully.\n",
|
43 |
-
"Index(['date', 'open', 'high', 'low', 'close', 'volume', 'ticker'], dtype='object')\n"
|
44 |
-
]
|
45 |
-
},
|
46 |
-
{
|
47 |
-
"data": {
|
48 |
-
"application/vnd.jupyter.widget-view+json": {
|
49 |
-
"model_id": "baf52b6f47c74767b5aecb1df6f17c0c",
|
50 |
-
"version_major": 2,
|
51 |
-
"version_minor": 0
|
52 |
-
},
|
53 |
-
"text/plain": [
|
54 |
-
"Uploading Dataframe: 0.00% | | Rows 0/3485 | Elapsed Time: 00:00 | Remaining Time: ?"
|
55 |
-
]
|
56 |
-
},
|
57 |
-
"metadata": {},
|
58 |
-
"output_type": "display_data"
|
59 |
-
},
|
60 |
-
{
|
61 |
-
"name": "stdout",
|
62 |
-
"output_type": "stream",
|
63 |
-
"text": [
|
64 |
-
"Launching job: tesla_stock_3_offline_fg_materialization\n",
|
65 |
-
"Job started successfully, you can follow the progress at \n",
|
66 |
-
"https://c.app.hopsworks.ai/p/549015/jobs/named/tesla_stock_3_offline_fg_materialization/executions\n"
|
67 |
-
]
|
68 |
-
},
|
69 |
-
{
|
70 |
-
"data": {
|
71 |
-
"application/vnd.jupyter.widget-view+json": {
|
72 |
-
"model_id": "3deb8c10be3a44a2b91c63ffe8762725",
|
73 |
-
"version_major": 2,
|
74 |
-
"version_minor": 0
|
75 |
-
},
|
76 |
-
"text/plain": [
|
77 |
-
"Uploading Dataframe: 0.00% | | Rows 0/720 | Elapsed Time: 00:00 | Remaining Time: ?"
|
78 |
-
]
|
79 |
-
},
|
80 |
-
"metadata": {},
|
81 |
-
"output_type": "display_data"
|
82 |
-
},
|
83 |
-
{
|
84 |
-
"name": "stdout",
|
85 |
-
"output_type": "stream",
|
86 |
-
"text": [
|
87 |
-
"Launching job: news_sentiment_updated_2_offline_fg_materialization\n",
|
88 |
-
"Job started successfully, you can follow the progress at \n",
|
89 |
-
"https://c.app.hopsworks.ai/p/549015/jobs/named/news_sentiment_updated_2_offline_fg_materialization/executions\n"
|
90 |
-
]
|
91 |
-
}
|
92 |
-
],
|
93 |
"source": [
|
94 |
"from feature_pipeline import tesla_fg\n",
|
95 |
"from feature_pipeline import news_sentiment_fg"
|
@@ -97,7 +33,7 @@
|
|
97 |
},
|
98 |
{
|
99 |
"cell_type": "code",
|
100 |
-
"execution_count":
|
101 |
"metadata": {},
|
102 |
"outputs": [
|
103 |
{
|
@@ -106,7 +42,7 @@
|
|
106 |
"True"
|
107 |
]
|
108 |
},
|
109 |
-
"execution_count":
|
110 |
"metadata": {},
|
111 |
"output_type": "execute_result"
|
112 |
}
|
@@ -120,7 +56,7 @@
|
|
120 |
},
|
121 |
{
|
122 |
"cell_type": "code",
|
123 |
-
"execution_count":
|
124 |
"metadata": {},
|
125 |
"outputs": [
|
126 |
{
|
@@ -130,7 +66,7 @@
|
|
130 |
"Connection closed.\n",
|
131 |
"Connected. Call `.close()` to terminate connection gracefully.\n",
|
132 |
"\n",
|
133 |
-
"Logged in to project, explore it here https://c.app.hopsworks.ai:443/p/
|
134 |
"Connected. Call `.close()` to terminate connection gracefully.\n"
|
135 |
]
|
136 |
}
|
@@ -143,23 +79,23 @@
|
|
143 |
},
|
144 |
{
|
145 |
"cell_type": "code",
|
146 |
-
"execution_count":
|
147 |
"metadata": {},
|
148 |
"outputs": [],
|
149 |
"source": [
|
150 |
"def create_stocks_feature_view(fs, version):\n",
|
151 |
"\n",
|
152 |
" # Loading in the feature groups\n",
|
153 |
-
" tesla_fg = fs.get_feature_group('tesla_stock', version=
|
154 |
-
" news_sentiment_fg = fs.get_feature_group('news_sentiment_updated', version=
|
155 |
"\n",
|
156 |
" # Define the query\n",
|
157 |
" ds_query = tesla_fg.select(['date', 'open', 'ticker'])\\\n",
|
158 |
-
" .join(news_sentiment_fg.
|
159 |
"\n",
|
160 |
" # Create the feature view\n",
|
161 |
" feature_view = fs.create_feature_view(\n",
|
162 |
-
" name='
|
163 |
" query=ds_query,\n",
|
164 |
" labels=['ticker']\n",
|
165 |
" )\n",
|
@@ -169,52 +105,29 @@
|
|
169 |
},
|
170 |
{
|
171 |
"cell_type": "code",
|
172 |
-
"execution_count":
|
173 |
"metadata": {},
|
174 |
"outputs": [
|
175 |
{
|
176 |
-
"
|
177 |
-
"
|
178 |
-
"
|
179 |
-
|
180 |
-
"\
|
181 |
-
"\u001b[1;31mRestAPIError\u001b[0m Traceback (most recent call last)",
|
182 |
-
"Cell \u001b[1;32mIn[19], line 2\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m----> 2\u001b[0m feature_view \u001b[38;5;241m=\u001b[39m \u001b[43mfs\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget_feature_view\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mtsla_stocks_fv\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mversion\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[0;32m 3\u001b[0m tesla_fg \u001b[38;5;241m=\u001b[39m fs\u001b[38;5;241m.\u001b[39mget_feature_group(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mtesla_stock\u001b[39m\u001b[38;5;124m'\u001b[39m, version\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m3\u001b[39m)\n",
|
183 |
-
"File \u001b[1;32mc:\\Users\\frede\\OneDrive\\Dokumenter\\Master\\MLops\\MLops_mod-2\\.conda\\Lib\\site-packages\\hsfs\\usage.py:212\u001b[0m, in \u001b[0;36mmethod_logger.<locals>.wrapper\u001b[1;34m(*args, **kwargs)\u001b[0m\n\u001b[0;32m 211\u001b[0m exception \u001b[38;5;241m=\u001b[39m e\n\u001b[1;32m--> 212\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m e\n\u001b[0;32m 213\u001b[0m \u001b[38;5;28;01mfinally\u001b[39;00m:\n",
|
184 |
-
"File \u001b[1;32mc:\\Users\\frede\\OneDrive\\Dokumenter\\Master\\MLops\\MLops_mod-2\\.conda\\Lib\\site-packages\\hsfs\\usage.py:208\u001b[0m, in \u001b[0;36mmethod_logger.<locals>.wrapper\u001b[1;34m(*args, **kwargs)\u001b[0m\n\u001b[0;32m 206\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m 207\u001b[0m \u001b[38;5;66;03m# Call the original method\u001b[39;00m\n\u001b[1;32m--> 208\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[43mfunc\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 209\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m result\n",
|
185 |
-
"File \u001b[1;32mc:\\Users\\frede\\OneDrive\\Dokumenter\\Master\\MLops\\MLops_mod-2\\.conda\\Lib\\site-packages\\hsfs\\feature_store.py:1661\u001b[0m, in \u001b[0;36mFeatureStore.get_feature_view\u001b[1;34m(self, name, version)\u001b[0m\n\u001b[0;32m 1660\u001b[0m version \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mDEFAULT_VERSION\n\u001b[1;32m-> 1661\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_feature_view_engine\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[43mname\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mversion\u001b[49m\u001b[43m)\u001b[49m\n",
|
186 |
-
"File \u001b[1;32mc:\\Users\\frede\\OneDrive\\Dokumenter\\Master\\MLops\\MLops_mod-2\\.conda\\Lib\\site-packages\\hsfs\\core\\feature_view_engine.py:127\u001b[0m, in \u001b[0;36mFeatureViewEngine.get\u001b[1;34m(self, name, version)\u001b[0m\n\u001b[0;32m 126\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m version:\n\u001b[1;32m--> 127\u001b[0m fv \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_feature_view_api\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget_by_name_version\u001b[49m\u001b[43m(\u001b[49m\u001b[43mname\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mversion\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 128\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mattach_transformation_function(fv)\n",
|
187 |
-
"File \u001b[1;32mc:\\Users\\frede\\OneDrive\\Dokumenter\\Master\\MLops\\MLops_mod-2\\.conda\\Lib\\site-packages\\hsfs\\core\\feature_view_api.py:113\u001b[0m, in \u001b[0;36mFeatureViewApi.get_by_name_version\u001b[1;34m(self, name, version)\u001b[0m\n\u001b[0;32m 112\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m--> 113\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m e\n",
|
188 |
-
"File \u001b[1;32mc:\\Users\\frede\\OneDrive\\Dokumenter\\Master\\MLops\\MLops_mod-2\\.conda\\Lib\\site-packages\\hsfs\\core\\feature_view_api.py:101\u001b[0m, in \u001b[0;36mFeatureViewApi.get_by_name_version\u001b[1;34m(self, name, version)\u001b[0m\n\u001b[0;32m 99\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m 100\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m feature_view\u001b[38;5;241m.\u001b[39mFeatureView\u001b[38;5;241m.\u001b[39mfrom_response_json(\n\u001b[1;32m--> 101\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_client\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_send_request\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m 102\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_GET\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mpath\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m{\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mexpand\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mquery\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mfeatures\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m}\u001b[49m\n\u001b[0;32m 103\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 104\u001b[0m )\n\u001b[0;32m 105\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m RestAPIError \u001b[38;5;28;01mas\u001b[39;00m e:\n",
|
189 |
-
"File \u001b[1;32mc:\\Users\\frede\\OneDrive\\Dokumenter\\Master\\MLops\\MLops_mod-2\\.conda\\Lib\\site-packages\\hsfs\\decorators.py:35\u001b[0m, in \u001b[0;36mconnected.<locals>.if_connected\u001b[1;34m(inst, *args, **kwargs)\u001b[0m\n\u001b[0;32m 34\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m NoHopsworksConnectionError\n\u001b[1;32m---> 35\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfn\u001b[49m\u001b[43m(\u001b[49m\u001b[43minst\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
|
190 |
-
"File \u001b[1;32mc:\\Users\\frede\\OneDrive\\Dokumenter\\Master\\MLops\\MLops_mod-2\\.conda\\Lib\\site-packages\\hsfs\\client\\base.py:176\u001b[0m, in \u001b[0;36mClient._send_request\u001b[1;34m(self, method, path_params, query_params, headers, data, stream, files)\u001b[0m\n\u001b[0;32m 175\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m response\u001b[38;5;241m.\u001b[39mstatus_code \u001b[38;5;241m/\u001b[39m\u001b[38;5;241m/\u001b[39m \u001b[38;5;241m100\u001b[39m \u001b[38;5;241m!=\u001b[39m \u001b[38;5;241m2\u001b[39m:\n\u001b[1;32m--> 176\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m exceptions\u001b[38;5;241m.\u001b[39mRestAPIError(url, response)\n\u001b[0;32m 178\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m stream:\n",
|
191 |
-
"\u001b[1;31mRestAPIError\u001b[0m: Metadata operation error: (url: https://c.app.hopsworks.ai/hopsworks-api/api/project/549015/featurestores/544840/featureview/tsla_stocks_fv/version/1). Server response: \nHTTP code: 404, HTTP reason: Not Found, body: b'{\"errorCode\":270181,\"usrMsg\":\"There exists no feature view with the name tsla_stocks_fv and version 1.\",\"errorMsg\":\"Feature view wasn\\'t found.\"}', error code: 270181, error msg: Feature view wasn't found., user msg: There exists no feature view with the name tsla_stocks_fv and version 1.",
|
192 |
-
"\nDuring handling of the above exception, another exception occurred:\n",
|
193 |
-
"\u001b[1;31mRestAPIError\u001b[0m Traceback (most recent call last)",
|
194 |
-
"Cell \u001b[1;32mIn[19], line 5\u001b[0m\n\u001b[0;32m 3\u001b[0m tesla_fg \u001b[38;5;241m=\u001b[39m fs\u001b[38;5;241m.\u001b[39mget_feature_group(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mtesla_stock\u001b[39m\u001b[38;5;124m'\u001b[39m, version\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m3\u001b[39m)\n\u001b[0;32m 4\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m:\n\u001b[1;32m----> 5\u001b[0m feature_view, tesla_fg \u001b[38;5;241m=\u001b[39m \u001b[43mcreate_stocks_feature_view\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m)\u001b[49m\n",
|
195 |
-
"Cell \u001b[1;32mIn[18], line 12\u001b[0m, in \u001b[0;36mcreate_stocks_feature_view\u001b[1;34m(fs, version)\u001b[0m\n\u001b[0;32m 8\u001b[0m ds_query \u001b[38;5;241m=\u001b[39m tesla_fg\u001b[38;5;241m.\u001b[39mselect([\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mdate\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mopen\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mticker\u001b[39m\u001b[38;5;124m'\u001b[39m])\\\n\u001b[0;32m 9\u001b[0m \u001b[38;5;241m.\u001b[39mjoin(news_sentiment_fg\u001b[38;5;241m.\u001b[39mselect_except([\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mticker\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mtime\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mamp_url\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mimage_url\u001b[39m\u001b[38;5;124m'\u001b[39m]))\n\u001b[0;32m 11\u001b[0m \u001b[38;5;66;03m# Create the feature view\u001b[39;00m\n\u001b[1;32m---> 12\u001b[0m feature_view \u001b[38;5;241m=\u001b[39m \u001b[43mfs\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcreate_feature_view\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m 13\u001b[0m \u001b[43m \u001b[49m\u001b[43mname\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mtsla_stocks_fv\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[0;32m 14\u001b[0m \u001b[43m \u001b[49m\u001b[43mquery\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mds_query\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 15\u001b[0m \u001b[43m \u001b[49m\u001b[43mlabels\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mticker\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m]\u001b[49m\n\u001b[0;32m 16\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 18\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m feature_view, tesla_fg\n",
|
196 |
-
"File \u001b[1;32mc:\\Users\\frede\\OneDrive\\Dokumenter\\Master\\MLops\\MLops_mod-2\\.conda\\Lib\\site-packages\\hsfs\\usage.py:212\u001b[0m, in \u001b[0;36mmethod_logger.<locals>.wrapper\u001b[1;34m(*args, **kwargs)\u001b[0m\n\u001b[0;32m 210\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[0;32m 211\u001b[0m exception \u001b[38;5;241m=\u001b[39m e\n\u001b[1;32m--> 212\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m e\n\u001b[0;32m 213\u001b[0m \u001b[38;5;28;01mfinally\u001b[39;00m:\n\u001b[0;32m 214\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n",
|
197 |
-
"File \u001b[1;32mc:\\Users\\frede\\OneDrive\\Dokumenter\\Master\\MLops\\MLops_mod-2\\.conda\\Lib\\site-packages\\hsfs\\usage.py:208\u001b[0m, in \u001b[0;36mmethod_logger.<locals>.wrapper\u001b[1;34m(*args, **kwargs)\u001b[0m\n\u001b[0;32m 205\u001b[0m exception \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m 206\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m 207\u001b[0m \u001b[38;5;66;03m# Call the original method\u001b[39;00m\n\u001b[1;32m--> 208\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[43mfunc\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 209\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m result\n\u001b[0;32m 210\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n",
|
198 |
-
"File \u001b[1;32mc:\\Users\\frede\\OneDrive\\Dokumenter\\Master\\MLops\\MLops_mod-2\\.conda\\Lib\\site-packages\\hsfs\\feature_store.py:1538\u001b[0m, in \u001b[0;36mFeatureStore.create_feature_view\u001b[1;34m(self, name, query, version, description, labels, inference_helper_columns, training_helper_columns, transformation_functions)\u001b[0m\n\u001b[0;32m 1436\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m\"\"\"Create a feature view metadata object and saved it to hopsworks.\u001b[39;00m\n\u001b[0;32m 1437\u001b[0m \n\u001b[0;32m 1438\u001b[0m \u001b[38;5;124;03m!!! example\u001b[39;00m\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 1524\u001b[0m \u001b[38;5;124;03m `FeatureView`: The feature view metadata object.\u001b[39;00m\n\u001b[0;32m 1525\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[0;32m 1526\u001b[0m feat_view \u001b[38;5;241m=\u001b[39m feature_view\u001b[38;5;241m.\u001b[39mFeatureView(\n\u001b[0;32m 1527\u001b[0m name\u001b[38;5;241m=\u001b[39mname,\n\u001b[0;32m 1528\u001b[0m query\u001b[38;5;241m=\u001b[39mquery,\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 1536\u001b[0m transformation_functions\u001b[38;5;241m=\u001b[39mtransformation_functions,\n\u001b[0;32m 1537\u001b[0m )\n\u001b[1;32m-> 1538\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_feature_view_engine\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msave\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfeat_view\u001b[49m\u001b[43m)\u001b[49m\n",
|
199 |
-
"File \u001b[1;32mc:\\Users\\frede\\OneDrive\\Dokumenter\\Master\\MLops\\MLops_mod-2\\.conda\\Lib\\site-packages\\hsfs\\core\\feature_view_engine.py:113\u001b[0m, in \u001b[0;36mFeatureViewEngine.save\u001b[1;34m(self, feature_view_obj)\u001b[0m\n\u001b[0;32m 104\u001b[0m feature_view_obj\u001b[38;5;241m.\u001b[39m_features\u001b[38;5;241m.\u001b[39mappend(\n\u001b[0;32m 105\u001b[0m training_dataset_feature\u001b[38;5;241m.\u001b[39mTrainingDatasetFeature(\n\u001b[0;32m 106\u001b[0m name\u001b[38;5;241m=\u001b[39mfeature\u001b[38;5;241m.\u001b[39mname,\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 109\u001b[0m )\n\u001b[0;32m 110\u001b[0m )\n\u001b[0;32m 112\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_transformation_function_engine\u001b[38;5;241m.\u001b[39mattach_transformation_fn(feature_view_obj)\n\u001b[1;32m--> 113\u001b[0m updated_fv \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_feature_view_api\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mpost\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfeature_view_obj\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 114\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mattach_transformation_function(updated_fv)\n\u001b[0;32m 115\u001b[0m \u001b[38;5;28mprint\u001b[39m(\n\u001b[0;32m 116\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mFeature view created successfully, explore it at \u001b[39m\u001b[38;5;130;01m\\n\u001b[39;00m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m 117\u001b[0m \u001b[38;5;241m+\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_get_feature_view_url(updated_fv)\n\u001b[0;32m 118\u001b[0m )\n",
|
200 |
-
"File \u001b[1;32mc:\\Users\\frede\\OneDrive\\Dokumenter\\Master\\MLops\\MLops_mod-2\\.conda\\Lib\\site-packages\\hsfs\\core\\feature_view_api.py:60\u001b[0m, in \u001b[0;36mFeatureViewApi.post\u001b[1;34m(self, feature_view_obj)\u001b[0m\n\u001b[0;32m 57\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mpost\u001b[39m(\u001b[38;5;28mself\u001b[39m, feature_view_obj):\n\u001b[0;32m 58\u001b[0m headers \u001b[38;5;241m=\u001b[39m {\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcontent-type\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mapplication/json\u001b[39m\u001b[38;5;124m\"\u001b[39m}\n\u001b[0;32m 59\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m feature_view_obj\u001b[38;5;241m.\u001b[39mupdate_from_response_json(\n\u001b[1;32m---> 60\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_client\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_send_request\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m 61\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_POST\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 62\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_base_path\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 63\u001b[0m \u001b[43m \u001b[49m\u001b[43mheaders\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mheaders\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 64\u001b[0m \u001b[43m \u001b[49m\u001b[43mdata\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mfeature_view_obj\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mjson\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 65\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 66\u001b[0m )\n",
|
201 |
-
"File \u001b[1;32mc:\\Users\\frede\\OneDrive\\Dokumenter\\Master\\MLops\\MLops_mod-2\\.conda\\Lib\\site-packages\\hsfs\\decorators.py:35\u001b[0m, in \u001b[0;36mconnected.<locals>.if_connected\u001b[1;34m(inst, *args, **kwargs)\u001b[0m\n\u001b[0;32m 33\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m inst\u001b[38;5;241m.\u001b[39m_connected:\n\u001b[0;32m 34\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m NoHopsworksConnectionError\n\u001b[1;32m---> 35\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfn\u001b[49m\u001b[43m(\u001b[49m\u001b[43minst\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
|
202 |
-
"File \u001b[1;32mc:\\Users\\frede\\OneDrive\\Dokumenter\\Master\\MLops\\MLops_mod-2\\.conda\\Lib\\site-packages\\hsfs\\client\\base.py:176\u001b[0m, in \u001b[0;36mClient._send_request\u001b[1;34m(self, method, path_params, query_params, headers, data, stream, files)\u001b[0m\n\u001b[0;32m 171\u001b[0m response \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_retry_token_expired(\n\u001b[0;32m 172\u001b[0m request, stream, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mTOKEN_EXPIRED_RETRY_INTERVAL, \u001b[38;5;241m1\u001b[39m\n\u001b[0;32m 173\u001b[0m )\n\u001b[0;32m 175\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m response\u001b[38;5;241m.\u001b[39mstatus_code \u001b[38;5;241m/\u001b[39m\u001b[38;5;241m/\u001b[39m \u001b[38;5;241m100\u001b[39m \u001b[38;5;241m!=\u001b[39m \u001b[38;5;241m2\u001b[39m:\n\u001b[1;32m--> 176\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m exceptions\u001b[38;5;241m.\u001b[39mRestAPIError(url, response)\n\u001b[0;32m 178\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m stream:\n\u001b[0;32m 179\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m response\n",
|
203 |
-
"\u001b[1;31mRestAPIError\u001b[0m: Metadata operation error: (url: https://c.app.hopsworks.ai/hopsworks-api/api/project/549015/featurestores/544840/featureview). Server response: \nHTTP code: 404, HTTP reason: Not Found, body: b'{\"errorCode\":270046,\"usrMsg\":\"HOPSFS Connector: fklitte_Training_Datasets\",\"errorMsg\":\"HopsFs Connector not found\"}', error code: 270046, error msg: HopsFs Connector not found, user msg: HOPSFS Connector: fklitte_Training_Datasets"
|
204 |
]
|
205 |
}
|
206 |
],
|
207 |
"source": [
|
208 |
"try:\n",
|
209 |
-
" feature_view = fs.get_feature_view(\"
|
210 |
-
" tesla_fg = fs.get_feature_group('tesla_stock', version=
|
211 |
"except:\n",
|
212 |
" feature_view, tesla_fg = create_stocks_feature_view(fs, 1)"
|
213 |
]
|
214 |
},
|
215 |
{
|
216 |
"cell_type": "code",
|
217 |
-
"execution_count":
|
218 |
"metadata": {},
|
219 |
"outputs": [],
|
220 |
"source": [
|
@@ -236,34 +149,9 @@
|
|
236 |
},
|
237 |
{
|
238 |
"cell_type": "code",
|
239 |
-
"execution_count":
|
240 |
"metadata": {},
|
241 |
-
"outputs": [
|
242 |
-
{
|
243 |
-
"ename": "AttributeError",
|
244 |
-
"evalue": "'FeatureStore' object has no attribute 'create_tesla_feature_view'",
|
245 |
-
"output_type": "error",
|
246 |
-
"traceback": [
|
247 |
-
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
|
248 |
-
"\u001b[1;31mRestAPIError\u001b[0m Traceback (most recent call last)",
|
249 |
-
"Cell \u001b[1;32mIn[15], line 2\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m----> 2\u001b[0m feature_view \u001b[38;5;241m=\u001b[39m \u001b[43mfs\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget_feature_view\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mtsla_stocks_fv\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mversion\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[0;32m 3\u001b[0m tesla_fg \u001b[38;5;241m=\u001b[39m fs\u001b[38;5;241m.\u001b[39mget_feature_group(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mtesla_stock\u001b[39m\u001b[38;5;124m'\u001b[39m, version\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m3\u001b[39m)\n",
|
250 |
-
"File \u001b[1;32mc:\\Users\\frede\\OneDrive\\Dokumenter\\Master\\MLops\\MLops_mod-2\\.conda\\Lib\\site-packages\\hsfs\\usage.py:212\u001b[0m, in \u001b[0;36mmethod_logger.<locals>.wrapper\u001b[1;34m(*args, **kwargs)\u001b[0m\n\u001b[0;32m 211\u001b[0m exception \u001b[38;5;241m=\u001b[39m e\n\u001b[1;32m--> 212\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m e\n\u001b[0;32m 213\u001b[0m \u001b[38;5;28;01mfinally\u001b[39;00m:\n",
|
251 |
-
"File \u001b[1;32mc:\\Users\\frede\\OneDrive\\Dokumenter\\Master\\MLops\\MLops_mod-2\\.conda\\Lib\\site-packages\\hsfs\\usage.py:208\u001b[0m, in \u001b[0;36mmethod_logger.<locals>.wrapper\u001b[1;34m(*args, **kwargs)\u001b[0m\n\u001b[0;32m 206\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m 207\u001b[0m \u001b[38;5;66;03m# Call the original method\u001b[39;00m\n\u001b[1;32m--> 208\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[43mfunc\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 209\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m result\n",
|
252 |
-
"File \u001b[1;32mc:\\Users\\frede\\OneDrive\\Dokumenter\\Master\\MLops\\MLops_mod-2\\.conda\\Lib\\site-packages\\hsfs\\feature_store.py:1661\u001b[0m, in \u001b[0;36mFeatureStore.get_feature_view\u001b[1;34m(self, name, version)\u001b[0m\n\u001b[0;32m 1660\u001b[0m version \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mDEFAULT_VERSION\n\u001b[1;32m-> 1661\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_feature_view_engine\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[43mname\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mversion\u001b[49m\u001b[43m)\u001b[49m\n",
|
253 |
-
"File \u001b[1;32mc:\\Users\\frede\\OneDrive\\Dokumenter\\Master\\MLops\\MLops_mod-2\\.conda\\Lib\\site-packages\\hsfs\\core\\feature_view_engine.py:127\u001b[0m, in \u001b[0;36mFeatureViewEngine.get\u001b[1;34m(self, name, version)\u001b[0m\n\u001b[0;32m 126\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m version:\n\u001b[1;32m--> 127\u001b[0m fv \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_feature_view_api\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget_by_name_version\u001b[49m\u001b[43m(\u001b[49m\u001b[43mname\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mversion\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 128\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mattach_transformation_function(fv)\n",
|
254 |
-
"File \u001b[1;32mc:\\Users\\frede\\OneDrive\\Dokumenter\\Master\\MLops\\MLops_mod-2\\.conda\\Lib\\site-packages\\hsfs\\core\\feature_view_api.py:113\u001b[0m, in \u001b[0;36mFeatureViewApi.get_by_name_version\u001b[1;34m(self, name, version)\u001b[0m\n\u001b[0;32m 112\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m--> 113\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m e\n",
|
255 |
-
"File \u001b[1;32mc:\\Users\\frede\\OneDrive\\Dokumenter\\Master\\MLops\\MLops_mod-2\\.conda\\Lib\\site-packages\\hsfs\\core\\feature_view_api.py:101\u001b[0m, in \u001b[0;36mFeatureViewApi.get_by_name_version\u001b[1;34m(self, name, version)\u001b[0m\n\u001b[0;32m 99\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m 100\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m feature_view\u001b[38;5;241m.\u001b[39mFeatureView\u001b[38;5;241m.\u001b[39mfrom_response_json(\n\u001b[1;32m--> 101\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_client\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_send_request\u001b[49m\u001b[43m(\u001b[49m\n\u001b[0;32m 102\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_GET\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mpath\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m{\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mexpand\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mquery\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mfeatures\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m}\u001b[49m\n\u001b[0;32m 103\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 104\u001b[0m )\n\u001b[0;32m 105\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m RestAPIError \u001b[38;5;28;01mas\u001b[39;00m e:\n",
|
256 |
-
"File \u001b[1;32mc:\\Users\\frede\\OneDrive\\Dokumenter\\Master\\MLops\\MLops_mod-2\\.conda\\Lib\\site-packages\\hsfs\\decorators.py:35\u001b[0m, in \u001b[0;36mconnected.<locals>.if_connected\u001b[1;34m(inst, *args, **kwargs)\u001b[0m\n\u001b[0;32m 34\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m NoHopsworksConnectionError\n\u001b[1;32m---> 35\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfn\u001b[49m\u001b[43m(\u001b[49m\u001b[43minst\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
|
257 |
-
"File \u001b[1;32mc:\\Users\\frede\\OneDrive\\Dokumenter\\Master\\MLops\\MLops_mod-2\\.conda\\Lib\\site-packages\\hsfs\\client\\base.py:176\u001b[0m, in \u001b[0;36mClient._send_request\u001b[1;34m(self, method, path_params, query_params, headers, data, stream, files)\u001b[0m\n\u001b[0;32m 175\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m response\u001b[38;5;241m.\u001b[39mstatus_code \u001b[38;5;241m/\u001b[39m\u001b[38;5;241m/\u001b[39m \u001b[38;5;241m100\u001b[39m \u001b[38;5;241m!=\u001b[39m \u001b[38;5;241m2\u001b[39m:\n\u001b[1;32m--> 176\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m exceptions\u001b[38;5;241m.\u001b[39mRestAPIError(url, response)\n\u001b[0;32m 178\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m stream:\n",
|
258 |
-
"\u001b[1;31mRestAPIError\u001b[0m: Metadata operation error: (url: https://c.app.hopsworks.ai/hopsworks-api/api/project/549015/featurestores/544840/featureview/tsla_stocks_fv/version/1). Server response: \nHTTP code: 404, HTTP reason: Not Found, body: b'{\"errorCode\":270181,\"usrMsg\":\"There exists no feature view with the name tsla_stocks_fv and version 1.\",\"errorMsg\":\"Feature view wasn\\'t found.\"}', error code: 270181, error msg: Feature view wasn't found., user msg: There exists no feature view with the name tsla_stocks_fv and version 1.",
|
259 |
-
"\nDuring handling of the above exception, another exception occurred:\n",
|
260 |
-
"\u001b[1;31mAttributeError\u001b[0m Traceback (most recent call last)",
|
261 |
-
"Cell \u001b[1;32mIn[15], line 5\u001b[0m\n\u001b[0;32m 3\u001b[0m tesla_fg \u001b[38;5;241m=\u001b[39m fs\u001b[38;5;241m.\u001b[39mget_feature_group(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mtesla_stock\u001b[39m\u001b[38;5;124m'\u001b[39m, version\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m3\u001b[39m)\n\u001b[0;32m 4\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m:\n\u001b[1;32m----> 5\u001b[0m feature_view, tesla_fg \u001b[38;5;241m=\u001b[39m \u001b[43mcreate_stocks_feature_view\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m)\u001b[49m\n",
|
262 |
-
"Cell \u001b[1;32mIn[14], line 10\u001b[0m, in \u001b[0;36mcreate_stocks_feature_view\u001b[1;34m(fs, version)\u001b[0m\n\u001b[0;32m 5\u001b[0m news_sentiment_fg \u001b[38;5;241m=\u001b[39m fs\u001b[38;5;241m.\u001b[39mget_feature_group(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mnews_sentiment_updated\u001b[39m\u001b[38;5;124m'\u001b[39m, version \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m2\u001b[39m)\n\u001b[0;32m 7\u001b[0m ds_query \u001b[38;5;241m=\u001b[39m tesla_fg\u001b[38;5;241m.\u001b[39mselect([\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mdate\u001b[39m\u001b[38;5;124m'\u001b[39m,\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mopen\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mticker\u001b[39m\u001b[38;5;124m'\u001b[39m])\\\n\u001b[0;32m 8\u001b[0m \u001b[38;5;241m.\u001b[39mjoin(news_sentiment_fg\u001b[38;5;241m.\u001b[39mselect_except([\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mticker\u001b[39m\u001b[38;5;124m'\u001b[39m,\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mtime\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mamp_url\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mimage_url\u001b[39m\u001b[38;5;124m'\u001b[39m]))\n\u001b[1;32m---> 10\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m (\u001b[43mfs\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcreate_tesla_feature_view\u001b[49m(\n\u001b[0;32m 11\u001b[0m name \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mtsla_stocks_fv\u001b[39m\u001b[38;5;124m'\u001b[39m,\n\u001b[0;32m 12\u001b[0m query \u001b[38;5;241m=\u001b[39m ds_query,\n\u001b[0;32m 13\u001b[0m labels\u001b[38;5;241m=\u001b[39m[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mticker\u001b[39m\u001b[38;5;124m'\u001b[39m]\n\u001b[0;32m 14\u001b[0m ), tesla_fg)\n",
|
263 |
-
"\u001b[1;31mAttributeError\u001b[0m: 'FeatureStore' object has no attribute 'create_tesla_feature_view'"
|
264 |
-
]
|
265 |
-
}
|
266 |
-
],
|
267 |
"source": [
|
268 |
"#try:\n",
|
269 |
"# feature_view = fs.get_feature_view(\"tsla_stocks_fv\", version=1)\n",
|
@@ -289,7 +177,7 @@
|
|
289 |
"name": "python",
|
290 |
"nbconvert_exporter": "python",
|
291 |
"pygments_lexer": "ipython3",
|
292 |
-
"version": "3.11.
|
293 |
}
|
294 |
},
|
295 |
"nbformat": 4,
|
|
|
2 |
"cells": [
|
3 |
{
|
4 |
"cell_type": "code",
|
5 |
+
"execution_count": 16,
|
6 |
"metadata": {},
|
7 |
"outputs": [],
|
8 |
"source": [
|
|
|
23 |
},
|
24 |
{
|
25 |
"cell_type": "code",
|
26 |
+
"execution_count": 17,
|
27 |
"metadata": {},
|
28 |
+
"outputs": [],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
"source": [
|
30 |
"from feature_pipeline import tesla_fg\n",
|
31 |
"from feature_pipeline import news_sentiment_fg"
|
|
|
33 |
},
|
34 |
{
|
35 |
"cell_type": "code",
|
36 |
+
"execution_count": 18,
|
37 |
"metadata": {},
|
38 |
"outputs": [
|
39 |
{
|
|
|
42 |
"True"
|
43 |
]
|
44 |
},
|
45 |
+
"execution_count": 18,
|
46 |
"metadata": {},
|
47 |
"output_type": "execute_result"
|
48 |
}
|
|
|
56 |
},
|
57 |
{
|
58 |
"cell_type": "code",
|
59 |
+
"execution_count": 19,
|
60 |
"metadata": {},
|
61 |
"outputs": [
|
62 |
{
|
|
|
66 |
"Connection closed.\n",
|
67 |
"Connected. Call `.close()` to terminate connection gracefully.\n",
|
68 |
"\n",
|
69 |
+
"Logged in to project, explore it here https://c.app.hopsworks.ai:443/p/549016\n",
|
70 |
"Connected. Call `.close()` to terminate connection gracefully.\n"
|
71 |
]
|
72 |
}
|
|
|
79 |
},
|
80 |
{
|
81 |
"cell_type": "code",
|
82 |
+
"execution_count": 22,
|
83 |
"metadata": {},
|
84 |
"outputs": [],
|
85 |
"source": [
|
86 |
"def create_stocks_feature_view(fs, version):\n",
|
87 |
"\n",
|
88 |
" # Loading in the feature groups\n",
|
89 |
+
" tesla_fg = fs.get_feature_group('tesla_stock', version=1)\n",
|
90 |
+
" news_sentiment_fg = fs.get_feature_group('news_sentiment_updated', version=1)\n",
|
91 |
"\n",
|
92 |
" # Define the query\n",
|
93 |
" ds_query = tesla_fg.select(['date', 'open', 'ticker'])\\\n",
|
94 |
+
" .join(news_sentiment_fg.select(['date', 'sentiment']))\n",
|
95 |
"\n",
|
96 |
" # Create the feature view\n",
|
97 |
" feature_view = fs.create_feature_view(\n",
|
98 |
+
" name='tesla_stocks_fv',\n",
|
99 |
" query=ds_query,\n",
|
100 |
" labels=['ticker']\n",
|
101 |
" )\n",
|
|
|
105 |
},
|
106 |
{
|
107 |
"cell_type": "code",
|
108 |
+
"execution_count": 23,
|
109 |
"metadata": {},
|
110 |
"outputs": [
|
111 |
{
|
112 |
+
"name": "stdout",
|
113 |
+
"output_type": "stream",
|
114 |
+
"text": [
|
115 |
+
"Feature view created successfully, explore it at \n",
|
116 |
+
"https://c.app.hopsworks.ai:443/p/549016/fs/544838/fv/tesla_stocks_fv/version/1\n"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
]
|
118 |
}
|
119 |
],
|
120 |
"source": [
|
121 |
"try:\n",
|
122 |
+
" feature_view = fs.get_feature_view(\"tesla_stocks_fv\", version=1)\n",
|
123 |
+
" tesla_fg = fs.get_feature_group('tesla_stock', version=1)\n",
|
124 |
"except:\n",
|
125 |
" feature_view, tesla_fg = create_stocks_feature_view(fs, 1)"
|
126 |
]
|
127 |
},
|
128 |
{
|
129 |
"cell_type": "code",
|
130 |
+
"execution_count": null,
|
131 |
"metadata": {},
|
132 |
"outputs": [],
|
133 |
"source": [
|
|
|
149 |
},
|
150 |
{
|
151 |
"cell_type": "code",
|
152 |
+
"execution_count": null,
|
153 |
"metadata": {},
|
154 |
+
"outputs": [],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
155 |
"source": [
|
156 |
"#try:\n",
|
157 |
"# feature_view = fs.get_feature_view(\"tsla_stocks_fv\", version=1)\n",
|
|
|
177 |
"name": "python",
|
178 |
"nbconvert_exporter": "python",
|
179 |
"pygments_lexer": "ipython3",
|
180 |
+
"version": "3.11.4"
|
181 |
}
|
182 |
},
|
183 |
"nbformat": 4,
|
historical_news.ipynb
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
"cells": [
|
3 |
{
|
4 |
"cell_type": "code",
|
5 |
-
"execution_count":
|
6 |
"metadata": {},
|
7 |
"outputs": [],
|
8 |
"source": [
|
@@ -17,7 +17,7 @@
|
|
17 |
},
|
18 |
{
|
19 |
"cell_type": "code",
|
20 |
-
"execution_count":
|
21 |
"metadata": {},
|
22 |
"outputs": [
|
23 |
{
|
@@ -26,7 +26,7 @@
|
|
26 |
"True"
|
27 |
]
|
28 |
},
|
29 |
-
"execution_count":
|
30 |
"metadata": {},
|
31 |
"output_type": "execute_result"
|
32 |
}
|
@@ -37,30 +37,30 @@
|
|
37 |
},
|
38 |
{
|
39 |
"cell_type": "code",
|
40 |
-
"execution_count":
|
41 |
"metadata": {},
|
42 |
"outputs": [
|
43 |
{
|
44 |
"name": "stdout",
|
45 |
"output_type": "stream",
|
46 |
"text": [
|
47 |
-
"Fetched 50 articles from 2022-05-
|
48 |
-
"Fetched 50 articles from 2022-06-
|
49 |
-
"Fetched 50 articles from 2022-08-
|
50 |
-
"Fetched 50 articles from 2022-10-
|
51 |
-
"Fetched 50 articles from 2022-11-
|
52 |
"Rate limit reached. Waiting to retry...\n",
|
53 |
-
"Fetched 50 articles from 2023-01-
|
54 |
-
"Fetched 50 articles from 2023-03-
|
55 |
-
"Fetched 50 articles from 2023-04-
|
56 |
-
"Fetched 50 articles from 2023-06-
|
57 |
-
"Fetched 50 articles from 2023-08-
|
58 |
"Rate limit reached. Waiting to retry...\n",
|
59 |
-
"Fetched 50 articles from 2023-09-
|
60 |
-
"Fetched 50 articles from 2023-11-
|
61 |
-
"Fetched 50 articles from 2024-01-
|
62 |
-
"Fetched 50 articles from 2024-02-
|
63 |
-
"Fetched 50 articles from 2024-04-
|
64 |
"Total articles fetched: 750\n"
|
65 |
]
|
66 |
}
|
@@ -130,7 +130,7 @@
|
|
130 |
},
|
131 |
{
|
132 |
"cell_type": "code",
|
133 |
-
"execution_count":
|
134 |
"metadata": {},
|
135 |
"outputs": [],
|
136 |
"source": [
|
@@ -140,7 +140,7 @@
|
|
140 |
},
|
141 |
{
|
142 |
"cell_type": "code",
|
143 |
-
"execution_count":
|
144 |
"metadata": {},
|
145 |
"outputs": [
|
146 |
{
|
@@ -148,26 +148,15 @@
|
|
148 |
"output_type": "stream",
|
149 |
"text": [
|
150 |
"<class 'pandas.core.frame.DataFrame'>\n",
|
151 |
-
"
|
152 |
-
"Data columns (total
|
153 |
-
" # Column
|
154 |
-
"--- ------
|
155 |
-
" 0 date
|
156 |
-
" 1
|
157 |
-
" 2
|
158 |
-
"
|
159 |
-
"
|
160 |
-
" 5 article_url 720 non-null object \n",
|
161 |
-
" 6 tickers 720 non-null object \n",
|
162 |
-
" 7 amp_url 720 non-null object \n",
|
163 |
-
" 8 image_url 720 non-null object \n",
|
164 |
-
" 9 description 720 non-null object \n",
|
165 |
-
" 10 keywords 720 non-null object \n",
|
166 |
-
" 11 ticker 720 non-null object \n",
|
167 |
-
" 12 sentiment 720 non-null float64\n",
|
168 |
-
" 13 time 720 non-null object \n",
|
169 |
-
"dtypes: float64(1), object(13)\n",
|
170 |
-
"memory usage: 84.4+ KB\n"
|
171 |
]
|
172 |
}
|
173 |
],
|
@@ -177,7 +166,7 @@
|
|
177 |
},
|
178 |
{
|
179 |
"cell_type": "code",
|
180 |
-
"execution_count":
|
181 |
"metadata": {},
|
182 |
"outputs": [
|
183 |
{
|
@@ -202,191 +191,55 @@
|
|
202 |
" <tr style=\"text-align: right;\">\n",
|
203 |
" <th></th>\n",
|
204 |
" <th>date</th>\n",
|
205 |
-
" <th>id</th>\n",
|
206 |
-
" <th>publisher</th>\n",
|
207 |
-
" <th>title</th>\n",
|
208 |
-
" <th>author</th>\n",
|
209 |
-
" <th>article_url</th>\n",
|
210 |
-
" <th>tickers</th>\n",
|
211 |
-
" <th>amp_url</th>\n",
|
212 |
-
" <th>image_url</th>\n",
|
213 |
-
" <th>description</th>\n",
|
214 |
-
" <th>keywords</th>\n",
|
215 |
" <th>ticker</th>\n",
|
216 |
" <th>sentiment</th>\n",
|
217 |
-
" <th>time</th>\n",
|
218 |
" </tr>\n",
|
219 |
" </thead>\n",
|
220 |
" <tbody>\n",
|
221 |
" <tr>\n",
|
222 |
-
" <th>
|
223 |
-
" <td>2022-06-
|
224 |
-
" <td>nVZWipNVQFFoSi87tF0APXW_uRHl13wat_uR1c0iR6A</td>\n",
|
225 |
-
" <td>{'name': 'Benzinga', 'homepage_url': 'https://...</td>\n",
|
226 |
-
" <td>Elon Musk Gives New Update On Tesla Cybertruck...</td>\n",
|
227 |
-
" <td>Chris Katje</td>\n",
|
228 |
-
" <td>https://www.benzinga.com/news/22/06/27820587/e...</td>\n",
|
229 |
-
" <td>[F, TSLA, RIVN]</td>\n",
|
230 |
-
" <td>https://www.benzinga.com/amp/content/27820587</td>\n",
|
231 |
-
" <td>https://cdn.benzinga.com/files/images/story/20...</td>\n",
|
232 |
-
" <td>A recent interview between Tesla Inc (NASDAQ: ...</td>\n",
|
233 |
-
" <td>[News, Interview]</td>\n",
|
234 |
" <td>TSLA</td>\n",
|
235 |
-
" <td>0.
|
236 |
-
" <td>22:40:56</td>\n",
|
237 |
" </tr>\n",
|
238 |
" <tr>\n",
|
239 |
-
" <th>
|
240 |
-
" <td>2022-06-
|
241 |
-
" <td>x_9M1zYfZoHn_ptJM3USKxrodDtd4TcTsQSldXlViMw</td>\n",
|
242 |
-
" <td>{'name': 'MarketWatch', 'homepage_url': 'https...</td>\n",
|
243 |
-
" <td>Tesla's new factories are 'gigantic money furn...</td>\n",
|
244 |
-
" <td>MarketWatch</td>\n",
|
245 |
-
" <td>https://www.marketwatch.com/story/teslas-new-f...</td>\n",
|
246 |
-
" <td>[TSLA]</td>\n",
|
247 |
-
" <td>No URL provided</td>\n",
|
248 |
-
" <td>https://images.mktw.net/im-569600/social</td>\n",
|
249 |
-
" <td>Tesla Inc.’s two newest car factories have bee...</td>\n",
|
250 |
-
" <td>No keywords</td>\n",
|
251 |
" <td>TSLA</td>\n",
|
252 |
-
" <td>0.
|
253 |
-
" <td>21:59:00</td>\n",
|
254 |
" </tr>\n",
|
255 |
" <tr>\n",
|
256 |
-
" <th>
|
257 |
-
" <td>2022-06-
|
258 |
-
" <td>SDepdS_qKyhE6vqbR6Fathnn81fYDapZCk3DKT1Xpv4</td>\n",
|
259 |
-
" <td>{'name': 'The Motley Fool', 'homepage_url': 'h...</td>\n",
|
260 |
-
" <td>Why Tesla Shares Jumped Initially, Then Retrea...</td>\n",
|
261 |
-
" <td>newsfeedback@fool.com (Chris Neiger)</td>\n",
|
262 |
-
" <td>https://www.fool.com/investing/2022/06/22/why-...</td>\n",
|
263 |
-
" <td>[TSLA]</td>\n",
|
264 |
-
" <td>No URL provided</td>\n",
|
265 |
-
" <td>https://g.foolcdn.com/editorial/images/686400/...</td>\n",
|
266 |
-
" <td>Tesla's Shanghai plant may temporarily suspend...</td>\n",
|
267 |
-
" <td>[investing]</td>\n",
|
268 |
" <td>TSLA</td>\n",
|
269 |
-
" <td>0.
|
270 |
-
" <td>19:33:04</td>\n",
|
271 |
" </tr>\n",
|
272 |
" <tr>\n",
|
273 |
-
" <th>
|
274 |
-
" <td>2022-
|
275 |
-
" <td>xTSACaU2z-Mzqa23BiUeHTEUuY_jbVTWOYFkN3uszxg</td>\n",
|
276 |
-
" <td>{'name': 'MarketWatch', 'homepage_url': 'https...</td>\n",
|
277 |
-
" <td>These are the 10 used-car models whose prices ...</td>\n",
|
278 |
-
" <td>MarketWatch</td>\n",
|
279 |
-
" <td>https://www.marketwatch.com/story/these-are-th...</td>\n",
|
280 |
-
" <td>[LOTZ, TSLA]</td>\n",
|
281 |
-
" <td>https://www.marketwatch.com/amp/story/these-ar...</td>\n",
|
282 |
-
" <td>https://images.mktw.net/im-569120/social</td>\n",
|
283 |
-
" <td>Used-car prices rose on average 17% in May, wi...</td>\n",
|
284 |
-
" <td>No keywords</td>\n",
|
285 |
" <td>TSLA</td>\n",
|
286 |
-
" <td>0.
|
287 |
-
" <td>17:32:00</td>\n",
|
288 |
" </tr>\n",
|
289 |
" <tr>\n",
|
290 |
-
" <th>
|
291 |
-
" <td>2022-
|
292 |
-
" <td>pksGB2t-5ukDnjkRw_VYr9sfcSOExNmQiHzUq9_rBa0</td>\n",
|
293 |
-
" <td>{'name': 'Zacks Investment Research', 'homepag...</td>\n",
|
294 |
-
" <td>Tesla (TSLA) to Cut 10% Salaried Jobs, Raise H...</td>\n",
|
295 |
-
" <td>Zacks Equity Research</td>\n",
|
296 |
-
" <td>https://www.zacks.com/stock/news/1942395/tesla...</td>\n",
|
297 |
-
" <td>[SMP, TSLA, WNC, FOXF]</td>\n",
|
298 |
-
" <td>https://www.zacks.com/amp/stock/news/1942395/t...</td>\n",
|
299 |
-
" <td>https://staticx-tuner.zacks.com/images/article...</td>\n",
|
300 |
-
" <td>Tesla (TSLA) to lay off 10% of its salaried wo...</td>\n",
|
301 |
-
" <td>No keywords</td>\n",
|
302 |
" <td>TSLA</td>\n",
|
303 |
-
" <td>0.
|
304 |
-
" <td>15:58:00</td>\n",
|
305 |
" </tr>\n",
|
306 |
" </tbody>\n",
|
307 |
"</table>\n",
|
308 |
"</div>"
|
309 |
],
|
310 |
"text/plain": [
|
311 |
-
"
|
312 |
-
"
|
313 |
-
"
|
314 |
-
"
|
315 |
-
"
|
316 |
-
"
|
317 |
-
"\n",
|
318 |
-
" id \\\n",
|
319 |
-
"1970-01-01 00:00:00.000000000 nVZWipNVQFFoSi87tF0APXW_uRHl13wat_uR1c0iR6A \n",
|
320 |
-
"1970-01-01 00:00:00.000000001 x_9M1zYfZoHn_ptJM3USKxrodDtd4TcTsQSldXlViMw \n",
|
321 |
-
"1970-01-01 00:00:00.000000002 SDepdS_qKyhE6vqbR6Fathnn81fYDapZCk3DKT1Xpv4 \n",
|
322 |
-
"1970-01-01 00:00:00.000000003 xTSACaU2z-Mzqa23BiUeHTEUuY_jbVTWOYFkN3uszxg \n",
|
323 |
-
"1970-01-01 00:00:00.000000004 pksGB2t-5ukDnjkRw_VYr9sfcSOExNmQiHzUq9_rBa0 \n",
|
324 |
-
"\n",
|
325 |
-
" publisher \\\n",
|
326 |
-
"1970-01-01 00:00:00.000000000 {'name': 'Benzinga', 'homepage_url': 'https://... \n",
|
327 |
-
"1970-01-01 00:00:00.000000001 {'name': 'MarketWatch', 'homepage_url': 'https... \n",
|
328 |
-
"1970-01-01 00:00:00.000000002 {'name': 'The Motley Fool', 'homepage_url': 'h... \n",
|
329 |
-
"1970-01-01 00:00:00.000000003 {'name': 'MarketWatch', 'homepage_url': 'https... \n",
|
330 |
-
"1970-01-01 00:00:00.000000004 {'name': 'Zacks Investment Research', 'homepag... \n",
|
331 |
-
"\n",
|
332 |
-
" title \\\n",
|
333 |
-
"1970-01-01 00:00:00.000000000 Elon Musk Gives New Update On Tesla Cybertruck... \n",
|
334 |
-
"1970-01-01 00:00:00.000000001 Tesla's new factories are 'gigantic money furn... \n",
|
335 |
-
"1970-01-01 00:00:00.000000002 Why Tesla Shares Jumped Initially, Then Retrea... \n",
|
336 |
-
"1970-01-01 00:00:00.000000003 These are the 10 used-car models whose prices ... \n",
|
337 |
-
"1970-01-01 00:00:00.000000004 Tesla (TSLA) to Cut 10% Salaried Jobs, Raise H... \n",
|
338 |
-
"\n",
|
339 |
-
" author \\\n",
|
340 |
-
"1970-01-01 00:00:00.000000000 Chris Katje \n",
|
341 |
-
"1970-01-01 00:00:00.000000001 MarketWatch \n",
|
342 |
-
"1970-01-01 00:00:00.000000002 newsfeedback@fool.com (Chris Neiger) \n",
|
343 |
-
"1970-01-01 00:00:00.000000003 MarketWatch \n",
|
344 |
-
"1970-01-01 00:00:00.000000004 Zacks Equity Research \n",
|
345 |
-
"\n",
|
346 |
-
" article_url \\\n",
|
347 |
-
"1970-01-01 00:00:00.000000000 https://www.benzinga.com/news/22/06/27820587/e... \n",
|
348 |
-
"1970-01-01 00:00:00.000000001 https://www.marketwatch.com/story/teslas-new-f... \n",
|
349 |
-
"1970-01-01 00:00:00.000000002 https://www.fool.com/investing/2022/06/22/why-... \n",
|
350 |
-
"1970-01-01 00:00:00.000000003 https://www.marketwatch.com/story/these-are-th... \n",
|
351 |
-
"1970-01-01 00:00:00.000000004 https://www.zacks.com/stock/news/1942395/tesla... \n",
|
352 |
-
"\n",
|
353 |
-
" tickers \\\n",
|
354 |
-
"1970-01-01 00:00:00.000000000 [F, TSLA, RIVN] \n",
|
355 |
-
"1970-01-01 00:00:00.000000001 [TSLA] \n",
|
356 |
-
"1970-01-01 00:00:00.000000002 [TSLA] \n",
|
357 |
-
"1970-01-01 00:00:00.000000003 [LOTZ, TSLA] \n",
|
358 |
-
"1970-01-01 00:00:00.000000004 [SMP, TSLA, WNC, FOXF] \n",
|
359 |
-
"\n",
|
360 |
-
" amp_url \\\n",
|
361 |
-
"1970-01-01 00:00:00.000000000 https://www.benzinga.com/amp/content/27820587 \n",
|
362 |
-
"1970-01-01 00:00:00.000000001 No URL provided \n",
|
363 |
-
"1970-01-01 00:00:00.000000002 No URL provided \n",
|
364 |
-
"1970-01-01 00:00:00.000000003 https://www.marketwatch.com/amp/story/these-ar... \n",
|
365 |
-
"1970-01-01 00:00:00.000000004 https://www.zacks.com/amp/stock/news/1942395/t... \n",
|
366 |
-
"\n",
|
367 |
-
" image_url \\\n",
|
368 |
-
"1970-01-01 00:00:00.000000000 https://cdn.benzinga.com/files/images/story/20... \n",
|
369 |
-
"1970-01-01 00:00:00.000000001 https://images.mktw.net/im-569600/social \n",
|
370 |
-
"1970-01-01 00:00:00.000000002 https://g.foolcdn.com/editorial/images/686400/... \n",
|
371 |
-
"1970-01-01 00:00:00.000000003 https://images.mktw.net/im-569120/social \n",
|
372 |
-
"1970-01-01 00:00:00.000000004 https://staticx-tuner.zacks.com/images/article... \n",
|
373 |
-
"\n",
|
374 |
-
" description \\\n",
|
375 |
-
"1970-01-01 00:00:00.000000000 A recent interview between Tesla Inc (NASDAQ: ... \n",
|
376 |
-
"1970-01-01 00:00:00.000000001 Tesla Inc.’s two newest car factories have bee... \n",
|
377 |
-
"1970-01-01 00:00:00.000000002 Tesla's Shanghai plant may temporarily suspend... \n",
|
378 |
-
"1970-01-01 00:00:00.000000003 Used-car prices rose on average 17% in May, wi... \n",
|
379 |
-
"1970-01-01 00:00:00.000000004 Tesla (TSLA) to lay off 10% of its salaried wo... \n",
|
380 |
-
"\n",
|
381 |
-
" keywords ticker sentiment time \n",
|
382 |
-
"1970-01-01 00:00:00.000000000 [News, Interview] TSLA 0.040 22:40:56 \n",
|
383 |
-
"1970-01-01 00:00:00.000000001 No keywords TSLA 0.000 21:59:00 \n",
|
384 |
-
"1970-01-01 00:00:00.000000002 [investing] TSLA 0.000 19:33:04 \n",
|
385 |
-
"1970-01-01 00:00:00.000000003 No keywords TSLA 0.225 17:32:00 \n",
|
386 |
-
"1970-01-01 00:00:00.000000004 No keywords TSLA 0.000 15:58:00 "
|
387 |
]
|
388 |
},
|
389 |
-
"execution_count":
|
390 |
"metadata": {},
|
391 |
"output_type": "execute_result"
|
392 |
}
|
@@ -397,7 +250,7 @@
|
|
397 |
},
|
398 |
{
|
399 |
"cell_type": "code",
|
400 |
-
"execution_count":
|
401 |
"metadata": {},
|
402 |
"outputs": [],
|
403 |
"source": [
|
@@ -406,7 +259,7 @@
|
|
406 |
},
|
407 |
{
|
408 |
"cell_type": "code",
|
409 |
-
"execution_count":
|
410 |
"metadata": {},
|
411 |
"outputs": [],
|
412 |
"source": [
|
@@ -415,7 +268,7 @@
|
|
415 |
},
|
416 |
{
|
417 |
"cell_type": "code",
|
418 |
-
"execution_count":
|
419 |
"metadata": {},
|
420 |
"outputs": [],
|
421 |
"source": [
|
@@ -424,7 +277,7 @@
|
|
424 |
},
|
425 |
{
|
426 |
"cell_type": "code",
|
427 |
-
"execution_count":
|
428 |
"metadata": {},
|
429 |
"outputs": [],
|
430 |
"source": [
|
@@ -433,7 +286,7 @@
|
|
433 |
},
|
434 |
{
|
435 |
"cell_type": "code",
|
436 |
-
"execution_count":
|
437 |
"metadata": {},
|
438 |
"outputs": [
|
439 |
{
|
@@ -458,204 +311,61 @@
|
|
458 |
" <tr style=\"text-align: right;\">\n",
|
459 |
" <th></th>\n",
|
460 |
" <th>date</th>\n",
|
461 |
-
" <th>id</th>\n",
|
462 |
-
" <th>publisher</th>\n",
|
463 |
-
" <th>title</th>\n",
|
464 |
-
" <th>author</th>\n",
|
465 |
-
" <th>article_url</th>\n",
|
466 |
-
" <th>tickers</th>\n",
|
467 |
-
" <th>amp_url</th>\n",
|
468 |
-
" <th>image_url</th>\n",
|
469 |
-
" <th>description</th>\n",
|
470 |
-
" <th>keywords</th>\n",
|
471 |
" <th>ticker</th>\n",
|
472 |
" <th>sentiment</th>\n",
|
473 |
-
" <th>time</th>\n",
|
474 |
" <th>exp_mean_7_days</th>\n",
|
475 |
" </tr>\n",
|
476 |
" </thead>\n",
|
477 |
" <tbody>\n",
|
478 |
" <tr>\n",
|
479 |
-
" <th>
|
480 |
-
" <td>2024-
|
481 |
-
" <td>MeWGIZiKn6J3JCwWAkHNqVv6Cc9HToUK-HmodQSesdM</td>\n",
|
482 |
-
" <td>{'name': 'The Motley Fool', 'homepage_url': 'h...</td>\n",
|
483 |
-
" <td>Why Baidu Stock Jumped Today</td>\n",
|
484 |
-
" <td>newsfeedback@fool.com (James Brumley)</td>\n",
|
485 |
-
" <td>https://www.fool.com/investing/2024/04/29/why-...</td>\n",
|
486 |
-
" <td>[BIDU, GOOGL, TSLA, GOOG, IQ]</td>\n",
|
487 |
-
" <td>No URL provided</td>\n",
|
488 |
-
" <td>https://g.foolcdn.com/editorial/images/774939/...</td>\n",
|
489 |
-
" <td>It's getting difficult not to notice how impre...</td>\n",
|
490 |
-
" <td>[investing]</td>\n",
|
491 |
" <td>TSLA</td>\n",
|
492 |
-
" <td>0.
|
493 |
-
" <td>
|
494 |
-
" <td>0.250000</td>\n",
|
495 |
" </tr>\n",
|
496 |
" <tr>\n",
|
497 |
-
" <th>
|
498 |
-
" <td>2024-04
|
499 |
-
" <td>T9MgJwXEmlRjWpkmLvcwnBggkbeXWWoGzFISY65WwBc</td>\n",
|
500 |
-
" <td>{'name': 'Zacks Investment Research', 'homepag...</td>\n",
|
501 |
-
" <td>Markets Up on Tesla, Q1 Earnings; Q1 Beats Aft...</td>\n",
|
502 |
-
" <td>Mark Vickery</td>\n",
|
503 |
-
" <td>https://www.zacks.com/stock/news/2264549/marke...</td>\n",
|
504 |
-
" <td>[AMZN, AMD, KO, LLY, SBUX, MCD, NXPI, TSLA, YU...</td>\n",
|
505 |
-
" <td>https://www.zacks.com/amp/stock/news/2264549/m...</td>\n",
|
506 |
-
" <td>https://staticx-tuner.zacks.com/images/article...</td>\n",
|
507 |
-
" <td>It's now the third straight day higher going b...</td>\n",
|
508 |
-
" <td>No keywords</td>\n",
|
509 |
" <td>TSLA</td>\n",
|
510 |
-
" <td>0.
|
511 |
-
" <td>
|
512 |
-
" <td>0.215476</td>\n",
|
513 |
" </tr>\n",
|
514 |
" <tr>\n",
|
515 |
-
" <th>
|
516 |
-
" <td>2024-
|
517 |
-
" <td>xaUyg2qUKK7h_EDkKruXR9KdY_drlcXLai14uHvZTsc</td>\n",
|
518 |
-
" <td>{'name': 'Seeking Alpha', 'homepage_url': 'htt...</td>\n",
|
519 |
-
" <td>Big Tech Earnings Beats Stymie Q2 2024 Sell-Off</td>\n",
|
520 |
-
" <td>Christine Short</td>\n",
|
521 |
-
" <td>https://seekingalpha.com/article/4687390-big-t...</td>\n",
|
522 |
-
" <td>[AAPL, AMZN, GOOG, GOOGL, HSY, KO, META, MMM, ...</td>\n",
|
523 |
-
" <td>No URL provided</td>\n",
|
524 |
-
" <td>https://static.seekingalpha.com/cdn/s3/uploads...</td>\n",
|
525 |
-
" <td>Markets finally turned positive late last week...</td>\n",
|
526 |
-
" <td>No keywords</td>\n",
|
527 |
" <td>TSLA</td>\n",
|
528 |
-
" <td
|
529 |
-
" <td>
|
530 |
-
" <td>0.153369</td>\n",
|
531 |
" </tr>\n",
|
532 |
" <tr>\n",
|
533 |
-
" <th>
|
534 |
-
" <td>2024-
|
535 |
-
" <td>IPVxhBMbT73GJJHLQZYPFb8yQpAxzbEuXrJk0dMSt8U</td>\n",
|
536 |
-
" <td>{'name': 'Zacks Investment Research', 'homepag...</td>\n",
|
537 |
-
" <td>Stock Market News for Apr 30, 2024</td>\n",
|
538 |
-
" <td>Zacks Equity Research</td>\n",
|
539 |
-
" <td>https://www.zacks.com/stock/news/2264591/stock...</td>\n",
|
540 |
-
" <td>[AAPL, TSLA, PARA]</td>\n",
|
541 |
-
" <td>https://www.zacks.com/amp/stock/news/2264591/s...</td>\n",
|
542 |
-
" <td>https://staticx-tuner.zacks.com/images/article...</td>\n",
|
543 |
-
" <td>Wall Street closed higher on Monday to start a...</td>\n",
|
544 |
-
" <td>No keywords</td>\n",
|
545 |
" <td>TSLA</td>\n",
|
546 |
-
" <td>0.
|
547 |
-
" <td>
|
548 |
-
" <td>0.127526</td>\n",
|
549 |
" </tr>\n",
|
550 |
" <tr>\n",
|
551 |
-
" <th>
|
552 |
-
" <td>2024-
|
553 |
-
" <td>6pQAGkGEZvAd76QYnk6aAhhUCVLrUkdOjgnon-ALmsQ</td>\n",
|
554 |
-
" <td>{'name': 'Benzinga', 'homepage_url': 'https://...</td>\n",
|
555 |
-
" <td>'Tesla Has The Endorsement' Of Xi Jinping's Go...</td>\n",
|
556 |
-
" <td>Benzinga Neuro</td>\n",
|
557 |
-
" <td>https://www.benzinga.com/analyst-ratings/analy...</td>\n",
|
558 |
-
" <td>[TSLA]</td>\n",
|
559 |
-
" <td>https://www.benzinga.com/amp/content/38511044</td>\n",
|
560 |
-
" <td>https://cdn.benzinga.com/files/images/story/20...</td>\n",
|
561 |
-
" <td>Tim Higgins, author of “Power Play: Tesla, Elo...</td>\n",
|
562 |
-
" <td>[News, Analyst Color, Tech, General]</td>\n",
|
563 |
" <td>TSLA</td>\n",
|
564 |
-
" <td>0.
|
565 |
-
" <td>
|
566 |
-
" <td>0.097728</td>\n",
|
567 |
" </tr>\n",
|
568 |
" </tbody>\n",
|
569 |
"</table>\n",
|
570 |
"</div>"
|
571 |
],
|
572 |
"text/plain": [
|
573 |
-
"
|
574 |
-
"
|
575 |
-
"
|
576 |
-
"
|
577 |
-
"
|
578 |
-
"
|
579 |
-
"\n",
|
580 |
-
" id \\\n",
|
581 |
-
"1970-01-01 00:00:00.000000719 MeWGIZiKn6J3JCwWAkHNqVv6Cc9HToUK-HmodQSesdM \n",
|
582 |
-
"1970-01-01 00:00:00.000000718 T9MgJwXEmlRjWpkmLvcwnBggkbeXWWoGzFISY65WwBc \n",
|
583 |
-
"1970-01-01 00:00:00.000000717 xaUyg2qUKK7h_EDkKruXR9KdY_drlcXLai14uHvZTsc \n",
|
584 |
-
"1970-01-01 00:00:00.000000716 IPVxhBMbT73GJJHLQZYPFb8yQpAxzbEuXrJk0dMSt8U \n",
|
585 |
-
"1970-01-01 00:00:00.000000715 6pQAGkGEZvAd76QYnk6aAhhUCVLrUkdOjgnon-ALmsQ \n",
|
586 |
-
"\n",
|
587 |
-
" publisher \\\n",
|
588 |
-
"1970-01-01 00:00:00.000000719 {'name': 'The Motley Fool', 'homepage_url': 'h... \n",
|
589 |
-
"1970-01-01 00:00:00.000000718 {'name': 'Zacks Investment Research', 'homepag... \n",
|
590 |
-
"1970-01-01 00:00:00.000000717 {'name': 'Seeking Alpha', 'homepage_url': 'htt... \n",
|
591 |
-
"1970-01-01 00:00:00.000000716 {'name': 'Zacks Investment Research', 'homepag... \n",
|
592 |
-
"1970-01-01 00:00:00.000000715 {'name': 'Benzinga', 'homepage_url': 'https://... \n",
|
593 |
-
"\n",
|
594 |
-
" title \\\n",
|
595 |
-
"1970-01-01 00:00:00.000000719 Why Baidu Stock Jumped Today \n",
|
596 |
-
"1970-01-01 00:00:00.000000718 Markets Up on Tesla, Q1 Earnings; Q1 Beats Aft... \n",
|
597 |
-
"1970-01-01 00:00:00.000000717 Big Tech Earnings Beats Stymie Q2 2024 Sell-Off \n",
|
598 |
-
"1970-01-01 00:00:00.000000716 Stock Market News for Apr 30, 2024 \n",
|
599 |
-
"1970-01-01 00:00:00.000000715 'Tesla Has The Endorsement' Of Xi Jinping's Go... \n",
|
600 |
-
"\n",
|
601 |
-
" author \\\n",
|
602 |
-
"1970-01-01 00:00:00.000000719 newsfeedback@fool.com (James Brumley) \n",
|
603 |
-
"1970-01-01 00:00:00.000000718 Mark Vickery \n",
|
604 |
-
"1970-01-01 00:00:00.000000717 Christine Short \n",
|
605 |
-
"1970-01-01 00:00:00.000000716 Zacks Equity Research \n",
|
606 |
-
"1970-01-01 00:00:00.000000715 Benzinga Neuro \n",
|
607 |
-
"\n",
|
608 |
-
" article_url \\\n",
|
609 |
-
"1970-01-01 00:00:00.000000719 https://www.fool.com/investing/2024/04/29/why-... \n",
|
610 |
-
"1970-01-01 00:00:00.000000718 https://www.zacks.com/stock/news/2264549/marke... \n",
|
611 |
-
"1970-01-01 00:00:00.000000717 https://seekingalpha.com/article/4687390-big-t... \n",
|
612 |
-
"1970-01-01 00:00:00.000000716 https://www.zacks.com/stock/news/2264591/stock... \n",
|
613 |
-
"1970-01-01 00:00:00.000000715 https://www.benzinga.com/analyst-ratings/analy... \n",
|
614 |
-
"\n",
|
615 |
-
" tickers \\\n",
|
616 |
-
"1970-01-01 00:00:00.000000719 [BIDU, GOOGL, TSLA, GOOG, IQ] \n",
|
617 |
-
"1970-01-01 00:00:00.000000718 [AMZN, AMD, KO, LLY, SBUX, MCD, NXPI, TSLA, YU... \n",
|
618 |
-
"1970-01-01 00:00:00.000000717 [AAPL, AMZN, GOOG, GOOGL, HSY, KO, META, MMM, ... \n",
|
619 |
-
"1970-01-01 00:00:00.000000716 [AAPL, TSLA, PARA] \n",
|
620 |
-
"1970-01-01 00:00:00.000000715 [TSLA] \n",
|
621 |
-
"\n",
|
622 |
-
" amp_url \\\n",
|
623 |
-
"1970-01-01 00:00:00.000000719 No URL provided \n",
|
624 |
-
"1970-01-01 00:00:00.000000718 https://www.zacks.com/amp/stock/news/2264549/m... \n",
|
625 |
-
"1970-01-01 00:00:00.000000717 No URL provided \n",
|
626 |
-
"1970-01-01 00:00:00.000000716 https://www.zacks.com/amp/stock/news/2264591/s... \n",
|
627 |
-
"1970-01-01 00:00:00.000000715 https://www.benzinga.com/amp/content/38511044 \n",
|
628 |
-
"\n",
|
629 |
-
" image_url \\\n",
|
630 |
-
"1970-01-01 00:00:00.000000719 https://g.foolcdn.com/editorial/images/774939/... \n",
|
631 |
-
"1970-01-01 00:00:00.000000718 https://staticx-tuner.zacks.com/images/article... \n",
|
632 |
-
"1970-01-01 00:00:00.000000717 https://static.seekingalpha.com/cdn/s3/uploads... \n",
|
633 |
-
"1970-01-01 00:00:00.000000716 https://staticx-tuner.zacks.com/images/article... \n",
|
634 |
-
"1970-01-01 00:00:00.000000715 https://cdn.benzinga.com/files/images/story/20... \n",
|
635 |
-
"\n",
|
636 |
-
" description \\\n",
|
637 |
-
"1970-01-01 00:00:00.000000719 It's getting difficult not to notice how impre... \n",
|
638 |
-
"1970-01-01 00:00:00.000000718 It's now the third straight day higher going b... \n",
|
639 |
-
"1970-01-01 00:00:00.000000717 Markets finally turned positive late last week... \n",
|
640 |
-
"1970-01-01 00:00:00.000000716 Wall Street closed higher on Monday to start a... \n",
|
641 |
-
"1970-01-01 00:00:00.000000715 Tim Higgins, author of “Power Play: Tesla, Elo... \n",
|
642 |
-
"\n",
|
643 |
-
" keywords ticker \\\n",
|
644 |
-
"1970-01-01 00:00:00.000000719 [investing] TSLA \n",
|
645 |
-
"1970-01-01 00:00:00.000000718 No keywords TSLA \n",
|
646 |
-
"1970-01-01 00:00:00.000000717 No keywords TSLA \n",
|
647 |
-
"1970-01-01 00:00:00.000000716 No keywords TSLA \n",
|
648 |
-
"1970-01-01 00:00:00.000000715 [News, Analyst Color, Tech, General] TSLA \n",
|
649 |
-
"\n",
|
650 |
-
" sentiment time exp_mean_7_days \n",
|
651 |
-
"1970-01-01 00:00:00.000000719 0.250000 21:26:09 0.250000 \n",
|
652 |
-
"1970-01-01 00:00:00.000000718 0.111905 22:10:00 0.215476 \n",
|
653 |
-
"1970-01-01 00:00:00.000000717 -0.032955 04:30:00 0.153369 \n",
|
654 |
-
"1970-01-01 00:00:00.000000716 0.050000 07:27:00 0.127526 \n",
|
655 |
-
"1970-01-01 00:00:00.000000715 0.008333 07:42:58 0.097728 "
|
656 |
]
|
657 |
},
|
658 |
-
"execution_count":
|
659 |
"metadata": {},
|
660 |
"output_type": "execute_result"
|
661 |
}
|
@@ -666,7 +376,7 @@
|
|
666 |
},
|
667 |
{
|
668 |
"cell_type": "code",
|
669 |
-
"execution_count":
|
670 |
"metadata": {},
|
671 |
"outputs": [
|
672 |
{
|
@@ -691,204 +401,61 @@
|
|
691 |
" <tr style=\"text-align: right;\">\n",
|
692 |
" <th></th>\n",
|
693 |
" <th>date</th>\n",
|
694 |
-
" <th>id</th>\n",
|
695 |
-
" <th>publisher</th>\n",
|
696 |
-
" <th>title</th>\n",
|
697 |
-
" <th>author</th>\n",
|
698 |
-
" <th>article_url</th>\n",
|
699 |
-
" <th>tickers</th>\n",
|
700 |
-
" <th>amp_url</th>\n",
|
701 |
-
" <th>image_url</th>\n",
|
702 |
-
" <th>description</th>\n",
|
703 |
-
" <th>keywords</th>\n",
|
704 |
" <th>ticker</th>\n",
|
705 |
" <th>sentiment</th>\n",
|
706 |
-
" <th>time</th>\n",
|
707 |
" <th>exp_mean_7_days</th>\n",
|
708 |
" </tr>\n",
|
709 |
" </thead>\n",
|
710 |
" <tbody>\n",
|
711 |
" <tr>\n",
|
712 |
-
" <th>
|
713 |
-
" <td>2022-
|
714 |
-
" <td>pksGB2t-5ukDnjkRw_VYr9sfcSOExNmQiHzUq9_rBa0</td>\n",
|
715 |
-
" <td>{'name': 'Zacks Investment Research', 'homepag...</td>\n",
|
716 |
-
" <td>Tesla (TSLA) to Cut 10% Salaried Jobs, Raise H...</td>\n",
|
717 |
-
" <td>Zacks Equity Research</td>\n",
|
718 |
-
" <td>https://www.zacks.com/stock/news/1942395/tesla...</td>\n",
|
719 |
-
" <td>[SMP, TSLA, WNC, FOXF]</td>\n",
|
720 |
-
" <td>https://www.zacks.com/amp/stock/news/1942395/t...</td>\n",
|
721 |
-
" <td>https://staticx-tuner.zacks.com/images/article...</td>\n",
|
722 |
-
" <td>Tesla (TSLA) to lay off 10% of its salaried wo...</td>\n",
|
723 |
-
" <td>No keywords</td>\n",
|
724 |
" <td>TSLA</td>\n",
|
725 |
-
" <td>0.
|
726 |
-
" <td>
|
727 |
-
" <td>0.195010</td>\n",
|
728 |
" </tr>\n",
|
729 |
" <tr>\n",
|
730 |
-
" <th>
|
731 |
-
" <td>2022-
|
732 |
-
" <td>xTSACaU2z-Mzqa23BiUeHTEUuY_jbVTWOYFkN3uszxg</td>\n",
|
733 |
-
" <td>{'name': 'MarketWatch', 'homepage_url': 'https...</td>\n",
|
734 |
-
" <td>These are the 10 used-car models whose prices ...</td>\n",
|
735 |
-
" <td>MarketWatch</td>\n",
|
736 |
-
" <td>https://www.marketwatch.com/story/these-are-th...</td>\n",
|
737 |
-
" <td>[LOTZ, TSLA]</td>\n",
|
738 |
-
" <td>https://www.marketwatch.com/amp/story/these-ar...</td>\n",
|
739 |
-
" <td>https://images.mktw.net/im-569120/social</td>\n",
|
740 |
-
" <td>Used-car prices rose on average 17% in May, wi...</td>\n",
|
741 |
-
" <td>No keywords</td>\n",
|
742 |
" <td>TSLA</td>\n",
|
743 |
-
" <td>0.
|
744 |
-
" <td>
|
745 |
-
" <td>0.202508</td>\n",
|
746 |
" </tr>\n",
|
747 |
" <tr>\n",
|
748 |
-
" <th>
|
749 |
-
" <td>2022-06-
|
750 |
-
" <td>SDepdS_qKyhE6vqbR6Fathnn81fYDapZCk3DKT1Xpv4</td>\n",
|
751 |
-
" <td>{'name': 'The Motley Fool', 'homepage_url': 'h...</td>\n",
|
752 |
-
" <td>Why Tesla Shares Jumped Initially, Then Retrea...</td>\n",
|
753 |
-
" <td>newsfeedback@fool.com (Chris Neiger)</td>\n",
|
754 |
-
" <td>https://www.fool.com/investing/2022/06/22/why-...</td>\n",
|
755 |
-
" <td>[TSLA]</td>\n",
|
756 |
-
" <td>No URL provided</td>\n",
|
757 |
-
" <td>https://g.foolcdn.com/editorial/images/686400/...</td>\n",
|
758 |
-
" <td>Tesla's Shanghai plant may temporarily suspend...</td>\n",
|
759 |
-
" <td>[investing]</td>\n",
|
760 |
" <td>TSLA</td>\n",
|
761 |
-
" <td>0.
|
762 |
-
" <td>
|
763 |
-
" <td>0.151881</td>\n",
|
764 |
" </tr>\n",
|
765 |
" <tr>\n",
|
766 |
-
" <th>
|
767 |
-
" <td>2022-06-
|
768 |
-
" <td>x_9M1zYfZoHn_ptJM3USKxrodDtd4TcTsQSldXlViMw</td>\n",
|
769 |
-
" <td>{'name': 'MarketWatch', 'homepage_url': 'https...</td>\n",
|
770 |
-
" <td>Tesla's new factories are 'gigantic money furn...</td>\n",
|
771 |
-
" <td>MarketWatch</td>\n",
|
772 |
-
" <td>https://www.marketwatch.com/story/teslas-new-f...</td>\n",
|
773 |
-
" <td>[TSLA]</td>\n",
|
774 |
-
" <td>No URL provided</td>\n",
|
775 |
-
" <td>https://images.mktw.net/im-569600/social</td>\n",
|
776 |
-
" <td>Tesla Inc.’s two newest car factories have bee...</td>\n",
|
777 |
-
" <td>No keywords</td>\n",
|
778 |
" <td>TSLA</td>\n",
|
779 |
-
" <td>0.
|
780 |
-
" <td>
|
781 |
-
" <td>0.113910</td>\n",
|
782 |
" </tr>\n",
|
783 |
" <tr>\n",
|
784 |
-
" <th>
|
785 |
-
" <td>2022-06-
|
786 |
-
" <td>nVZWipNVQFFoSi87tF0APXW_uRHl13wat_uR1c0iR6A</td>\n",
|
787 |
-
" <td>{'name': 'Benzinga', 'homepage_url': 'https://...</td>\n",
|
788 |
-
" <td>Elon Musk Gives New Update On Tesla Cybertruck...</td>\n",
|
789 |
-
" <td>Chris Katje</td>\n",
|
790 |
-
" <td>https://www.benzinga.com/news/22/06/27820587/e...</td>\n",
|
791 |
-
" <td>[F, TSLA, RIVN]</td>\n",
|
792 |
-
" <td>https://www.benzinga.com/amp/content/27820587</td>\n",
|
793 |
-
" <td>https://cdn.benzinga.com/files/images/story/20...</td>\n",
|
794 |
-
" <td>A recent interview between Tesla Inc (NASDAQ: ...</td>\n",
|
795 |
-
" <td>[News, Interview]</td>\n",
|
796 |
" <td>TSLA</td>\n",
|
797 |
-
" <td>0.
|
798 |
-
" <td>
|
799 |
-
" <td>0.095433</td>\n",
|
800 |
" </tr>\n",
|
801 |
" </tbody>\n",
|
802 |
"</table>\n",
|
803 |
"</div>"
|
804 |
],
|
805 |
"text/plain": [
|
806 |
-
"
|
807 |
-
"
|
808 |
-
"
|
809 |
-
"
|
810 |
-
"
|
811 |
-
"
|
812 |
-
"\n",
|
813 |
-
" id \\\n",
|
814 |
-
"1970-01-01 00:00:00.000000004 pksGB2t-5ukDnjkRw_VYr9sfcSOExNmQiHzUq9_rBa0 \n",
|
815 |
-
"1970-01-01 00:00:00.000000003 xTSACaU2z-Mzqa23BiUeHTEUuY_jbVTWOYFkN3uszxg \n",
|
816 |
-
"1970-01-01 00:00:00.000000002 SDepdS_qKyhE6vqbR6Fathnn81fYDapZCk3DKT1Xpv4 \n",
|
817 |
-
"1970-01-01 00:00:00.000000001 x_9M1zYfZoHn_ptJM3USKxrodDtd4TcTsQSldXlViMw \n",
|
818 |
-
"1970-01-01 00:00:00.000000000 nVZWipNVQFFoSi87tF0APXW_uRHl13wat_uR1c0iR6A \n",
|
819 |
-
"\n",
|
820 |
-
" publisher \\\n",
|
821 |
-
"1970-01-01 00:00:00.000000004 {'name': 'Zacks Investment Research', 'homepag... \n",
|
822 |
-
"1970-01-01 00:00:00.000000003 {'name': 'MarketWatch', 'homepage_url': 'https... \n",
|
823 |
-
"1970-01-01 00:00:00.000000002 {'name': 'The Motley Fool', 'homepage_url': 'h... \n",
|
824 |
-
"1970-01-01 00:00:00.000000001 {'name': 'MarketWatch', 'homepage_url': 'https... \n",
|
825 |
-
"1970-01-01 00:00:00.000000000 {'name': 'Benzinga', 'homepage_url': 'https://... \n",
|
826 |
-
"\n",
|
827 |
-
" title \\\n",
|
828 |
-
"1970-01-01 00:00:00.000000004 Tesla (TSLA) to Cut 10% Salaried Jobs, Raise H... \n",
|
829 |
-
"1970-01-01 00:00:00.000000003 These are the 10 used-car models whose prices ... \n",
|
830 |
-
"1970-01-01 00:00:00.000000002 Why Tesla Shares Jumped Initially, Then Retrea... \n",
|
831 |
-
"1970-01-01 00:00:00.000000001 Tesla's new factories are 'gigantic money furn... \n",
|
832 |
-
"1970-01-01 00:00:00.000000000 Elon Musk Gives New Update On Tesla Cybertruck... \n",
|
833 |
-
"\n",
|
834 |
-
" author \\\n",
|
835 |
-
"1970-01-01 00:00:00.000000004 Zacks Equity Research \n",
|
836 |
-
"1970-01-01 00:00:00.000000003 MarketWatch \n",
|
837 |
-
"1970-01-01 00:00:00.000000002 newsfeedback@fool.com (Chris Neiger) \n",
|
838 |
-
"1970-01-01 00:00:00.000000001 MarketWatch \n",
|
839 |
-
"1970-01-01 00:00:00.000000000 Chris Katje \n",
|
840 |
-
"\n",
|
841 |
-
" article_url \\\n",
|
842 |
-
"1970-01-01 00:00:00.000000004 https://www.zacks.com/stock/news/1942395/tesla... \n",
|
843 |
-
"1970-01-01 00:00:00.000000003 https://www.marketwatch.com/story/these-are-th... \n",
|
844 |
-
"1970-01-01 00:00:00.000000002 https://www.fool.com/investing/2022/06/22/why-... \n",
|
845 |
-
"1970-01-01 00:00:00.000000001 https://www.marketwatch.com/story/teslas-new-f... \n",
|
846 |
-
"1970-01-01 00:00:00.000000000 https://www.benzinga.com/news/22/06/27820587/e... \n",
|
847 |
-
"\n",
|
848 |
-
" tickers \\\n",
|
849 |
-
"1970-01-01 00:00:00.000000004 [SMP, TSLA, WNC, FOXF] \n",
|
850 |
-
"1970-01-01 00:00:00.000000003 [LOTZ, TSLA] \n",
|
851 |
-
"1970-01-01 00:00:00.000000002 [TSLA] \n",
|
852 |
-
"1970-01-01 00:00:00.000000001 [TSLA] \n",
|
853 |
-
"1970-01-01 00:00:00.000000000 [F, TSLA, RIVN] \n",
|
854 |
-
"\n",
|
855 |
-
" amp_url \\\n",
|
856 |
-
"1970-01-01 00:00:00.000000004 https://www.zacks.com/amp/stock/news/1942395/t... \n",
|
857 |
-
"1970-01-01 00:00:00.000000003 https://www.marketwatch.com/amp/story/these-ar... \n",
|
858 |
-
"1970-01-01 00:00:00.000000002 No URL provided \n",
|
859 |
-
"1970-01-01 00:00:00.000000001 No URL provided \n",
|
860 |
-
"1970-01-01 00:00:00.000000000 https://www.benzinga.com/amp/content/27820587 \n",
|
861 |
-
"\n",
|
862 |
-
" image_url \\\n",
|
863 |
-
"1970-01-01 00:00:00.000000004 https://staticx-tuner.zacks.com/images/article... \n",
|
864 |
-
"1970-01-01 00:00:00.000000003 https://images.mktw.net/im-569120/social \n",
|
865 |
-
"1970-01-01 00:00:00.000000002 https://g.foolcdn.com/editorial/images/686400/... \n",
|
866 |
-
"1970-01-01 00:00:00.000000001 https://images.mktw.net/im-569600/social \n",
|
867 |
-
"1970-01-01 00:00:00.000000000 https://cdn.benzinga.com/files/images/story/20... \n",
|
868 |
-
"\n",
|
869 |
-
" description \\\n",
|
870 |
-
"1970-01-01 00:00:00.000000004 Tesla (TSLA) to lay off 10% of its salaried wo... \n",
|
871 |
-
"1970-01-01 00:00:00.000000003 Used-car prices rose on average 17% in May, wi... \n",
|
872 |
-
"1970-01-01 00:00:00.000000002 Tesla's Shanghai plant may temporarily suspend... \n",
|
873 |
-
"1970-01-01 00:00:00.000000001 Tesla Inc.’s two newest car factories have bee... \n",
|
874 |
-
"1970-01-01 00:00:00.000000000 A recent interview between Tesla Inc (NASDAQ: ... \n",
|
875 |
-
"\n",
|
876 |
-
" keywords ticker sentiment time \\\n",
|
877 |
-
"1970-01-01 00:00:00.000000004 No keywords TSLA 0.000 15:58:00 \n",
|
878 |
-
"1970-01-01 00:00:00.000000003 No keywords TSLA 0.225 17:32:00 \n",
|
879 |
-
"1970-01-01 00:00:00.000000002 [investing] TSLA 0.000 19:33:04 \n",
|
880 |
-
"1970-01-01 00:00:00.000000001 No keywords TSLA 0.000 21:59:00 \n",
|
881 |
-
"1970-01-01 00:00:00.000000000 [News, Interview] TSLA 0.040 22:40:56 \n",
|
882 |
-
"\n",
|
883 |
-
" exp_mean_7_days \n",
|
884 |
-
"1970-01-01 00:00:00.000000004 0.195010 \n",
|
885 |
-
"1970-01-01 00:00:00.000000003 0.202508 \n",
|
886 |
-
"1970-01-01 00:00:00.000000002 0.151881 \n",
|
887 |
-
"1970-01-01 00:00:00.000000001 0.113910 \n",
|
888 |
-
"1970-01-01 00:00:00.000000000 0.095433 "
|
889 |
]
|
890 |
},
|
891 |
-
"execution_count":
|
892 |
"metadata": {},
|
893 |
"output_type": "execute_result"
|
894 |
}
|
@@ -899,15 +466,15 @@
|
|
899 |
},
|
900 |
{
|
901 |
"cell_type": "code",
|
902 |
-
"execution_count":
|
903 |
"metadata": {},
|
904 |
"outputs": [
|
905 |
{
|
906 |
"name": "stdout",
|
907 |
"output_type": "stream",
|
908 |
"text": [
|
909 |
-
"2022-06-
|
910 |
-
"2024-05-
|
911 |
]
|
912 |
}
|
913 |
],
|
@@ -918,7 +485,7 @@
|
|
918 |
},
|
919 |
{
|
920 |
"cell_type": "code",
|
921 |
-
"execution_count":
|
922 |
"metadata": {},
|
923 |
"outputs": [
|
924 |
{
|
@@ -935,16 +502,16 @@
|
|
935 |
},
|
936 |
{
|
937 |
"cell_type": "code",
|
938 |
-
"execution_count":
|
939 |
"metadata": {},
|
940 |
"outputs": [
|
941 |
{
|
942 |
"data": {
|
943 |
"text/plain": [
|
944 |
-
"(
|
945 |
]
|
946 |
},
|
947 |
-
"execution_count":
|
948 |
"metadata": {},
|
949 |
"output_type": "execute_result"
|
950 |
}
|
@@ -955,7 +522,7 @@
|
|
955 |
},
|
956 |
{
|
957 |
"cell_type": "code",
|
958 |
-
"execution_count":
|
959 |
"metadata": {},
|
960 |
"outputs": [],
|
961 |
"source": [
|
@@ -964,16 +531,16 @@
|
|
964 |
},
|
965 |
{
|
966 |
"cell_type": "code",
|
967 |
-
"execution_count":
|
968 |
"metadata": {},
|
969 |
"outputs": [
|
970 |
{
|
971 |
"data": {
|
972 |
"text/plain": [
|
973 |
-
"(
|
974 |
]
|
975 |
},
|
976 |
-
"execution_count":
|
977 |
"metadata": {},
|
978 |
"output_type": "execute_result"
|
979 |
}
|
@@ -984,7 +551,7 @@
|
|
984 |
},
|
985 |
{
|
986 |
"cell_type": "code",
|
987 |
-
"execution_count":
|
988 |
"metadata": {},
|
989 |
"outputs": [
|
990 |
{
|
@@ -1009,204 +576,61 @@
|
|
1009 |
" <tr style=\"text-align: right;\">\n",
|
1010 |
" <th></th>\n",
|
1011 |
" <th>date</th>\n",
|
1012 |
-
" <th>id</th>\n",
|
1013 |
-
" <th>publisher</th>\n",
|
1014 |
-
" <th>title</th>\n",
|
1015 |
-
" <th>author</th>\n",
|
1016 |
-
" <th>article_url</th>\n",
|
1017 |
-
" <th>tickers</th>\n",
|
1018 |
-
" <th>amp_url</th>\n",
|
1019 |
-
" <th>image_url</th>\n",
|
1020 |
-
" <th>description</th>\n",
|
1021 |
-
" <th>keywords</th>\n",
|
1022 |
" <th>ticker</th>\n",
|
1023 |
" <th>sentiment</th>\n",
|
1024 |
-
" <th>time</th>\n",
|
1025 |
" <th>exp_mean_7_days</th>\n",
|
1026 |
" </tr>\n",
|
1027 |
" </thead>\n",
|
1028 |
" <tbody>\n",
|
1029 |
" <tr>\n",
|
1030 |
-
" <th>
|
1031 |
-
" <td>2024-
|
1032 |
-
" <td>MeWGIZiKn6J3JCwWAkHNqVv6Cc9HToUK-HmodQSesdM</td>\n",
|
1033 |
-
" <td>{'name': 'The Motley Fool', 'homepage_url': 'h...</td>\n",
|
1034 |
-
" <td>Why Baidu Stock Jumped Today</td>\n",
|
1035 |
-
" <td>newsfeedback@fool.com (James Brumley)</td>\n",
|
1036 |
-
" <td>https://www.fool.com/investing/2024/04/29/why-...</td>\n",
|
1037 |
-
" <td>[BIDU, GOOGL, TSLA, GOOG, IQ]</td>\n",
|
1038 |
-
" <td>No URL provided</td>\n",
|
1039 |
-
" <td>https://g.foolcdn.com/editorial/images/774939/...</td>\n",
|
1040 |
-
" <td>It's getting difficult not to notice how impre...</td>\n",
|
1041 |
-
" <td>[investing]</td>\n",
|
1042 |
" <td>TSLA</td>\n",
|
1043 |
-
" <td>0.
|
1044 |
-
" <td>
|
1045 |
-
" <td>0.250000</td>\n",
|
1046 |
" </tr>\n",
|
1047 |
" <tr>\n",
|
1048 |
-
" <th>
|
1049 |
-
" <td>2024-04
|
1050 |
-
" <td>T9MgJwXEmlRjWpkmLvcwnBggkbeXWWoGzFISY65WwBc</td>\n",
|
1051 |
-
" <td>{'name': 'Zacks Investment Research', 'homepag...</td>\n",
|
1052 |
-
" <td>Markets Up on Tesla, Q1 Earnings; Q1 Beats Aft...</td>\n",
|
1053 |
-
" <td>Mark Vickery</td>\n",
|
1054 |
-
" <td>https://www.zacks.com/stock/news/2264549/marke...</td>\n",
|
1055 |
-
" <td>[AMZN, AMD, KO, LLY, SBUX, MCD, NXPI, TSLA, YU...</td>\n",
|
1056 |
-
" <td>https://www.zacks.com/amp/stock/news/2264549/m...</td>\n",
|
1057 |
-
" <td>https://staticx-tuner.zacks.com/images/article...</td>\n",
|
1058 |
-
" <td>It's now the third straight day higher going b...</td>\n",
|
1059 |
-
" <td>No keywords</td>\n",
|
1060 |
" <td>TSLA</td>\n",
|
1061 |
-
" <td>0.
|
1062 |
-
" <td>
|
1063 |
-
" <td>0.215476</td>\n",
|
1064 |
" </tr>\n",
|
1065 |
" <tr>\n",
|
1066 |
-
" <th>
|
1067 |
-
" <td>2024-
|
1068 |
-
" <td>xaUyg2qUKK7h_EDkKruXR9KdY_drlcXLai14uHvZTsc</td>\n",
|
1069 |
-
" <td>{'name': 'Seeking Alpha', 'homepage_url': 'htt...</td>\n",
|
1070 |
-
" <td>Big Tech Earnings Beats Stymie Q2 2024 Sell-Off</td>\n",
|
1071 |
-
" <td>Christine Short</td>\n",
|
1072 |
-
" <td>https://seekingalpha.com/article/4687390-big-t...</td>\n",
|
1073 |
-
" <td>[AAPL, AMZN, GOOG, GOOGL, HSY, KO, META, MMM, ...</td>\n",
|
1074 |
-
" <td>No URL provided</td>\n",
|
1075 |
-
" <td>https://static.seekingalpha.com/cdn/s3/uploads...</td>\n",
|
1076 |
-
" <td>Markets finally turned positive late last week...</td>\n",
|
1077 |
-
" <td>No keywords</td>\n",
|
1078 |
" <td>TSLA</td>\n",
|
1079 |
-
" <td
|
1080 |
-
" <td>
|
1081 |
-
" <td>0.153369</td>\n",
|
1082 |
" </tr>\n",
|
1083 |
" <tr>\n",
|
1084 |
-
" <th>
|
1085 |
-
" <td>2024-
|
1086 |
-
" <td>IPVxhBMbT73GJJHLQZYPFb8yQpAxzbEuXrJk0dMSt8U</td>\n",
|
1087 |
-
" <td>{'name': 'Zacks Investment Research', 'homepag...</td>\n",
|
1088 |
-
" <td>Stock Market News for Apr 30, 2024</td>\n",
|
1089 |
-
" <td>Zacks Equity Research</td>\n",
|
1090 |
-
" <td>https://www.zacks.com/stock/news/2264591/stock...</td>\n",
|
1091 |
-
" <td>[AAPL, TSLA, PARA]</td>\n",
|
1092 |
-
" <td>https://www.zacks.com/amp/stock/news/2264591/s...</td>\n",
|
1093 |
-
" <td>https://staticx-tuner.zacks.com/images/article...</td>\n",
|
1094 |
-
" <td>Wall Street closed higher on Monday to start a...</td>\n",
|
1095 |
-
" <td>No keywords</td>\n",
|
1096 |
" <td>TSLA</td>\n",
|
1097 |
-
" <td>0.
|
1098 |
-
" <td>
|
1099 |
-
" <td>0.127526</td>\n",
|
1100 |
" </tr>\n",
|
1101 |
" <tr>\n",
|
1102 |
-
" <th>
|
1103 |
-
" <td>2024-
|
1104 |
-
" <td>6pQAGkGEZvAd76QYnk6aAhhUCVLrUkdOjgnon-ALmsQ</td>\n",
|
1105 |
-
" <td>{'name': 'Benzinga', 'homepage_url': 'https://...</td>\n",
|
1106 |
-
" <td>'Tesla Has The Endorsement' Of Xi Jinping's Go...</td>\n",
|
1107 |
-
" <td>Benzinga Neuro</td>\n",
|
1108 |
-
" <td>https://www.benzinga.com/analyst-ratings/analy...</td>\n",
|
1109 |
-
" <td>[TSLA]</td>\n",
|
1110 |
-
" <td>https://www.benzinga.com/amp/content/38511044</td>\n",
|
1111 |
-
" <td>https://cdn.benzinga.com/files/images/story/20...</td>\n",
|
1112 |
-
" <td>Tim Higgins, author of “Power Play: Tesla, Elo...</td>\n",
|
1113 |
-
" <td>[News, Analyst Color, Tech, General]</td>\n",
|
1114 |
" <td>TSLA</td>\n",
|
1115 |
-
" <td>0.
|
1116 |
-
" <td>
|
1117 |
-
" <td>0.097728</td>\n",
|
1118 |
" </tr>\n",
|
1119 |
" </tbody>\n",
|
1120 |
"</table>\n",
|
1121 |
"</div>"
|
1122 |
],
|
1123 |
"text/plain": [
|
1124 |
-
"
|
1125 |
-
"
|
1126 |
-
"
|
1127 |
-
"
|
1128 |
-
"
|
1129 |
-
"
|
1130 |
-
"\n",
|
1131 |
-
" id \\\n",
|
1132 |
-
"1970-01-01 00:00:00.000000719 MeWGIZiKn6J3JCwWAkHNqVv6Cc9HToUK-HmodQSesdM \n",
|
1133 |
-
"1970-01-01 00:00:00.000000718 T9MgJwXEmlRjWpkmLvcwnBggkbeXWWoGzFISY65WwBc \n",
|
1134 |
-
"1970-01-01 00:00:00.000000717 xaUyg2qUKK7h_EDkKruXR9KdY_drlcXLai14uHvZTsc \n",
|
1135 |
-
"1970-01-01 00:00:00.000000716 IPVxhBMbT73GJJHLQZYPFb8yQpAxzbEuXrJk0dMSt8U \n",
|
1136 |
-
"1970-01-01 00:00:00.000000715 6pQAGkGEZvAd76QYnk6aAhhUCVLrUkdOjgnon-ALmsQ \n",
|
1137 |
-
"\n",
|
1138 |
-
" publisher \\\n",
|
1139 |
-
"1970-01-01 00:00:00.000000719 {'name': 'The Motley Fool', 'homepage_url': 'h... \n",
|
1140 |
-
"1970-01-01 00:00:00.000000718 {'name': 'Zacks Investment Research', 'homepag... \n",
|
1141 |
-
"1970-01-01 00:00:00.000000717 {'name': 'Seeking Alpha', 'homepage_url': 'htt... \n",
|
1142 |
-
"1970-01-01 00:00:00.000000716 {'name': 'Zacks Investment Research', 'homepag... \n",
|
1143 |
-
"1970-01-01 00:00:00.000000715 {'name': 'Benzinga', 'homepage_url': 'https://... \n",
|
1144 |
-
"\n",
|
1145 |
-
" title \\\n",
|
1146 |
-
"1970-01-01 00:00:00.000000719 Why Baidu Stock Jumped Today \n",
|
1147 |
-
"1970-01-01 00:00:00.000000718 Markets Up on Tesla, Q1 Earnings; Q1 Beats Aft... \n",
|
1148 |
-
"1970-01-01 00:00:00.000000717 Big Tech Earnings Beats Stymie Q2 2024 Sell-Off \n",
|
1149 |
-
"1970-01-01 00:00:00.000000716 Stock Market News for Apr 30, 2024 \n",
|
1150 |
-
"1970-01-01 00:00:00.000000715 'Tesla Has The Endorsement' Of Xi Jinping's Go... \n",
|
1151 |
-
"\n",
|
1152 |
-
" author \\\n",
|
1153 |
-
"1970-01-01 00:00:00.000000719 newsfeedback@fool.com (James Brumley) \n",
|
1154 |
-
"1970-01-01 00:00:00.000000718 Mark Vickery \n",
|
1155 |
-
"1970-01-01 00:00:00.000000717 Christine Short \n",
|
1156 |
-
"1970-01-01 00:00:00.000000716 Zacks Equity Research \n",
|
1157 |
-
"1970-01-01 00:00:00.000000715 Benzinga Neuro \n",
|
1158 |
-
"\n",
|
1159 |
-
" article_url \\\n",
|
1160 |
-
"1970-01-01 00:00:00.000000719 https://www.fool.com/investing/2024/04/29/why-... \n",
|
1161 |
-
"1970-01-01 00:00:00.000000718 https://www.zacks.com/stock/news/2264549/marke... \n",
|
1162 |
-
"1970-01-01 00:00:00.000000717 https://seekingalpha.com/article/4687390-big-t... \n",
|
1163 |
-
"1970-01-01 00:00:00.000000716 https://www.zacks.com/stock/news/2264591/stock... \n",
|
1164 |
-
"1970-01-01 00:00:00.000000715 https://www.benzinga.com/analyst-ratings/analy... \n",
|
1165 |
-
"\n",
|
1166 |
-
" tickers \\\n",
|
1167 |
-
"1970-01-01 00:00:00.000000719 [BIDU, GOOGL, TSLA, GOOG, IQ] \n",
|
1168 |
-
"1970-01-01 00:00:00.000000718 [AMZN, AMD, KO, LLY, SBUX, MCD, NXPI, TSLA, YU... \n",
|
1169 |
-
"1970-01-01 00:00:00.000000717 [AAPL, AMZN, GOOG, GOOGL, HSY, KO, META, MMM, ... \n",
|
1170 |
-
"1970-01-01 00:00:00.000000716 [AAPL, TSLA, PARA] \n",
|
1171 |
-
"1970-01-01 00:00:00.000000715 [TSLA] \n",
|
1172 |
-
"\n",
|
1173 |
-
" amp_url \\\n",
|
1174 |
-
"1970-01-01 00:00:00.000000719 No URL provided \n",
|
1175 |
-
"1970-01-01 00:00:00.000000718 https://www.zacks.com/amp/stock/news/2264549/m... \n",
|
1176 |
-
"1970-01-01 00:00:00.000000717 No URL provided \n",
|
1177 |
-
"1970-01-01 00:00:00.000000716 https://www.zacks.com/amp/stock/news/2264591/s... \n",
|
1178 |
-
"1970-01-01 00:00:00.000000715 https://www.benzinga.com/amp/content/38511044 \n",
|
1179 |
-
"\n",
|
1180 |
-
" image_url \\\n",
|
1181 |
-
"1970-01-01 00:00:00.000000719 https://g.foolcdn.com/editorial/images/774939/... \n",
|
1182 |
-
"1970-01-01 00:00:00.000000718 https://staticx-tuner.zacks.com/images/article... \n",
|
1183 |
-
"1970-01-01 00:00:00.000000717 https://static.seekingalpha.com/cdn/s3/uploads... \n",
|
1184 |
-
"1970-01-01 00:00:00.000000716 https://staticx-tuner.zacks.com/images/article... \n",
|
1185 |
-
"1970-01-01 00:00:00.000000715 https://cdn.benzinga.com/files/images/story/20... \n",
|
1186 |
-
"\n",
|
1187 |
-
" description \\\n",
|
1188 |
-
"1970-01-01 00:00:00.000000719 It's getting difficult not to notice how impre... \n",
|
1189 |
-
"1970-01-01 00:00:00.000000718 It's now the third straight day higher going b... \n",
|
1190 |
-
"1970-01-01 00:00:00.000000717 Markets finally turned positive late last week... \n",
|
1191 |
-
"1970-01-01 00:00:00.000000716 Wall Street closed higher on Monday to start a... \n",
|
1192 |
-
"1970-01-01 00:00:00.000000715 Tim Higgins, author of “Power Play: Tesla, Elo... \n",
|
1193 |
-
"\n",
|
1194 |
-
" keywords ticker \\\n",
|
1195 |
-
"1970-01-01 00:00:00.000000719 [investing] TSLA \n",
|
1196 |
-
"1970-01-01 00:00:00.000000718 No keywords TSLA \n",
|
1197 |
-
"1970-01-01 00:00:00.000000717 No keywords TSLA \n",
|
1198 |
-
"1970-01-01 00:00:00.000000716 No keywords TSLA \n",
|
1199 |
-
"1970-01-01 00:00:00.000000715 [News, Analyst Color, Tech, General] TSLA \n",
|
1200 |
-
"\n",
|
1201 |
-
" sentiment time exp_mean_7_days \n",
|
1202 |
-
"1970-01-01 00:00:00.000000719 0.250000 21:26:09 0.250000 \n",
|
1203 |
-
"1970-01-01 00:00:00.000000718 0.111905 22:10:00 0.215476 \n",
|
1204 |
-
"1970-01-01 00:00:00.000000717 -0.032955 04:30:00 0.153369 \n",
|
1205 |
-
"1970-01-01 00:00:00.000000716 0.050000 07:27:00 0.127526 \n",
|
1206 |
-
"1970-01-01 00:00:00.000000715 0.008333 07:42:58 0.097728 "
|
1207 |
]
|
1208 |
},
|
1209 |
-
"execution_count":
|
1210 |
"metadata": {},
|
1211 |
"output_type": "execute_result"
|
1212 |
}
|
@@ -1239,7 +663,7 @@
|
|
1239 |
"name": "python",
|
1240 |
"nbconvert_exporter": "python",
|
1241 |
"pygments_lexer": "ipython3",
|
1242 |
-
"version": "3.11.
|
1243 |
},
|
1244 |
"orig_nbformat": 4
|
1245 |
},
|
|
|
2 |
"cells": [
|
3 |
{
|
4 |
"cell_type": "code",
|
5 |
+
"execution_count": 1,
|
6 |
"metadata": {},
|
7 |
"outputs": [],
|
8 |
"source": [
|
|
|
17 |
},
|
18 |
{
|
19 |
"cell_type": "code",
|
20 |
+
"execution_count": 2,
|
21 |
"metadata": {},
|
22 |
"outputs": [
|
23 |
{
|
|
|
26 |
"True"
|
27 |
]
|
28 |
},
|
29 |
+
"execution_count": 2,
|
30 |
"metadata": {},
|
31 |
"output_type": "execute_result"
|
32 |
}
|
|
|
37 |
},
|
38 |
{
|
39 |
"cell_type": "code",
|
40 |
+
"execution_count": 3,
|
41 |
"metadata": {},
|
42 |
"outputs": [
|
43 |
{
|
44 |
"name": "stdout",
|
45 |
"output_type": "stream",
|
46 |
"text": [
|
47 |
+
"Fetched 50 articles from 2022-05-06 to 2022-06-25\n",
|
48 |
+
"Fetched 50 articles from 2022-06-26 to 2022-08-15\n",
|
49 |
+
"Fetched 50 articles from 2022-08-16 to 2022-10-05\n",
|
50 |
+
"Fetched 50 articles from 2022-10-06 to 2022-11-25\n",
|
51 |
+
"Fetched 50 articles from 2022-11-26 to 2023-01-15\n",
|
52 |
"Rate limit reached. Waiting to retry...\n",
|
53 |
+
"Fetched 50 articles from 2023-01-16 to 2023-03-07\n",
|
54 |
+
"Fetched 50 articles from 2023-03-08 to 2023-04-27\n",
|
55 |
+
"Fetched 50 articles from 2023-04-28 to 2023-06-17\n",
|
56 |
+
"Fetched 50 articles from 2023-06-18 to 2023-08-07\n",
|
57 |
+
"Fetched 50 articles from 2023-08-08 to 2023-09-27\n",
|
58 |
"Rate limit reached. Waiting to retry...\n",
|
59 |
+
"Fetched 50 articles from 2023-09-28 to 2023-11-17\n",
|
60 |
+
"Fetched 50 articles from 2023-11-18 to 2024-01-07\n",
|
61 |
+
"Fetched 50 articles from 2024-01-08 to 2024-02-27\n",
|
62 |
+
"Fetched 50 articles from 2024-02-28 to 2024-04-18\n",
|
63 |
+
"Fetched 50 articles from 2024-04-19 to 2024-05-05\n",
|
64 |
"Total articles fetched: 750\n"
|
65 |
]
|
66 |
}
|
|
|
130 |
},
|
131 |
{
|
132 |
"cell_type": "code",
|
133 |
+
"execution_count": 4,
|
134 |
"metadata": {},
|
135 |
"outputs": [],
|
136 |
"source": [
|
|
|
140 |
},
|
141 |
{
|
142 |
"cell_type": "code",
|
143 |
+
"execution_count": 5,
|
144 |
"metadata": {},
|
145 |
"outputs": [
|
146 |
{
|
|
|
148 |
"output_type": "stream",
|
149 |
"text": [
|
150 |
"<class 'pandas.core.frame.DataFrame'>\n",
|
151 |
+
"RangeIndex: 66 entries, 0 to 65\n",
|
152 |
+
"Data columns (total 3 columns):\n",
|
153 |
+
" # Column Non-Null Count Dtype \n",
|
154 |
+
"--- ------ -------------- ----- \n",
|
155 |
+
" 0 date 66 non-null object \n",
|
156 |
+
" 1 ticker 66 non-null object \n",
|
157 |
+
" 2 sentiment 66 non-null float64\n",
|
158 |
+
"dtypes: float64(1), object(2)\n",
|
159 |
+
"memory usage: 1.7+ KB\n"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
160 |
]
|
161 |
}
|
162 |
],
|
|
|
166 |
},
|
167 |
{
|
168 |
"cell_type": "code",
|
169 |
+
"execution_count": 6,
|
170 |
"metadata": {},
|
171 |
"outputs": [
|
172 |
{
|
|
|
191 |
" <tr style=\"text-align: right;\">\n",
|
192 |
" <th></th>\n",
|
193 |
" <th>date</th>\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
194 |
" <th>ticker</th>\n",
|
195 |
" <th>sentiment</th>\n",
|
|
|
196 |
" </tr>\n",
|
197 |
" </thead>\n",
|
198 |
" <tbody>\n",
|
199 |
" <tr>\n",
|
200 |
+
" <th>0</th>\n",
|
201 |
+
" <td>2022-06-23</td>\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
202 |
" <td>TSLA</td>\n",
|
203 |
+
" <td>0.091056</td>\n",
|
|
|
204 |
" </tr>\n",
|
205 |
" <tr>\n",
|
206 |
+
" <th>1</th>\n",
|
207 |
+
" <td>2022-06-24</td>\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
208 |
" <td>TSLA</td>\n",
|
209 |
+
" <td>0.059212</td>\n",
|
|
|
210 |
" </tr>\n",
|
211 |
" <tr>\n",
|
212 |
+
" <th>2</th>\n",
|
213 |
+
" <td>2022-06-25</td>\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
214 |
" <td>TSLA</td>\n",
|
215 |
+
" <td>0.250000</td>\n",
|
|
|
216 |
" </tr>\n",
|
217 |
" <tr>\n",
|
218 |
+
" <th>3</th>\n",
|
219 |
+
" <td>2022-08-11</td>\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
220 |
" <td>TSLA</td>\n",
|
221 |
+
" <td>0.171968</td>\n",
|
|
|
222 |
" </tr>\n",
|
223 |
" <tr>\n",
|
224 |
+
" <th>4</th>\n",
|
225 |
+
" <td>2022-08-12</td>\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
226 |
" <td>TSLA</td>\n",
|
227 |
+
" <td>0.035351</td>\n",
|
|
|
228 |
" </tr>\n",
|
229 |
" </tbody>\n",
|
230 |
"</table>\n",
|
231 |
"</div>"
|
232 |
],
|
233 |
"text/plain": [
|
234 |
+
" date ticker sentiment\n",
|
235 |
+
"0 2022-06-23 TSLA 0.091056\n",
|
236 |
+
"1 2022-06-24 TSLA 0.059212\n",
|
237 |
+
"2 2022-06-25 TSLA 0.250000\n",
|
238 |
+
"3 2022-08-11 TSLA 0.171968\n",
|
239 |
+
"4 2022-08-12 TSLA 0.035351"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
240 |
]
|
241 |
},
|
242 |
+
"execution_count": 6,
|
243 |
"metadata": {},
|
244 |
"output_type": "execute_result"
|
245 |
}
|
|
|
250 |
},
|
251 |
{
|
252 |
"cell_type": "code",
|
253 |
+
"execution_count": 7,
|
254 |
"metadata": {},
|
255 |
"outputs": [],
|
256 |
"source": [
|
|
|
259 |
},
|
260 |
{
|
261 |
"cell_type": "code",
|
262 |
+
"execution_count": 8,
|
263 |
"metadata": {},
|
264 |
"outputs": [],
|
265 |
"source": [
|
|
|
268 |
},
|
269 |
{
|
270 |
"cell_type": "code",
|
271 |
+
"execution_count": 9,
|
272 |
"metadata": {},
|
273 |
"outputs": [],
|
274 |
"source": [
|
|
|
277 |
},
|
278 |
{
|
279 |
"cell_type": "code",
|
280 |
+
"execution_count": 10,
|
281 |
"metadata": {},
|
282 |
"outputs": [],
|
283 |
"source": [
|
|
|
286 |
},
|
287 |
{
|
288 |
"cell_type": "code",
|
289 |
+
"execution_count": 11,
|
290 |
"metadata": {},
|
291 |
"outputs": [
|
292 |
{
|
|
|
311 |
" <tr style=\"text-align: right;\">\n",
|
312 |
" <th></th>\n",
|
313 |
" <th>date</th>\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
314 |
" <th>ticker</th>\n",
|
315 |
" <th>sentiment</th>\n",
|
|
|
316 |
" <th>exp_mean_7_days</th>\n",
|
317 |
" </tr>\n",
|
318 |
" </thead>\n",
|
319 |
" <tbody>\n",
|
320 |
" <tr>\n",
|
321 |
+
" <th>65</th>\n",
|
322 |
+
" <td>2024-05-05</td>\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
323 |
" <td>TSLA</td>\n",
|
324 |
+
" <td>0.036190</td>\n",
|
325 |
+
" <td>0.036190</td>\n",
|
|
|
326 |
" </tr>\n",
|
327 |
" <tr>\n",
|
328 |
+
" <th>64</th>\n",
|
329 |
+
" <td>2024-05-04</td>\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
330 |
" <td>TSLA</td>\n",
|
331 |
+
" <td>0.062665</td>\n",
|
332 |
+
" <td>0.042809</td>\n",
|
|
|
333 |
" </tr>\n",
|
334 |
" <tr>\n",
|
335 |
+
" <th>63</th>\n",
|
336 |
+
" <td>2024-05-03</td>\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
337 |
" <td>TSLA</td>\n",
|
338 |
+
" <td>0.027798</td>\n",
|
339 |
+
" <td>0.039056</td>\n",
|
|
|
340 |
" </tr>\n",
|
341 |
" <tr>\n",
|
342 |
+
" <th>62</th>\n",
|
343 |
+
" <td>2024-05-02</td>\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
344 |
" <td>TSLA</td>\n",
|
345 |
+
" <td>0.001443</td>\n",
|
346 |
+
" <td>0.029653</td>\n",
|
|
|
347 |
" </tr>\n",
|
348 |
" <tr>\n",
|
349 |
+
" <th>61</th>\n",
|
350 |
+
" <td>2024-05-01</td>\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
351 |
" <td>TSLA</td>\n",
|
352 |
+
" <td>0.162742</td>\n",
|
353 |
+
" <td>0.062925</td>\n",
|
|
|
354 |
" </tr>\n",
|
355 |
" </tbody>\n",
|
356 |
"</table>\n",
|
357 |
"</div>"
|
358 |
],
|
359 |
"text/plain": [
|
360 |
+
" date ticker sentiment exp_mean_7_days\n",
|
361 |
+
"65 2024-05-05 TSLA 0.036190 0.036190\n",
|
362 |
+
"64 2024-05-04 TSLA 0.062665 0.042809\n",
|
363 |
+
"63 2024-05-03 TSLA 0.027798 0.039056\n",
|
364 |
+
"62 2024-05-02 TSLA 0.001443 0.029653\n",
|
365 |
+
"61 2024-05-01 TSLA 0.162742 0.062925"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
366 |
]
|
367 |
},
|
368 |
+
"execution_count": 11,
|
369 |
"metadata": {},
|
370 |
"output_type": "execute_result"
|
371 |
}
|
|
|
376 |
},
|
377 |
{
|
378 |
"cell_type": "code",
|
379 |
+
"execution_count": 12,
|
380 |
"metadata": {},
|
381 |
"outputs": [
|
382 |
{
|
|
|
401 |
" <tr style=\"text-align: right;\">\n",
|
402 |
" <th></th>\n",
|
403 |
" <th>date</th>\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
404 |
" <th>ticker</th>\n",
|
405 |
" <th>sentiment</th>\n",
|
|
|
406 |
" <th>exp_mean_7_days</th>\n",
|
407 |
" </tr>\n",
|
408 |
" </thead>\n",
|
409 |
" <tbody>\n",
|
410 |
" <tr>\n",
|
411 |
+
" <th>4</th>\n",
|
412 |
+
" <td>2022-08-12</td>\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
413 |
" <td>TSLA</td>\n",
|
414 |
+
" <td>0.035351</td>\n",
|
415 |
+
" <td>0.053681</td>\n",
|
|
|
416 |
" </tr>\n",
|
417 |
" <tr>\n",
|
418 |
+
" <th>3</th>\n",
|
419 |
+
" <td>2022-08-11</td>\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
420 |
" <td>TSLA</td>\n",
|
421 |
+
" <td>0.171968</td>\n",
|
422 |
+
" <td>0.083253</td>\n",
|
|
|
423 |
" </tr>\n",
|
424 |
" <tr>\n",
|
425 |
+
" <th>2</th>\n",
|
426 |
+
" <td>2022-06-25</td>\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
427 |
" <td>TSLA</td>\n",
|
428 |
+
" <td>0.250000</td>\n",
|
429 |
+
" <td>0.124940</td>\n",
|
|
|
430 |
" </tr>\n",
|
431 |
" <tr>\n",
|
432 |
+
" <th>1</th>\n",
|
433 |
+
" <td>2022-06-24</td>\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
434 |
" <td>TSLA</td>\n",
|
435 |
+
" <td>0.059212</td>\n",
|
436 |
+
" <td>0.108508</td>\n",
|
|
|
437 |
" </tr>\n",
|
438 |
" <tr>\n",
|
439 |
+
" <th>0</th>\n",
|
440 |
+
" <td>2022-06-23</td>\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
441 |
" <td>TSLA</td>\n",
|
442 |
+
" <td>0.091056</td>\n",
|
443 |
+
" <td>0.104145</td>\n",
|
|
|
444 |
" </tr>\n",
|
445 |
" </tbody>\n",
|
446 |
"</table>\n",
|
447 |
"</div>"
|
448 |
],
|
449 |
"text/plain": [
|
450 |
+
" date ticker sentiment exp_mean_7_days\n",
|
451 |
+
"4 2022-08-12 TSLA 0.035351 0.053681\n",
|
452 |
+
"3 2022-08-11 TSLA 0.171968 0.083253\n",
|
453 |
+
"2 2022-06-25 TSLA 0.250000 0.124940\n",
|
454 |
+
"1 2022-06-24 TSLA 0.059212 0.108508\n",
|
455 |
+
"0 2022-06-23 TSLA 0.091056 0.104145"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
456 |
]
|
457 |
},
|
458 |
+
"execution_count": 12,
|
459 |
"metadata": {},
|
460 |
"output_type": "execute_result"
|
461 |
}
|
|
|
466 |
},
|
467 |
{
|
468 |
"cell_type": "code",
|
469 |
+
"execution_count": 13,
|
470 |
"metadata": {},
|
471 |
"outputs": [
|
472 |
{
|
473 |
"name": "stdout",
|
474 |
"output_type": "stream",
|
475 |
"text": [
|
476 |
+
"2022-06-23\n",
|
477 |
+
"2024-05-05\n"
|
478 |
]
|
479 |
}
|
480 |
],
|
|
|
485 |
},
|
486 |
{
|
487 |
"cell_type": "code",
|
488 |
+
"execution_count": 14,
|
489 |
"metadata": {},
|
490 |
"outputs": [
|
491 |
{
|
|
|
502 |
},
|
503 |
{
|
504 |
"cell_type": "code",
|
505 |
+
"execution_count": 15,
|
506 |
"metadata": {},
|
507 |
"outputs": [
|
508 |
{
|
509 |
"data": {
|
510 |
"text/plain": [
|
511 |
+
"(66, 4)"
|
512 |
]
|
513 |
},
|
514 |
+
"execution_count": 15,
|
515 |
"metadata": {},
|
516 |
"output_type": "execute_result"
|
517 |
}
|
|
|
522 |
},
|
523 |
{
|
524 |
"cell_type": "code",
|
525 |
+
"execution_count": 16,
|
526 |
"metadata": {},
|
527 |
"outputs": [],
|
528 |
"source": [
|
|
|
531 |
},
|
532 |
{
|
533 |
"cell_type": "code",
|
534 |
+
"execution_count": 17,
|
535 |
"metadata": {},
|
536 |
"outputs": [
|
537 |
{
|
538 |
"data": {
|
539 |
"text/plain": [
|
540 |
+
"(0, 4)"
|
541 |
]
|
542 |
},
|
543 |
+
"execution_count": 17,
|
544 |
"metadata": {},
|
545 |
"output_type": "execute_result"
|
546 |
}
|
|
|
551 |
},
|
552 |
{
|
553 |
"cell_type": "code",
|
554 |
+
"execution_count": 18,
|
555 |
"metadata": {},
|
556 |
"outputs": [
|
557 |
{
|
|
|
576 |
" <tr style=\"text-align: right;\">\n",
|
577 |
" <th></th>\n",
|
578 |
" <th>date</th>\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
579 |
" <th>ticker</th>\n",
|
580 |
" <th>sentiment</th>\n",
|
|
|
581 |
" <th>exp_mean_7_days</th>\n",
|
582 |
" </tr>\n",
|
583 |
" </thead>\n",
|
584 |
" <tbody>\n",
|
585 |
" <tr>\n",
|
586 |
+
" <th>65</th>\n",
|
587 |
+
" <td>2024-05-05</td>\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
588 |
" <td>TSLA</td>\n",
|
589 |
+
" <td>0.036190</td>\n",
|
590 |
+
" <td>0.036190</td>\n",
|
|
|
591 |
" </tr>\n",
|
592 |
" <tr>\n",
|
593 |
+
" <th>64</th>\n",
|
594 |
+
" <td>2024-05-04</td>\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
595 |
" <td>TSLA</td>\n",
|
596 |
+
" <td>0.062665</td>\n",
|
597 |
+
" <td>0.042809</td>\n",
|
|
|
598 |
" </tr>\n",
|
599 |
" <tr>\n",
|
600 |
+
" <th>63</th>\n",
|
601 |
+
" <td>2024-05-03</td>\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
602 |
" <td>TSLA</td>\n",
|
603 |
+
" <td>0.027798</td>\n",
|
604 |
+
" <td>0.039056</td>\n",
|
|
|
605 |
" </tr>\n",
|
606 |
" <tr>\n",
|
607 |
+
" <th>62</th>\n",
|
608 |
+
" <td>2024-05-02</td>\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
609 |
" <td>TSLA</td>\n",
|
610 |
+
" <td>0.001443</td>\n",
|
611 |
+
" <td>0.029653</td>\n",
|
|
|
612 |
" </tr>\n",
|
613 |
" <tr>\n",
|
614 |
+
" <th>61</th>\n",
|
615 |
+
" <td>2024-05-01</td>\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
616 |
" <td>TSLA</td>\n",
|
617 |
+
" <td>0.162742</td>\n",
|
618 |
+
" <td>0.062925</td>\n",
|
|
|
619 |
" </tr>\n",
|
620 |
" </tbody>\n",
|
621 |
"</table>\n",
|
622 |
"</div>"
|
623 |
],
|
624 |
"text/plain": [
|
625 |
+
" date ticker sentiment exp_mean_7_days\n",
|
626 |
+
"65 2024-05-05 TSLA 0.036190 0.036190\n",
|
627 |
+
"64 2024-05-04 TSLA 0.062665 0.042809\n",
|
628 |
+
"63 2024-05-03 TSLA 0.027798 0.039056\n",
|
629 |
+
"62 2024-05-02 TSLA 0.001443 0.029653\n",
|
630 |
+
"61 2024-05-01 TSLA 0.162742 0.062925"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
631 |
]
|
632 |
},
|
633 |
+
"execution_count": 18,
|
634 |
"metadata": {},
|
635 |
"output_type": "execute_result"
|
636 |
}
|
|
|
663 |
"name": "python",
|
664 |
"nbconvert_exporter": "python",
|
665 |
"pygments_lexer": "ipython3",
|
666 |
+
"version": "3.11.4"
|
667 |
},
|
668 |
"orig_nbformat": 4
|
669 |
},
|
historical_stock.ipynb
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
"cells": [
|
3 |
{
|
4 |
"cell_type": "code",
|
5 |
-
"execution_count":
|
6 |
"metadata": {},
|
7 |
"outputs": [],
|
8 |
"source": [
|
@@ -25,7 +25,7 @@
|
|
25 |
},
|
26 |
{
|
27 |
"cell_type": "code",
|
28 |
-
"execution_count":
|
29 |
"metadata": {},
|
30 |
"outputs": [
|
31 |
{
|
@@ -34,11 +34,11 @@
|
|
34 |
"text": [
|
35 |
" 1. open 2. high 3. low 4. close 5. volume ticker\n",
|
36 |
"date \n",
|
|
|
37 |
"2024-05-02 182.86 184.60 176.0200 180.01 89148041.0 TSLA\n",
|
38 |
"2024-05-01 182.00 185.86 179.0100 179.99 92829719.0 TSLA\n",
|
39 |
"2024-04-30 186.98 190.95 182.8401 183.28 127031787.0 TSLA\n",
|
40 |
-
"2024-04-29 188.42 198.87 184.5400 194.05 243869678.0 TSLA\n"
|
41 |
-
"2024-04-26 168.85 172.12 166.3700 168.29 109815725.0 TSLA\n"
|
42 |
]
|
43 |
}
|
44 |
],
|
@@ -67,7 +67,7 @@
|
|
67 |
},
|
68 |
{
|
69 |
"cell_type": "code",
|
70 |
-
"execution_count":
|
71 |
"metadata": {},
|
72 |
"outputs": [],
|
73 |
"source": [
|
@@ -125,7 +125,7 @@
|
|
125 |
},
|
126 |
{
|
127 |
"cell_type": "code",
|
128 |
-
"execution_count":
|
129 |
"metadata": {},
|
130 |
"outputs": [],
|
131 |
"source": [
|
@@ -198,7 +198,7 @@
|
|
198 |
},
|
199 |
{
|
200 |
"cell_type": "code",
|
201 |
-
"execution_count":
|
202 |
"metadata": {},
|
203 |
"outputs": [
|
204 |
{
|
@@ -236,7 +236,7 @@
|
|
236 |
"name": "python",
|
237 |
"nbconvert_exporter": "python",
|
238 |
"pygments_lexer": "ipython3",
|
239 |
-
"version": "3.11.
|
240 |
},
|
241 |
"orig_nbformat": 4
|
242 |
},
|
|
|
2 |
"cells": [
|
3 |
{
|
4 |
"cell_type": "code",
|
5 |
+
"execution_count": 1,
|
6 |
"metadata": {},
|
7 |
"outputs": [],
|
8 |
"source": [
|
|
|
25 |
},
|
26 |
{
|
27 |
"cell_type": "code",
|
28 |
+
"execution_count": 2,
|
29 |
"metadata": {},
|
30 |
"outputs": [
|
31 |
{
|
|
|
34 |
"text": [
|
35 |
" 1. open 2. high 3. low 4. close 5. volume ticker\n",
|
36 |
"date \n",
|
37 |
+
"2024-05-03 182.10 184.78 178.4200 181.19 75491539.0 TSLA\n",
|
38 |
"2024-05-02 182.86 184.60 176.0200 180.01 89148041.0 TSLA\n",
|
39 |
"2024-05-01 182.00 185.86 179.0100 179.99 92829719.0 TSLA\n",
|
40 |
"2024-04-30 186.98 190.95 182.8401 183.28 127031787.0 TSLA\n",
|
41 |
+
"2024-04-29 188.42 198.87 184.5400 194.05 243869678.0 TSLA\n"
|
|
|
42 |
]
|
43 |
}
|
44 |
],
|
|
|
67 |
},
|
68 |
{
|
69 |
"cell_type": "code",
|
70 |
+
"execution_count": 3,
|
71 |
"metadata": {},
|
72 |
"outputs": [],
|
73 |
"source": [
|
|
|
125 |
},
|
126 |
{
|
127 |
"cell_type": "code",
|
128 |
+
"execution_count": 4,
|
129 |
"metadata": {},
|
130 |
"outputs": [],
|
131 |
"source": [
|
|
|
198 |
},
|
199 |
{
|
200 |
"cell_type": "code",
|
201 |
+
"execution_count": 5,
|
202 |
"metadata": {},
|
203 |
"outputs": [
|
204 |
{
|
|
|
236 |
"name": "python",
|
237 |
"nbconvert_exporter": "python",
|
238 |
"pygments_lexer": "ipython3",
|
239 |
+
"version": "3.11.4"
|
240 |
},
|
241 |
"orig_nbformat": 4
|
242 |
},
|
news_articles.csv
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
news_articles_ema.csv
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
news_preprocessing.ipynb
CHANGED
@@ -46,6 +46,7 @@
|
|
46 |
" df = df.set_index(\"date\")\n",
|
47 |
" df.reset_index(inplace=True)\n",
|
48 |
" df.index = pd.to_datetime(df.index)\n",
|
|
|
49 |
"\n",
|
50 |
" return df"
|
51 |
]
|
|
|
46 |
" df = df.set_index(\"date\")\n",
|
47 |
" df.reset_index(inplace=True)\n",
|
48 |
" df.index = pd.to_datetime(df.index)\n",
|
49 |
+
" df = df.groupby(['date', 'ticker'])['sentiment'].mean().reset_index()\n",
|
50 |
"\n",
|
51 |
" return df"
|
52 |
]
|
news_preprocessing.py
CHANGED
@@ -33,6 +33,7 @@ def process_news_articles(news_articles):
|
|
33 |
df = df.set_index("date")
|
34 |
df.reset_index(inplace=True)
|
35 |
df.index = pd.to_datetime(df.index)
|
|
|
36 |
|
37 |
return df
|
38 |
|
|
|
33 |
df = df.set_index("date")
|
34 |
df.reset_index(inplace=True)
|
35 |
df.index = pd.to_datetime(df.index)
|
36 |
+
df = df.groupby(['date', 'ticker'])['sentiment'].mean().reset_index(name='sentiment')
|
37 |
|
38 |
return df
|
39 |
|
requirements.txt
CHANGED
@@ -4,7 +4,7 @@ parsedatetime==2.6
|
|
4 |
#plotly==5.9.0
|
5 |
#streamlit_folium==0.17.4
|
6 |
dataframe_image==0.2.3
|
7 |
-
hopsworks
|
8 |
hsml
|
9 |
joblib
|
10 |
matplotlib==3.6.3
|
|
|
4 |
#plotly==5.9.0
|
5 |
#streamlit_folium==0.17.4
|
6 |
dataframe_image==0.2.3
|
7 |
+
hopsworks==3.7.0
|
8 |
hsml
|
9 |
joblib
|
10 |
matplotlib==3.6.3
|
training_pipeline.ipynb
CHANGED
@@ -0,0 +1,245 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "code",
|
5 |
+
"execution_count": 3,
|
6 |
+
"metadata": {},
|
7 |
+
"outputs": [
|
8 |
+
{
|
9 |
+
"data": {
|
10 |
+
"text/plain": [
|
11 |
+
"True"
|
12 |
+
]
|
13 |
+
},
|
14 |
+
"execution_count": 3,
|
15 |
+
"metadata": {},
|
16 |
+
"output_type": "execute_result"
|
17 |
+
}
|
18 |
+
],
|
19 |
+
"source": [
|
20 |
+
"import hopsworks\n",
|
21 |
+
"from dotenv import load_dotenv\n",
|
22 |
+
"import os\n",
|
23 |
+
"\n",
|
24 |
+
"load_dotenv()"
|
25 |
+
]
|
26 |
+
},
|
27 |
+
{
|
28 |
+
"cell_type": "code",
|
29 |
+
"execution_count": null,
|
30 |
+
"metadata": {},
|
31 |
+
"outputs": [],
|
32 |
+
"source": []
|
33 |
+
},
|
34 |
+
{
|
35 |
+
"cell_type": "code",
|
36 |
+
"execution_count": 6,
|
37 |
+
"metadata": {},
|
38 |
+
"outputs": [
|
39 |
+
{
|
40 |
+
"name": "stdout",
|
41 |
+
"output_type": "stream",
|
42 |
+
"text": [
|
43 |
+
"Fetching feature view from hopsworks...\n",
|
44 |
+
"Connection closed.\n",
|
45 |
+
"Connected. Call `.close()` to terminate connection gracefully.\n"
|
46 |
+
]
|
47 |
+
},
|
48 |
+
{
|
49 |
+
"name": "stdout",
|
50 |
+
"output_type": "stream",
|
51 |
+
"text": [
|
52 |
+
"\n",
|
53 |
+
"Logged in to project, explore it here https://c.app.hopsworks.ai:443/p/549016\n",
|
54 |
+
"Connected. Call `.close()` to terminate connection gracefully.\n"
|
55 |
+
]
|
56 |
+
},
|
57 |
+
{
|
58 |
+
"name": "stderr",
|
59 |
+
"output_type": "stream",
|
60 |
+
"text": [
|
61 |
+
"../src/arrow/status.cc:137: DoAction result was not fully consumed: Cancelled: Flight cancelled call, with message: CANCELLED. Detail: Cancelled\n"
|
62 |
+
]
|
63 |
+
},
|
64 |
+
{
|
65 |
+
"name": "stdout",
|
66 |
+
"output_type": "stream",
|
67 |
+
"text": [
|
68 |
+
"2024-05-06 12:27:55,071 WARNING: DeprecationWarning: ssl.PROTOCOL_TLS is deprecated\n",
|
69 |
+
"\n",
|
70 |
+
"Error: Reading data from Hopsworks, using Hive \n"
|
71 |
+
]
|
72 |
+
},
|
73 |
+
{
|
74 |
+
"ename": "DatabaseError",
|
75 |
+
"evalue": "Execution failed on sql: WITH right_fg0 AS (SELECT *\nFROM (SELECT `fg1`.`date` `date`, `fg1`.`open` `open`, `fg1`.`ticker` `ticker`, `fg1`.`ticker` `join_pk_ticker`, `fg1`.`date` `join_evt_date`, `fg0`.`date` `date`, `fg0`.`sentiment` `sentiment`, RANK() OVER (PARTITION BY `fg1`.`ticker`, `fg1`.`date` ORDER BY `fg0`.`date` DESC) pit_rank_hopsworks\nFROM `mtzeve_featurestore`.`tesla_stock_1` `fg1`\nINNER JOIN `mtzeve_featurestore`.`news_sentiment_updated_1` `fg0` ON `fg1`.`ticker` = `fg0`.`ticker` AND `fg1`.`date` >= `fg0`.`date`\nWHERE `fg1`.`date` >= TIMESTAMP '1970-01-01 00:16:40.000' AND `fg1`.`date` < TIMESTAMP '2024-05-06 10:27:51.000') NA\nWHERE `pit_rank_hopsworks` = 1) (SELECT `right_fg0`.`date` `date`, `right_fg0`.`open` `open`, `right_fg0`.`ticker` `ticker`, `right_fg0`.`date` `date`, `right_fg0`.`sentiment` `sentiment`\nFROM right_fg0)\nTExecuteStatementResp(status=TStatus(statusCode=3, infoMessages=['*org.apache.hive.service.cli.HiveSQLException:Error while compiling statement: FAILED: SemanticException [Error 10007]: Ambiguous column reference date in na:28:27', 'org.apache.hive.service.cli.operation.Operation:toSQLException:Operation.java:343', 'org.apache.hive.service.cli.operation.SQLOperation:prepare:SQLOperation.java:203', 'org.apache.hive.service.cli.operation.SQLOperation:runInternal:SQLOperation.java:266', 'org.apache.hive.service.cli.operation.Operation:run:Operation.java:255', 'org.apache.hive.service.cli.session.HiveSessionImpl:executeStatementInternal:HiveSessionImpl.java:541', 'org.apache.hive.service.cli.session.HiveSessionImpl:executeStatement:HiveSessionImpl.java:516', 'sun.reflect.GeneratedMethodAccessor216:invoke::-1', 'sun.reflect.DelegatingMethodAccessorImpl:invoke:DelegatingMethodAccessorImpl.java:43', 'java.lang.reflect.Method:invoke:Method.java:498', 'org.apache.hive.service.cli.session.HiveSessionProxy:invoke:HiveSessionProxy.java:78', 'org.apache.hive.service.cli.session.HiveSessionProxy:access$000:HiveSessionProxy.java:36', 'org.apache.hive.service.cli.session.HiveSessionProxy$1:run:HiveSessionProxy.java:63', 'java.security.AccessController:doPrivileged:AccessController.java:-2', 'javax.security.auth.Subject:doAs:Subject.java:422', 'org.apache.hadoop.security.UserGroupInformation:doAs:UserGroupInformation.java:1821', 'org.apache.hive.service.cli.session.HiveSessionProxy:invoke:HiveSessionProxy.java:59', 'com.sun.proxy.$Proxy53:executeStatement::-1', 'org.apache.hive.service.cli.CLIService:executeStatement:CLIService.java:281', 'org.apache.hive.service.cli.thrift.ThriftCLIService:ExecuteStatement:ThriftCLIService.java:712', 'org.apache.hive.service.rpc.thrift.TCLIService$Processor$ExecuteStatement:getResult:TCLIService.java:1557', 'org.apache.hive.service.rpc.thrift.TCLIService$Processor$ExecuteStatement:getResult:TCLIService.java:1542', 'org.apache.thrift.ProcessFunction:process:ProcessFunction.java:39', 'org.apache.thrift.TBaseProcessor:process:TBaseProcessor.java:39', 'org.apache.hive.service.auth.TSetIpAddressProcessor:process:TSetIpAddressProcessor.java:56', 'org.apache.thrift.server.TThreadPoolServer$WorkerProcess:run:TThreadPoolServer.java:286', 'java.util.concurrent.ThreadPoolExecutor:runWorker:ThreadPoolExecutor.java:1149', 'java.util.concurrent.ThreadPoolExecutor$Worker:run:ThreadPoolExecutor.java:624', 'java.lang.Thread:run:Thread.java:750', '*org.apache.hadoop.hive.ql.parse.SemanticException:Ambiguous column reference date in na:44:17', 'org.apache.hadoop.hive.ql.parse.SemanticAnalyzer:rewriteRRForSubQ:SemanticAnalyzer.java:11359', 'org.apache.hadoop.hive.ql.parse.SemanticAnalyzer:genPlan:SemanticAnalyzer.java:11338', 'org.apache.hadoop.hive.ql.parse.SemanticAnalyzer:genPlan:SemanticAnalyzer.java:11188', 'org.apache.hadoop.hive.ql.parse.SemanticAnalyzer:genPlan:SemanticAnalyzer.java:11215', 'org.apache.hadoop.hive.ql.parse.SemanticAnalyzer:genPlan:SemanticAnalyzer.java:11188', 'org.apache.hadoop.hive.ql.parse.SemanticAnalyzer:genPlan:SemanticAnalyzer.java:11215', 'org.apache.hadoop.hive.ql.parse.SemanticAnalyzer:genPlan:SemanticAnalyzer.java:11201', 'org.apache.hadoop.hive.ql.parse.SemanticAnalyzer:genOPTree:SemanticAnalyzer.java:11987', 'org.apache.hadoop.hive.ql.parse.CalcitePlanner:genOPTree:CalcitePlanner.java:597', 'org.apache.hadoop.hive.ql.parse.SemanticAnalyzer:analyzeInternal:SemanticAnalyzer.java:12066', 'org.apache.hadoop.hive.ql.parse.CalcitePlanner:analyzeInternal:CalcitePlanner.java:334', 'org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer:analyze:BaseSemanticAnalyzer.java:285', 'org.apache.hadoop.hive.ql.Driver:compile:Driver.java:643', 'org.apache.hadoop.hive.ql.Driver:compileInternal:Driver.java:1683', 'org.apache.hadoop.hive.ql.Driver:compileAndRespond:Driver.java:1630', 'org.apache.hadoop.hive.ql.Driver:compileAndRespond:Driver.java:1625', 'org.apache.hadoop.hive.ql.reexec.ReExecDriver:compileAndRespond:ReExecDriver.java:126', 'org.apache.hive.service.cli.operation.SQLOperation:prepare:SQLOperation.java:201'], sqlState='42000', errorCode=10007, errorMessage='Error while compiling statement: FAILED: SemanticException [Error 10007]: Ambiguous column reference date in na'), operationHandle=None)\nunable to rollback",
|
76 |
+
"output_type": "error",
|
77 |
+
"traceback": [
|
78 |
+
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
79 |
+
"\u001b[0;31mOperationalError\u001b[0m Traceback (most recent call last)",
|
80 |
+
"File \u001b[0;32m/Applications/anaconda3/lib/python3.11/site-packages/pandas/io/sql.py:2018\u001b[0m, in \u001b[0;36mSQLiteDatabase.execute\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 2017\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[0;32m-> 2018\u001b[0m cur\u001b[39m.\u001b[39mexecute(\u001b[39m*\u001b[39margs, \u001b[39m*\u001b[39m\u001b[39m*\u001b[39mkwargs)\n\u001b[1;32m 2019\u001b[0m \u001b[39mreturn\u001b[39;00m cur\n",
|
81 |
+
"File \u001b[0;32m/Applications/anaconda3/lib/python3.11/site-packages/pyhive/hive.py:408\u001b[0m, in \u001b[0;36mCursor.execute\u001b[0;34m(self, operation, parameters, **kwargs)\u001b[0m\n\u001b[1;32m 407\u001b[0m response \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_connection\u001b[39m.\u001b[39mclient\u001b[39m.\u001b[39mExecuteStatement(req)\n\u001b[0;32m--> 408\u001b[0m _check_status(response)\n\u001b[1;32m 409\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_operationHandle \u001b[39m=\u001b[39m response\u001b[39m.\u001b[39moperationHandle\n",
|
82 |
+
"File \u001b[0;32m/Applications/anaconda3/lib/python3.11/site-packages/pyhive/hive.py:538\u001b[0m, in \u001b[0;36m_check_status\u001b[0;34m(response)\u001b[0m\n\u001b[1;32m 537\u001b[0m \u001b[39mif\u001b[39;00m response\u001b[39m.\u001b[39mstatus\u001b[39m.\u001b[39mstatusCode \u001b[39m!=\u001b[39m ttypes\u001b[39m.\u001b[39mTStatusCode\u001b[39m.\u001b[39mSUCCESS_STATUS:\n\u001b[0;32m--> 538\u001b[0m \u001b[39mraise\u001b[39;00m OperationalError(response)\n",
|
83 |
+
"\u001b[0;31mOperationalError\u001b[0m: TExecuteStatementResp(status=TStatus(statusCode=3, infoMessages=['*org.apache.hive.service.cli.HiveSQLException:Error while compiling statement: FAILED: SemanticException [Error 10007]: Ambiguous column reference date in na:28:27', 'org.apache.hive.service.cli.operation.Operation:toSQLException:Operation.java:343', 'org.apache.hive.service.cli.operation.SQLOperation:prepare:SQLOperation.java:203', 'org.apache.hive.service.cli.operation.SQLOperation:runInternal:SQLOperation.java:266', 'org.apache.hive.service.cli.operation.Operation:run:Operation.java:255', 'org.apache.hive.service.cli.session.HiveSessionImpl:executeStatementInternal:HiveSessionImpl.java:541', 'org.apache.hive.service.cli.session.HiveSessionImpl:executeStatement:HiveSessionImpl.java:516', 'sun.reflect.GeneratedMethodAccessor216:invoke::-1', 'sun.reflect.DelegatingMethodAccessorImpl:invoke:DelegatingMethodAccessorImpl.java:43', 'java.lang.reflect.Method:invoke:Method.java:498', 'org.apache.hive.service.cli.session.HiveSessionProxy:invoke:HiveSessionProxy.java:78', 'org.apache.hive.service.cli.session.HiveSessionProxy:access$000:HiveSessionProxy.java:36', 'org.apache.hive.service.cli.session.HiveSessionProxy$1:run:HiveSessionProxy.java:63', 'java.security.AccessController:doPrivileged:AccessController.java:-2', 'javax.security.auth.Subject:doAs:Subject.java:422', 'org.apache.hadoop.security.UserGroupInformation:doAs:UserGroupInformation.java:1821', 'org.apache.hive.service.cli.session.HiveSessionProxy:invoke:HiveSessionProxy.java:59', 'com.sun.proxy.$Proxy53:executeStatement::-1', 'org.apache.hive.service.cli.CLIService:executeStatement:CLIService.java:281', 'org.apache.hive.service.cli.thrift.ThriftCLIService:ExecuteStatement:ThriftCLIService.java:712', 'org.apache.hive.service.rpc.thrift.TCLIService$Processor$ExecuteStatement:getResult:TCLIService.java:1557', 'org.apache.hive.service.rpc.thrift.TCLIService$Processor$ExecuteStatement:getResult:TCLIService.java:1542', 'org.apache.thrift.ProcessFunction:process:ProcessFunction.java:39', 'org.apache.thrift.TBaseProcessor:process:TBaseProcessor.java:39', 'org.apache.hive.service.auth.TSetIpAddressProcessor:process:TSetIpAddressProcessor.java:56', 'org.apache.thrift.server.TThreadPoolServer$WorkerProcess:run:TThreadPoolServer.java:286', 'java.util.concurrent.ThreadPoolExecutor:runWorker:ThreadPoolExecutor.java:1149', 'java.util.concurrent.ThreadPoolExecutor$Worker:run:ThreadPoolExecutor.java:624', 'java.lang.Thread:run:Thread.java:750', '*org.apache.hadoop.hive.ql.parse.SemanticException:Ambiguous column reference date in na:44:17', 'org.apache.hadoop.hive.ql.parse.SemanticAnalyzer:rewriteRRForSubQ:SemanticAnalyzer.java:11359', 'org.apache.hadoop.hive.ql.parse.SemanticAnalyzer:genPlan:SemanticAnalyzer.java:11338', 'org.apache.hadoop.hive.ql.parse.SemanticAnalyzer:genPlan:SemanticAnalyzer.java:11188', 'org.apache.hadoop.hive.ql.parse.SemanticAnalyzer:genPlan:SemanticAnalyzer.java:11215', 'org.apache.hadoop.hive.ql.parse.SemanticAnalyzer:genPlan:SemanticAnalyzer.java:11188', 'org.apache.hadoop.hive.ql.parse.SemanticAnalyzer:genPlan:SemanticAnalyzer.java:11215', 'org.apache.hadoop.hive.ql.parse.SemanticAnalyzer:genPlan:SemanticAnalyzer.java:11201', 'org.apache.hadoop.hive.ql.parse.SemanticAnalyzer:genOPTree:SemanticAnalyzer.java:11987', 'org.apache.hadoop.hive.ql.parse.CalcitePlanner:genOPTree:CalcitePlanner.java:597', 'org.apache.hadoop.hive.ql.parse.SemanticAnalyzer:analyzeInternal:SemanticAnalyzer.java:12066', 'org.apache.hadoop.hive.ql.parse.CalcitePlanner:analyzeInternal:CalcitePlanner.java:334', 'org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer:analyze:BaseSemanticAnalyzer.java:285', 'org.apache.hadoop.hive.ql.Driver:compile:Driver.java:643', 'org.apache.hadoop.hive.ql.Driver:compileInternal:Driver.java:1683', 'org.apache.hadoop.hive.ql.Driver:compileAndRespond:Driver.java:1630', 'org.apache.hadoop.hive.ql.Driver:compileAndRespond:Driver.java:1625', 'org.apache.hadoop.hive.ql.reexec.ReExecDriver:compileAndRespond:ReExecDriver.java:126', 'org.apache.hive.service.cli.operation.SQLOperation:prepare:SQLOperation.java:201'], sqlState='42000', errorCode=10007, errorMessage='Error while compiling statement: FAILED: SemanticException [Error 10007]: Ambiguous column reference date in na'), operationHandle=None)",
|
84 |
+
"\nDuring handling of the above exception, another exception occurred:\n",
|
85 |
+
"\u001b[0;31mNotSupportedError\u001b[0m Traceback (most recent call last)",
|
86 |
+
"File \u001b[0;32m/Applications/anaconda3/lib/python3.11/site-packages/pandas/io/sql.py:2022\u001b[0m, in \u001b[0;36mSQLiteDatabase.execute\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 2021\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[0;32m-> 2022\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mcon\u001b[39m.\u001b[39mrollback()\n\u001b[1;32m 2023\u001b[0m \u001b[39mexcept\u001b[39;00m \u001b[39mException\u001b[39;00m \u001b[39mas\u001b[39;00m inner_exc: \u001b[39m# pragma: no cover\u001b[39;00m\n",
|
87 |
+
"File \u001b[0;32m/Applications/anaconda3/lib/python3.11/site-packages/pyhive/hive.py:285\u001b[0m, in \u001b[0;36mConnection.rollback\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 284\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39mrollback\u001b[39m(\u001b[39mself\u001b[39m):\n\u001b[0;32m--> 285\u001b[0m \u001b[39mraise\u001b[39;00m NotSupportedError(\u001b[39m\"\u001b[39m\u001b[39mHive does not have transactions\u001b[39m\u001b[39m\"\u001b[39m)\n",
|
88 |
+
"\u001b[0;31mNotSupportedError\u001b[0m: Hive does not have transactions",
|
89 |
+
"\nThe above exception was the direct cause of the following exception:\n",
|
90 |
+
"\u001b[0;31mDatabaseError\u001b[0m Traceback (most recent call last)",
|
91 |
+
"\u001b[1;32m/Users/manos/Documents/BDS/Mlops_2version/MLops_mod/training_pipeline.ipynb Cell 3\u001b[0m line \u001b[0;36m1\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/manos/Documents/BDS/Mlops_2version/MLops_mod/training_pipeline.ipynb#W4sZmlsZQ%3D%3D?line=6'>7</a>\u001b[0m fv \u001b[39m=\u001b[39m fs\u001b[39m.\u001b[39mget_feature_view(\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/manos/Documents/BDS/Mlops_2version/MLops_mod/training_pipeline.ipynb#W4sZmlsZQ%3D%3D?line=7'>8</a>\u001b[0m name \u001b[39m=\u001b[39m \u001b[39m'\u001b[39m\u001b[39mtesla_stocks_fv\u001b[39m\u001b[39m'\u001b[39m,\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/manos/Documents/BDS/Mlops_2version/MLops_mod/training_pipeline.ipynb#W4sZmlsZQ%3D%3D?line=8'>9</a>\u001b[0m version \u001b[39m=\u001b[39m \u001b[39m1\u001b[39m\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/manos/Documents/BDS/Mlops_2version/MLops_mod/training_pipeline.ipynb#W4sZmlsZQ%3D%3D?line=9'>10</a>\u001b[0m )\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/manos/Documents/BDS/Mlops_2version/MLops_mod/training_pipeline.ipynb#W4sZmlsZQ%3D%3D?line=10'>11</a>\u001b[0m \u001b[39m# Get dataframe of training data from feature view\u001b[39;00m\n\u001b[0;32m---> <a href='vscode-notebook-cell:/Users/manos/Documents/BDS/Mlops_2version/MLops_mod/training_pipeline.ipynb#W4sZmlsZQ%3D%3D?line=11'>12</a>\u001b[0m df, _ \u001b[39m=\u001b[39m fv\u001b[39m.\u001b[39mtraining_data(read_options\u001b[39m=\u001b[39m{\u001b[39m\"\u001b[39m\u001b[39muse_hive\u001b[39m\u001b[39m\"\u001b[39m: \u001b[39mTrue\u001b[39;00m})\n",
|
92 |
+
"File \u001b[0;32m/Applications/anaconda3/lib/python3.11/site-packages/hsfs/usage.py:212\u001b[0m, in \u001b[0;36mmethod_logger.<locals>.wrapper\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 210\u001b[0m \u001b[39mexcept\u001b[39;00m \u001b[39mException\u001b[39;00m \u001b[39mas\u001b[39;00m e:\n\u001b[1;32m 211\u001b[0m exception \u001b[39m=\u001b[39m e\n\u001b[0;32m--> 212\u001b[0m \u001b[39mraise\u001b[39;00m e\n\u001b[1;32m 213\u001b[0m \u001b[39mfinally\u001b[39;00m:\n\u001b[1;32m 214\u001b[0m \u001b[39mtry\u001b[39;00m:\n",
|
93 |
+
"File \u001b[0;32m/Applications/anaconda3/lib/python3.11/site-packages/hsfs/usage.py:208\u001b[0m, in \u001b[0;36mmethod_logger.<locals>.wrapper\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 205\u001b[0m exception \u001b[39m=\u001b[39m \u001b[39mNone\u001b[39;00m\n\u001b[1;32m 206\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[1;32m 207\u001b[0m \u001b[39m# Call the original method\u001b[39;00m\n\u001b[0;32m--> 208\u001b[0m result \u001b[39m=\u001b[39m func(\u001b[39m*\u001b[39margs, \u001b[39m*\u001b[39m\u001b[39m*\u001b[39mkwargs)\n\u001b[1;32m 209\u001b[0m \u001b[39mreturn\u001b[39;00m result\n\u001b[1;32m 210\u001b[0m \u001b[39mexcept\u001b[39;00m \u001b[39mException\u001b[39;00m \u001b[39mas\u001b[39;00m e:\n",
|
94 |
+
"File \u001b[0;32m/Applications/anaconda3/lib/python3.11/site-packages/hsfs/feature_view.py:2222\u001b[0m, in \u001b[0;36mFeatureView.training_data\u001b[0;34m(self, start_time, end_time, description, extra_filter, statistics_config, read_options, spine, primary_keys, event_time, training_helper_columns)\u001b[0m\n\u001b[1;32m 2109\u001b[0m \u001b[39m\u001b[39m\u001b[39m\"\"\"\u001b[39;00m\n\u001b[1;32m 2110\u001b[0m \u001b[39mCreate the metadata for a training dataset and get the corresponding training data from the offline feature store.\u001b[39;00m\n\u001b[1;32m 2111\u001b[0m \u001b[39mThis returns the training data in memory and does not materialise data in storage.\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 2205\u001b[0m \u001b[39m (X, y): Tuple of dataframe of features and labels. If there are no labels, y returns `None`.\u001b[39;00m\n\u001b[1;32m 2206\u001b[0m \u001b[39m\"\"\"\u001b[39;00m\n\u001b[1;32m 2207\u001b[0m td \u001b[39m=\u001b[39m training_dataset\u001b[39m.\u001b[39mTrainingDataset(\n\u001b[1;32m 2208\u001b[0m name\u001b[39m=\u001b[39m\u001b[39mself\u001b[39m\u001b[39m.\u001b[39mname,\n\u001b[1;32m 2209\u001b[0m version\u001b[39m=\u001b[39m\u001b[39mNone\u001b[39;00m,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 2220\u001b[0m extra_filter\u001b[39m=\u001b[39mextra_filter,\n\u001b[1;32m 2221\u001b[0m )\n\u001b[0;32m-> 2222\u001b[0m td, df \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_feature_view_engine\u001b[39m.\u001b[39mget_training_data(\n\u001b[1;32m 2223\u001b[0m \u001b[39mself\u001b[39m,\n\u001b[1;32m 2224\u001b[0m read_options,\n\u001b[1;32m 2225\u001b[0m training_dataset_obj\u001b[39m=\u001b[39mtd,\n\u001b[1;32m 2226\u001b[0m spine\u001b[39m=\u001b[39mspine,\n\u001b[1;32m 2227\u001b[0m primary_keys\u001b[39m=\u001b[39mprimary_keys,\n\u001b[1;32m 2228\u001b[0m event_time\u001b[39m=\u001b[39mevent_time,\n\u001b[1;32m 2229\u001b[0m training_helper_columns\u001b[39m=\u001b[39mtraining_helper_columns,\n\u001b[1;32m 2230\u001b[0m )\n\u001b[1;32m 2231\u001b[0m warnings\u001b[39m.\u001b[39mwarn(\n\u001b[1;32m 2232\u001b[0m \u001b[39m\"\u001b[39m\u001b[39mIncremented version to `\u001b[39m\u001b[39m{}\u001b[39;00m\u001b[39m`.\u001b[39m\u001b[39m\"\u001b[39m\u001b[39m.\u001b[39mformat(td\u001b[39m.\u001b[39mversion),\n\u001b[1;32m 2233\u001b[0m util\u001b[39m.\u001b[39mVersionWarning,\n\u001b[1;32m 2234\u001b[0m )\n\u001b[1;32m 2235\u001b[0m \u001b[39mreturn\u001b[39;00m df\n",
|
95 |
+
"File \u001b[0;32m/Applications/anaconda3/lib/python3.11/site-packages/hsfs/core/feature_view_engine.py:346\u001b[0m, in \u001b[0;36mFeatureViewEngine.get_training_data\u001b[0;34m(self, feature_view_obj, read_options, splits, training_dataset_obj, training_dataset_version, spine, primary_keys, event_time, training_helper_columns)\u001b[0m\n\u001b[1;32m 333\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_check_feature_group_accessibility(feature_view_obj)\n\u001b[1;32m 334\u001b[0m query \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mget_batch_query(\n\u001b[1;32m 335\u001b[0m feature_view_obj,\n\u001b[1;32m 336\u001b[0m training_dataset_version\u001b[39m=\u001b[39mtd_updated\u001b[39m.\u001b[39mversion,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 344\u001b[0m spine\u001b[39m=\u001b[39mspine,\n\u001b[1;32m 345\u001b[0m )\n\u001b[0;32m--> 346\u001b[0m split_df \u001b[39m=\u001b[39m engine\u001b[39m.\u001b[39mget_instance()\u001b[39m.\u001b[39mget_training_data(\n\u001b[1;32m 347\u001b[0m td_updated, feature_view_obj, query, read_options\n\u001b[1;32m 348\u001b[0m )\n\u001b[1;32m 349\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mcompute_training_dataset_statistics(\n\u001b[1;32m 350\u001b[0m feature_view_obj, td_updated, split_df\n\u001b[1;32m 351\u001b[0m )\n\u001b[1;32m 353\u001b[0m \u001b[39m# split df into features and labels df\u001b[39;00m\n",
|
96 |
+
"File \u001b[0;32m/Applications/anaconda3/lib/python3.11/site-packages/hsfs/engine/python.py:648\u001b[0m, in \u001b[0;36mEngine.get_training_data\u001b[0;34m(self, training_dataset_obj, feature_view_obj, query_obj, read_options)\u001b[0m\n\u001b[1;32m 644\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_prepare_transform_split_df(\n\u001b[1;32m 645\u001b[0m query_obj, training_dataset_obj, feature_view_obj, read_options\n\u001b[1;32m 646\u001b[0m )\n\u001b[1;32m 647\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[0;32m--> 648\u001b[0m df \u001b[39m=\u001b[39m query_obj\u001b[39m.\u001b[39mread(read_options\u001b[39m=\u001b[39mread_options)\n\u001b[1;32m 649\u001b[0m transformation_function_engine\u001b[39m.\u001b[39mTransformationFunctionEngine\u001b[39m.\u001b[39mpopulate_builtin_transformation_functions(\n\u001b[1;32m 650\u001b[0m training_dataset_obj, feature_view_obj, df\n\u001b[1;32m 651\u001b[0m )\n\u001b[1;32m 652\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_apply_transformation_function(\n\u001b[1;32m 653\u001b[0m training_dataset_obj\u001b[39m.\u001b[39mtransformation_functions, df\n\u001b[1;32m 654\u001b[0m )\n",
|
97 |
+
"File \u001b[0;32m/Applications/anaconda3/lib/python3.11/site-packages/hsfs/constructor/query.py:173\u001b[0m, in \u001b[0;36mQuery.read\u001b[0;34m(self, online, dataframe_type, read_options)\u001b[0m\n\u001b[1;32m 168\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mlen\u001b[39m(\u001b[39mself\u001b[39m\u001b[39m.\u001b[39mjoins) \u001b[39m>\u001b[39m \u001b[39m0\u001b[39m \u001b[39mor\u001b[39;00m \u001b[39mNone\u001b[39;00m \u001b[39min\u001b[39;00m [f\u001b[39m.\u001b[39mtype \u001b[39mfor\u001b[39;00m f \u001b[39min\u001b[39;00m schema]:\n\u001b[1;32m 169\u001b[0m \u001b[39mraise\u001b[39;00m \u001b[39mValueError\u001b[39;00m(\n\u001b[1;32m 170\u001b[0m \u001b[39m\"\u001b[39m\u001b[39mPandas types casting only supported for feature_group.read()/query.select_all()\u001b[39m\u001b[39m\"\u001b[39m\n\u001b[1;32m 171\u001b[0m )\n\u001b[0;32m--> 173\u001b[0m \u001b[39mreturn\u001b[39;00m engine\u001b[39m.\u001b[39mget_instance()\u001b[39m.\u001b[39msql(\n\u001b[1;32m 174\u001b[0m sql_query,\n\u001b[1;32m 175\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_feature_store_name,\n\u001b[1;32m 176\u001b[0m online_conn,\n\u001b[1;32m 177\u001b[0m dataframe_type,\n\u001b[1;32m 178\u001b[0m read_options,\n\u001b[1;32m 179\u001b[0m schema,\n\u001b[1;32m 180\u001b[0m )\n",
|
98 |
+
"File \u001b[0;32m/Applications/anaconda3/lib/python3.11/site-packages/hsfs/engine/python.py:139\u001b[0m, in \u001b[0;36mEngine.sql\u001b[0;34m(self, sql_query, feature_store, online_conn, dataframe_type, read_options, schema)\u001b[0m\n\u001b[1;32m 129\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39msql\u001b[39m(\n\u001b[1;32m 130\u001b[0m \u001b[39mself\u001b[39m,\n\u001b[1;32m 131\u001b[0m sql_query,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 136\u001b[0m schema\u001b[39m=\u001b[39m\u001b[39mNone\u001b[39;00m,\n\u001b[1;32m 137\u001b[0m ):\n\u001b[1;32m 138\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mnot\u001b[39;00m online_conn:\n\u001b[0;32m--> 139\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_sql_offline(\n\u001b[1;32m 140\u001b[0m sql_query,\n\u001b[1;32m 141\u001b[0m feature_store,\n\u001b[1;32m 142\u001b[0m dataframe_type,\n\u001b[1;32m 143\u001b[0m schema,\n\u001b[1;32m 144\u001b[0m hive_config\u001b[39m=\u001b[39mread_options\u001b[39m.\u001b[39mget(\u001b[39m\"\u001b[39m\u001b[39mhive_config\u001b[39m\u001b[39m\"\u001b[39m) \u001b[39mif\u001b[39;00m read_options \u001b[39melse\u001b[39;00m \u001b[39mNone\u001b[39;00m,\n\u001b[1;32m 145\u001b[0m arrow_flight_config\u001b[39m=\u001b[39mread_options\u001b[39m.\u001b[39mget(\u001b[39m\"\u001b[39m\u001b[39marrow_flight_config\u001b[39m\u001b[39m\"\u001b[39m, {})\n\u001b[1;32m 146\u001b[0m \u001b[39mif\u001b[39;00m read_options\n\u001b[1;32m 147\u001b[0m \u001b[39melse\u001b[39;00m {},\n\u001b[1;32m 148\u001b[0m )\n\u001b[1;32m 149\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[1;32m 150\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_jdbc(\n\u001b[1;32m 151\u001b[0m sql_query, online_conn, dataframe_type, read_options, schema\n\u001b[1;32m 152\u001b[0m )\n",
|
99 |
+
"File \u001b[0;32m/Applications/anaconda3/lib/python3.11/site-packages/hsfs/engine/python.py:180\u001b[0m, in \u001b[0;36mEngine._sql_offline\u001b[0;34m(self, sql_query, feature_store, dataframe_type, schema, hive_config, arrow_flight_config)\u001b[0m\n\u001b[1;32m 178\u001b[0m \u001b[39mwith\u001b[39;00m warnings\u001b[39m.\u001b[39mcatch_warnings():\n\u001b[1;32m 179\u001b[0m warnings\u001b[39m.\u001b[39msimplefilter(\u001b[39m\"\u001b[39m\u001b[39mignore\u001b[39m\u001b[39m\"\u001b[39m, \u001b[39mUserWarning\u001b[39;00m)\n\u001b[0;32m--> 180\u001b[0m result_df \u001b[39m=\u001b[39m util\u001b[39m.\u001b[39mrun_with_loading_animation(\n\u001b[1;32m 181\u001b[0m \u001b[39m\"\u001b[39m\u001b[39mReading data from Hopsworks, using Hive\u001b[39m\u001b[39m\"\u001b[39m,\n\u001b[1;32m 182\u001b[0m pd\u001b[39m.\u001b[39mread_sql,\n\u001b[1;32m 183\u001b[0m sql_query,\n\u001b[1;32m 184\u001b[0m hive_conn,\n\u001b[1;32m 185\u001b[0m )\n\u001b[1;32m 187\u001b[0m \u001b[39mif\u001b[39;00m schema:\n\u001b[1;32m 188\u001b[0m result_df \u001b[39m=\u001b[39m Engine\u001b[39m.\u001b[39mcast_columns(result_df, schema)\n",
|
100 |
+
"File \u001b[0;32m/Applications/anaconda3/lib/python3.11/site-packages/hsfs/util.py:427\u001b[0m, in \u001b[0;36mrun_with_loading_animation\u001b[0;34m(message, func, *args, **kwargs)\u001b[0m\n\u001b[1;32m 424\u001b[0m end \u001b[39m=\u001b[39m \u001b[39mNone\u001b[39;00m\n\u001b[1;32m 426\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[0;32m--> 427\u001b[0m result \u001b[39m=\u001b[39m func(\u001b[39m*\u001b[39margs, \u001b[39m*\u001b[39m\u001b[39m*\u001b[39mkwargs)\n\u001b[1;32m 428\u001b[0m end \u001b[39m=\u001b[39m time\u001b[39m.\u001b[39mtime()\n\u001b[1;32m 429\u001b[0m \u001b[39mreturn\u001b[39;00m result\n",
|
101 |
+
"File \u001b[0;32m/Applications/anaconda3/lib/python3.11/site-packages/pandas/io/sql.py:564\u001b[0m, in \u001b[0;36mread_sql\u001b[0;34m(sql, con, index_col, coerce_float, params, parse_dates, columns, chunksize)\u001b[0m\n\u001b[1;32m 561\u001b[0m pandas_sql \u001b[39m=\u001b[39m pandasSQL_builder(con)\n\u001b[1;32m 563\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39misinstance\u001b[39m(pandas_sql, SQLiteDatabase):\n\u001b[0;32m--> 564\u001b[0m \u001b[39mreturn\u001b[39;00m pandas_sql\u001b[39m.\u001b[39mread_query(\n\u001b[1;32m 565\u001b[0m sql,\n\u001b[1;32m 566\u001b[0m index_col\u001b[39m=\u001b[39mindex_col,\n\u001b[1;32m 567\u001b[0m params\u001b[39m=\u001b[39mparams,\n\u001b[1;32m 568\u001b[0m coerce_float\u001b[39m=\u001b[39mcoerce_float,\n\u001b[1;32m 569\u001b[0m parse_dates\u001b[39m=\u001b[39mparse_dates,\n\u001b[1;32m 570\u001b[0m chunksize\u001b[39m=\u001b[39mchunksize,\n\u001b[1;32m 571\u001b[0m )\n\u001b[1;32m 573\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[1;32m 574\u001b[0m _is_table_name \u001b[39m=\u001b[39m pandas_sql\u001b[39m.\u001b[39mhas_table(sql)\n",
|
102 |
+
"File \u001b[0;32m/Applications/anaconda3/lib/python3.11/site-packages/pandas/io/sql.py:2078\u001b[0m, in \u001b[0;36mSQLiteDatabase.read_query\u001b[0;34m(self, sql, index_col, coerce_float, params, parse_dates, chunksize, dtype)\u001b[0m\n\u001b[1;32m 2066\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39mread_query\u001b[39m(\n\u001b[1;32m 2067\u001b[0m \u001b[39mself\u001b[39m,\n\u001b[1;32m 2068\u001b[0m sql,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 2074\u001b[0m dtype: DtypeArg \u001b[39m|\u001b[39m \u001b[39mNone\u001b[39;00m \u001b[39m=\u001b[39m \u001b[39mNone\u001b[39;00m,\n\u001b[1;32m 2075\u001b[0m ) \u001b[39m-\u001b[39m\u001b[39m>\u001b[39m DataFrame \u001b[39m|\u001b[39m Iterator[DataFrame]:\n\u001b[1;32m 2077\u001b[0m args \u001b[39m=\u001b[39m _convert_params(sql, params)\n\u001b[0;32m-> 2078\u001b[0m cursor \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mexecute(\u001b[39m*\u001b[39margs)\n\u001b[1;32m 2079\u001b[0m columns \u001b[39m=\u001b[39m [col_desc[\u001b[39m0\u001b[39m] \u001b[39mfor\u001b[39;00m col_desc \u001b[39min\u001b[39;00m cursor\u001b[39m.\u001b[39mdescription]\n\u001b[1;32m 2081\u001b[0m \u001b[39mif\u001b[39;00m chunksize \u001b[39mis\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mNone\u001b[39;00m:\n",
|
103 |
+
"File \u001b[0;32m/Applications/anaconda3/lib/python3.11/site-packages/pandas/io/sql.py:2027\u001b[0m, in \u001b[0;36mSQLiteDatabase.execute\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 2023\u001b[0m \u001b[39mexcept\u001b[39;00m \u001b[39mException\u001b[39;00m \u001b[39mas\u001b[39;00m inner_exc: \u001b[39m# pragma: no cover\u001b[39;00m\n\u001b[1;32m 2024\u001b[0m ex \u001b[39m=\u001b[39m DatabaseError(\n\u001b[1;32m 2025\u001b[0m \u001b[39mf\u001b[39m\u001b[39m\"\u001b[39m\u001b[39mExecution failed on sql: \u001b[39m\u001b[39m{\u001b[39;00margs[\u001b[39m0\u001b[39m]\u001b[39m}\u001b[39;00m\u001b[39m\\n\u001b[39;00m\u001b[39m{\u001b[39;00mexc\u001b[39m}\u001b[39;00m\u001b[39m\\n\u001b[39;00m\u001b[39munable to rollback\u001b[39m\u001b[39m\"\u001b[39m\n\u001b[1;32m 2026\u001b[0m )\n\u001b[0;32m-> 2027\u001b[0m \u001b[39mraise\u001b[39;00m ex \u001b[39mfrom\u001b[39;00m \u001b[39minner_exc\u001b[39;00m\n\u001b[1;32m 2029\u001b[0m ex \u001b[39m=\u001b[39m DatabaseError(\u001b[39mf\u001b[39m\u001b[39m\"\u001b[39m\u001b[39mExecution failed on sql \u001b[39m\u001b[39m'\u001b[39m\u001b[39m{\u001b[39;00margs[\u001b[39m0\u001b[39m]\u001b[39m}\u001b[39;00m\u001b[39m'\u001b[39m\u001b[39m: \u001b[39m\u001b[39m{\u001b[39;00mexc\u001b[39m}\u001b[39;00m\u001b[39m\"\u001b[39m)\n\u001b[1;32m 2030\u001b[0m \u001b[39mraise\u001b[39;00m ex \u001b[39mfrom\u001b[39;00m \u001b[39mexc\u001b[39;00m\n",
|
104 |
+
"\u001b[0;31mDatabaseError\u001b[0m: Execution failed on sql: WITH right_fg0 AS (SELECT *\nFROM (SELECT `fg1`.`date` `date`, `fg1`.`open` `open`, `fg1`.`ticker` `ticker`, `fg1`.`ticker` `join_pk_ticker`, `fg1`.`date` `join_evt_date`, `fg0`.`date` `date`, `fg0`.`sentiment` `sentiment`, RANK() OVER (PARTITION BY `fg1`.`ticker`, `fg1`.`date` ORDER BY `fg0`.`date` DESC) pit_rank_hopsworks\nFROM `mtzeve_featurestore`.`tesla_stock_1` `fg1`\nINNER JOIN `mtzeve_featurestore`.`news_sentiment_updated_1` `fg0` ON `fg1`.`ticker` = `fg0`.`ticker` AND `fg1`.`date` >= `fg0`.`date`\nWHERE `fg1`.`date` >= TIMESTAMP '1970-01-01 00:16:40.000' AND `fg1`.`date` < TIMESTAMP '2024-05-06 10:27:51.000') NA\nWHERE `pit_rank_hopsworks` = 1) (SELECT `right_fg0`.`date` `date`, `right_fg0`.`open` `open`, `right_fg0`.`ticker` `ticker`, `right_fg0`.`date` `date`, `right_fg0`.`sentiment` `sentiment`\nFROM right_fg0)\nTExecuteStatementResp(status=TStatus(statusCode=3, infoMessages=['*org.apache.hive.service.cli.HiveSQLException:Error while compiling statement: FAILED: SemanticException [Error 10007]: Ambiguous column reference date in na:28:27', 'org.apache.hive.service.cli.operation.Operation:toSQLException:Operation.java:343', 'org.apache.hive.service.cli.operation.SQLOperation:prepare:SQLOperation.java:203', 'org.apache.hive.service.cli.operation.SQLOperation:runInternal:SQLOperation.java:266', 'org.apache.hive.service.cli.operation.Operation:run:Operation.java:255', 'org.apache.hive.service.cli.session.HiveSessionImpl:executeStatementInternal:HiveSessionImpl.java:541', 'org.apache.hive.service.cli.session.HiveSessionImpl:executeStatement:HiveSessionImpl.java:516', 'sun.reflect.GeneratedMethodAccessor216:invoke::-1', 'sun.reflect.DelegatingMethodAccessorImpl:invoke:DelegatingMethodAccessorImpl.java:43', 'java.lang.reflect.Method:invoke:Method.java:498', 'org.apache.hive.service.cli.session.HiveSessionProxy:invoke:HiveSessionProxy.java:78', 'org.apache.hive.service.cli.session.HiveSessionProxy:access$000:HiveSessionProxy.java:36', 'org.apache.hive.service.cli.session.HiveSessionProxy$1:run:HiveSessionProxy.java:63', 'java.security.AccessController:doPrivileged:AccessController.java:-2', 'javax.security.auth.Subject:doAs:Subject.java:422', 'org.apache.hadoop.security.UserGroupInformation:doAs:UserGroupInformation.java:1821', 'org.apache.hive.service.cli.session.HiveSessionProxy:invoke:HiveSessionProxy.java:59', 'com.sun.proxy.$Proxy53:executeStatement::-1', 'org.apache.hive.service.cli.CLIService:executeStatement:CLIService.java:281', 'org.apache.hive.service.cli.thrift.ThriftCLIService:ExecuteStatement:ThriftCLIService.java:712', 'org.apache.hive.service.rpc.thrift.TCLIService$Processor$ExecuteStatement:getResult:TCLIService.java:1557', 'org.apache.hive.service.rpc.thrift.TCLIService$Processor$ExecuteStatement:getResult:TCLIService.java:1542', 'org.apache.thrift.ProcessFunction:process:ProcessFunction.java:39', 'org.apache.thrift.TBaseProcessor:process:TBaseProcessor.java:39', 'org.apache.hive.service.auth.TSetIpAddressProcessor:process:TSetIpAddressProcessor.java:56', 'org.apache.thrift.server.TThreadPoolServer$WorkerProcess:run:TThreadPoolServer.java:286', 'java.util.concurrent.ThreadPoolExecutor:runWorker:ThreadPoolExecutor.java:1149', 'java.util.concurrent.ThreadPoolExecutor$Worker:run:ThreadPoolExecutor.java:624', 'java.lang.Thread:run:Thread.java:750', '*org.apache.hadoop.hive.ql.parse.SemanticException:Ambiguous column reference date in na:44:17', 'org.apache.hadoop.hive.ql.parse.SemanticAnalyzer:rewriteRRForSubQ:SemanticAnalyzer.java:11359', 'org.apache.hadoop.hive.ql.parse.SemanticAnalyzer:genPlan:SemanticAnalyzer.java:11338', 'org.apache.hadoop.hive.ql.parse.SemanticAnalyzer:genPlan:SemanticAnalyzer.java:11188', 'org.apache.hadoop.hive.ql.parse.SemanticAnalyzer:genPlan:SemanticAnalyzer.java:11215', 'org.apache.hadoop.hive.ql.parse.SemanticAnalyzer:genPlan:SemanticAnalyzer.java:11188', 'org.apache.hadoop.hive.ql.parse.SemanticAnalyzer:genPlan:SemanticAnalyzer.java:11215', 'org.apache.hadoop.hive.ql.parse.SemanticAnalyzer:genPlan:SemanticAnalyzer.java:11201', 'org.apache.hadoop.hive.ql.parse.SemanticAnalyzer:genOPTree:SemanticAnalyzer.java:11987', 'org.apache.hadoop.hive.ql.parse.CalcitePlanner:genOPTree:CalcitePlanner.java:597', 'org.apache.hadoop.hive.ql.parse.SemanticAnalyzer:analyzeInternal:SemanticAnalyzer.java:12066', 'org.apache.hadoop.hive.ql.parse.CalcitePlanner:analyzeInternal:CalcitePlanner.java:334', 'org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer:analyze:BaseSemanticAnalyzer.java:285', 'org.apache.hadoop.hive.ql.Driver:compile:Driver.java:643', 'org.apache.hadoop.hive.ql.Driver:compileInternal:Driver.java:1683', 'org.apache.hadoop.hive.ql.Driver:compileAndRespond:Driver.java:1630', 'org.apache.hadoop.hive.ql.Driver:compileAndRespond:Driver.java:1625', 'org.apache.hadoop.hive.ql.reexec.ReExecDriver:compileAndRespond:ReExecDriver.java:126', 'org.apache.hive.service.cli.operation.SQLOperation:prepare:SQLOperation.java:201'], sqlState='42000', errorCode=10007, errorMessage='Error while compiling statement: FAILED: SemanticException [Error 10007]: Ambiguous column reference date in na'), operationHandle=None)\nunable to rollback"
|
105 |
+
]
|
106 |
+
}
|
107 |
+
],
|
108 |
+
"source": [
|
109 |
+
"print('Fetching feature view from hopsworks...')\n",
|
110 |
+
"api_key = os.environ.get('hopsworks_api')\n",
|
111 |
+
"project = hopsworks.login(api_key_value=api_key)\n",
|
112 |
+
"fs = project.get_feature_store()\n",
|
113 |
+
"\n",
|
114 |
+
"# Get feature view \n",
|
115 |
+
"fv = fs.get_feature_view(\n",
|
116 |
+
" name = 'tesla_stocks_fv',\n",
|
117 |
+
" version = 1\n",
|
118 |
+
")\n",
|
119 |
+
"# Get dataframe of training data from feature view\n",
|
120 |
+
"df, _ = fv.training_data(read_options={\"use_hive\": True})"
|
121 |
+
]
|
122 |
+
},
|
123 |
+
{
|
124 |
+
"cell_type": "code",
|
125 |
+
"execution_count": 1,
|
126 |
+
"metadata": {},
|
127 |
+
"outputs": [
|
128 |
+
{
|
129 |
+
"ename": "ExternalClientError",
|
130 |
+
"evalue": "host cannot be of type NoneType, host is a non-optional argument to connect to hopsworks from an external environment.",
|
131 |
+
"output_type": "error",
|
132 |
+
"traceback": [
|
133 |
+
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
134 |
+
"\u001b[0;31mExternalClientError\u001b[0m Traceback (most recent call last)",
|
135 |
+
"\u001b[1;32m/Users/manos/Documents/BDS/Mlops_2version/MLops_mod/training_pipeline.ipynb Cell 2\u001b[0m line \u001b[0;36m7\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/manos/Documents/BDS/Mlops_2version/MLops_mod/training_pipeline.ipynb#W3sZmlsZQ%3D%3D?line=2'>3</a>\u001b[0m \u001b[39mfrom\u001b[39;00m \u001b[39mdotenv\u001b[39;00m \u001b[39mimport\u001b[39;00m load_dotenv\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/manos/Documents/BDS/Mlops_2version/MLops_mod/training_pipeline.ipynb#W3sZmlsZQ%3D%3D?line=4'>5</a>\u001b[0m load_dotenv\n\u001b[0;32m----> <a href='vscode-notebook-cell:/Users/manos/Documents/BDS/Mlops_2version/MLops_mod/training_pipeline.ipynb#W3sZmlsZQ%3D%3D?line=6'>7</a>\u001b[0m connection \u001b[39m=\u001b[39m hsfs\u001b[39m.\u001b[39mconnection()\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/manos/Documents/BDS/Mlops_2version/MLops_mod/training_pipeline.ipynb#W3sZmlsZQ%3D%3D?line=7'>8</a>\u001b[0m api_key \u001b[39m=\u001b[39m os\u001b[39m.\u001b[39menviron\u001b[39m.\u001b[39mget(\u001b[39m'\u001b[39m\u001b[39mhopsworks_api\u001b[39m\u001b[39m'\u001b[39m)\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/manos/Documents/BDS/Mlops_2version/MLops_mod/training_pipeline.ipynb#W3sZmlsZQ%3D%3D?line=8'>9</a>\u001b[0m project \u001b[39m=\u001b[39m hopsworks\u001b[39m.\u001b[39mlogin(api_key_value\u001b[39m=\u001b[39mapi_key)\n",
|
136 |
+
"File \u001b[0;32m/Applications/anaconda3/lib/python3.11/site-packages/hsfs/connection.py:303\u001b[0m, in \u001b[0;36mConnection.connection\u001b[0;34m(cls, host, port, project, engine, region_name, secrets_store, hostname_verification, trust_store_path, cert_folder, api_key_file, api_key_value)\u001b[0m\n\u001b[1;32m 287\u001b[0m \u001b[39m@classmethod\u001b[39m\n\u001b[1;32m 288\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39mconnection\u001b[39m(\n\u001b[1;32m 289\u001b[0m \u001b[39mcls\u001b[39m,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 300\u001b[0m api_key_value: \u001b[39mstr\u001b[39m \u001b[39m=\u001b[39m \u001b[39mNone\u001b[39;00m,\n\u001b[1;32m 301\u001b[0m ):\n\u001b[1;32m 302\u001b[0m \u001b[39m \u001b[39m\u001b[39m\"\"\"Connection factory method, accessible through `hsfs.connection()`.\"\"\"\u001b[39;00m\n\u001b[0;32m--> 303\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mcls\u001b[39m(\n\u001b[1;32m 304\u001b[0m host,\n\u001b[1;32m 305\u001b[0m port,\n\u001b[1;32m 306\u001b[0m project,\n\u001b[1;32m 307\u001b[0m engine,\n\u001b[1;32m 308\u001b[0m region_name,\n\u001b[1;32m 309\u001b[0m secrets_store,\n\u001b[1;32m 310\u001b[0m hostname_verification,\n\u001b[1;32m 311\u001b[0m trust_store_path,\n\u001b[1;32m 312\u001b[0m cert_folder,\n\u001b[1;32m 313\u001b[0m api_key_file,\n\u001b[1;32m 314\u001b[0m api_key_value,\n\u001b[1;32m 315\u001b[0m )\n",
|
137 |
+
"File \u001b[0;32m/Applications/anaconda3/lib/python3.11/site-packages/hsfs/connection.py:154\u001b[0m, in \u001b[0;36mConnection.__init__\u001b[0;34m(self, host, port, project, engine, region_name, secrets_store, hostname_verification, trust_store_path, cert_folder, api_key_file, api_key_value)\u001b[0m\n\u001b[1;32m 151\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_api_key_value \u001b[39m=\u001b[39m api_key_value\n\u001b[1;32m 152\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_connected \u001b[39m=\u001b[39m \u001b[39mFalse\u001b[39;00m\n\u001b[0;32m--> 154\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mconnect()\n",
|
138 |
+
"File \u001b[0;32m/Applications/anaconda3/lib/python3.11/site-packages/hsfs/decorators.py:25\u001b[0m, in \u001b[0;36mnot_connected.<locals>.if_not_connected\u001b[0;34m(inst, *args, **kwargs)\u001b[0m\n\u001b[1;32m 23\u001b[0m \u001b[39mif\u001b[39;00m inst\u001b[39m.\u001b[39m_connected:\n\u001b[1;32m 24\u001b[0m \u001b[39mraise\u001b[39;00m HopsworksConnectionError\n\u001b[0;32m---> 25\u001b[0m \u001b[39mreturn\u001b[39;00m fn(inst, \u001b[39m*\u001b[39margs, \u001b[39m*\u001b[39m\u001b[39m*\u001b[39mkwargs)\n",
|
139 |
+
"File \u001b[0;32m/Applications/anaconda3/lib/python3.11/site-packages/hsfs/connection.py:233\u001b[0m, in \u001b[0;36mConnection.connect\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 231\u001b[0m \u001b[39m# init client\u001b[39;00m\n\u001b[1;32m 232\u001b[0m \u001b[39mif\u001b[39;00m client\u001b[39m.\u001b[39mbase\u001b[39m.\u001b[39mClient\u001b[39m.\u001b[39mREST_ENDPOINT \u001b[39mnot\u001b[39;00m \u001b[39min\u001b[39;00m os\u001b[39m.\u001b[39menviron:\n\u001b[0;32m--> 233\u001b[0m client\u001b[39m.\u001b[39minit(\n\u001b[1;32m 234\u001b[0m \u001b[39m\"\u001b[39m\u001b[39mexternal\u001b[39m\u001b[39m\"\u001b[39m,\n\u001b[1;32m 235\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_host,\n\u001b[1;32m 236\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_port,\n\u001b[1;32m 237\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_project,\n\u001b[1;32m 238\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_engine,\n\u001b[1;32m 239\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_region_name,\n\u001b[1;32m 240\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_secrets_store,\n\u001b[1;32m 241\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_hostname_verification,\n\u001b[1;32m 242\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_trust_store_path,\n\u001b[1;32m 243\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_cert_folder,\n\u001b[1;32m 244\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_api_key_file,\n\u001b[1;32m 245\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_api_key_value,\n\u001b[1;32m 246\u001b[0m )\n\u001b[1;32m 247\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[1;32m 248\u001b[0m client\u001b[39m.\u001b[39minit(\u001b[39m\"\u001b[39m\u001b[39mhopsworks\u001b[39m\u001b[39m\"\u001b[39m)\n",
|
140 |
+
"File \u001b[0;32m/Applications/anaconda3/lib/python3.11/site-packages/hsfs/client/__init__.py:41\u001b[0m, in \u001b[0;36minit\u001b[0;34m(client_type, host, port, project, engine, region_name, secrets_store, hostname_verification, trust_store_path, cert_folder, api_key_file, api_key_value)\u001b[0m\n\u001b[1;32m 39\u001b[0m _client \u001b[39m=\u001b[39m hopsworks\u001b[39m.\u001b[39mClient()\n\u001b[1;32m 40\u001b[0m \u001b[39melif\u001b[39;00m client_type \u001b[39m==\u001b[39m \u001b[39m\"\u001b[39m\u001b[39mexternal\u001b[39m\u001b[39m\"\u001b[39m:\n\u001b[0;32m---> 41\u001b[0m _client \u001b[39m=\u001b[39m external\u001b[39m.\u001b[39mClient(\n\u001b[1;32m 42\u001b[0m host,\n\u001b[1;32m 43\u001b[0m port,\n\u001b[1;32m 44\u001b[0m project,\n\u001b[1;32m 45\u001b[0m engine,\n\u001b[1;32m 46\u001b[0m region_name,\n\u001b[1;32m 47\u001b[0m secrets_store,\n\u001b[1;32m 48\u001b[0m hostname_verification,\n\u001b[1;32m 49\u001b[0m trust_store_path,\n\u001b[1;32m 50\u001b[0m cert_folder,\n\u001b[1;32m 51\u001b[0m api_key_file,\n\u001b[1;32m 52\u001b[0m api_key_value,\n\u001b[1;32m 53\u001b[0m )\n",
|
141 |
+
"File \u001b[0;32m/Applications/anaconda3/lib/python3.11/site-packages/hsfs/client/external.py:54\u001b[0m, in \u001b[0;36mClient.__init__\u001b[0;34m(self, host, port, project, engine, region_name, secrets_store, hostname_verification, trust_store_path, cert_folder, api_key_file, api_key_value)\u001b[0m\n\u001b[1;32m 52\u001b[0m \u001b[39m\u001b[39m\u001b[39m\"\"\"Initializes a client in an external environment such as AWS Sagemaker.\"\"\"\u001b[39;00m\n\u001b[1;32m 53\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mnot\u001b[39;00m host:\n\u001b[0;32m---> 54\u001b[0m \u001b[39mraise\u001b[39;00m exceptions\u001b[39m.\u001b[39mExternalClientError(\u001b[39m\"\u001b[39m\u001b[39mhost\u001b[39m\u001b[39m\"\u001b[39m)\n\u001b[1;32m 55\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mnot\u001b[39;00m project:\n\u001b[1;32m 56\u001b[0m \u001b[39mraise\u001b[39;00m exceptions\u001b[39m.\u001b[39mExternalClientError(\u001b[39m\"\u001b[39m\u001b[39mproject\u001b[39m\u001b[39m\"\u001b[39m)\n",
|
142 |
+
"\u001b[0;31mExternalClientError\u001b[0m: host cannot be of type NoneType, host is a non-optional argument to connect to hopsworks from an external environment."
|
143 |
+
]
|
144 |
+
}
|
145 |
+
],
|
146 |
+
"source": [
|
147 |
+
"import hsfs\n",
|
148 |
+
"import os \n",
|
149 |
+
"from dotenv import load_dotenv\n",
|
150 |
+
"\n",
|
151 |
+
"load_dotenv\n",
|
152 |
+
"\n",
|
153 |
+
"api_key = os.environ.get('hopsworks_api')\n",
|
154 |
+
"project = hopsworks.login(api_key_value=api_key)\n",
|
155 |
+
"\n",
|
156 |
+
"\n",
|
157 |
+
"\n",
|
158 |
+
"fv = fs.get_feature_view('tesla_stocks_fv', version=1)"
|
159 |
+
]
|
160 |
+
},
|
161 |
+
{
|
162 |
+
"cell_type": "code",
|
163 |
+
"execution_count": 14,
|
164 |
+
"metadata": {},
|
165 |
+
"outputs": [
|
166 |
+
{
|
167 |
+
"name": "stdout",
|
168 |
+
"output_type": "stream",
|
169 |
+
"text": [
|
170 |
+
"Fetching feature view from hopsworks...\n",
|
171 |
+
"Connection closed.\n",
|
172 |
+
"Connected. Call `.close()` to terminate connection gracefully.\n"
|
173 |
+
]
|
174 |
+
},
|
175 |
+
{
|
176 |
+
"name": "stdout",
|
177 |
+
"output_type": "stream",
|
178 |
+
"text": [
|
179 |
+
"\n",
|
180 |
+
"Logged in to project, explore it here https://c.app.hopsworks.ai:443/p/549016\n",
|
181 |
+
"Connected. Call `.close()` to terminate connection gracefully.\n"
|
182 |
+
]
|
183 |
+
}
|
184 |
+
],
|
185 |
+
"source": [
|
186 |
+
"print('Fetching feature view from hopsworks...')\n",
|
187 |
+
"project = hopsworks.login()\n",
|
188 |
+
"fs = project.get_feature_store()\n",
|
189 |
+
"\n",
|
190 |
+
"# Get feature view \n",
|
191 |
+
"fv = fs.get_feature_view(\n",
|
192 |
+
" name = 'tesla_stocks_fv',\n",
|
193 |
+
" version = 1\n",
|
194 |
+
")"
|
195 |
+
]
|
196 |
+
},
|
197 |
+
{
|
198 |
+
"cell_type": "code",
|
199 |
+
"execution_count": 20,
|
200 |
+
"metadata": {},
|
201 |
+
"outputs": [
|
202 |
+
{
|
203 |
+
"name": "stdout",
|
204 |
+
"output_type": "stream",
|
205 |
+
"text": [
|
206 |
+
"Failed to load data: Metadata operation error: (url: https://c.app.hopsworks.ai/hopsworks-api/api/project/549016/dataset/Projects%2Fmtzeve%2Fmtzeve_Training_Datasets%2Ftesla_stocks_fv_1_1%2Ftesla_stocks_fv_1). Server response: \n",
|
207 |
+
"HTTP code: 400, HTTP reason: Bad Request, body: b'{\"errorCode\":110018,\"errorMsg\":\"Path not found\"}', error code: 110018, error msg: Path not found, user msg: \n"
|
208 |
+
]
|
209 |
+
}
|
210 |
+
],
|
211 |
+
"source": [
|
212 |
+
"# Assuming 'fv' is your FeatureView object and you've verified the version number.\n",
|
213 |
+
"# Here, you will use the method to retrieve training data.\n",
|
214 |
+
"\n",
|
215 |
+
"try:\n",
|
216 |
+
" df_train, _ = fv.get_training_data(training_dataset_version=1)\n",
|
217 |
+
" print(df_train.head())\n",
|
218 |
+
"except Exception as e:\n",
|
219 |
+
" print(\"Failed to load data:\", e)"
|
220 |
+
]
|
221 |
+
}
|
222 |
+
],
|
223 |
+
"metadata": {
|
224 |
+
"kernelspec": {
|
225 |
+
"display_name": "base",
|
226 |
+
"language": "python",
|
227 |
+
"name": "python3"
|
228 |
+
},
|
229 |
+
"language_info": {
|
230 |
+
"codemirror_mode": {
|
231 |
+
"name": "ipython",
|
232 |
+
"version": 3
|
233 |
+
},
|
234 |
+
"file_extension": ".py",
|
235 |
+
"mimetype": "text/x-python",
|
236 |
+
"name": "python",
|
237 |
+
"nbconvert_exporter": "python",
|
238 |
+
"pygments_lexer": "ipython3",
|
239 |
+
"version": "3.11.4"
|
240 |
+
},
|
241 |
+
"orig_nbformat": 4
|
242 |
+
},
|
243 |
+
"nbformat": 4,
|
244 |
+
"nbformat_minor": 2
|
245 |
+
}
|