ibnummuhammad commited on
Commit
cda2141
1 Parent(s): 3b9a22e
Files changed (1) hide show
  1. granger_causality_testing.ipynb +68 -0
granger_causality_testing.ipynb CHANGED
@@ -7377,6 +7377,74 @@
7377
  "print('MAE: ', round(mae,2))"
7378
  ]
7379
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7380
  {
7381
  "cell_type": "code",
7382
  "execution_count": null,
 
7377
  "print('MAE: ', round(mae,2))"
7378
  ]
7379
  },
7380
+ {
7381
+ "cell_type": "code",
7382
+ "execution_count": 45,
7383
+ "metadata": {},
7384
+ "outputs": [
7385
+ {
7386
+ "name": "stdout",
7387
+ "output_type": "stream",
7388
+ "text": [
7389
+ "Forecast accuracy of Walmart\n",
7390
+ "RMSE: 10.5\n",
7391
+ "MAE: 9.71\n"
7392
+ ]
7393
+ },
7394
+ {
7395
+ "name": "stderr",
7396
+ "output_type": "stream",
7397
+ "text": [
7398
+ "/home/ibnu/miniconda3/envs/py312/lib/python3.12/site-packages/sklearn/metrics/_regression.py:483: FutureWarning:\n",
7399
+ "\n",
7400
+ "'squared' is deprecated in version 1.4 and will be removed in 1.6. To calculate the root mean squared error, use the function'root_mean_squared_error'.\n",
7401
+ "\n"
7402
+ ]
7403
+ }
7404
+ ],
7405
+ "source": [
7406
+ "rmse = mean_squared_error(combined['walmart_pred'], combined['walmart'], squared=False)\n",
7407
+ "mae = mean_absolute_error(combined['walmart_pred'], combined['walmart'])\n",
7408
+ "\n",
7409
+ "print('Forecast accuracy of Walmart')\n",
7410
+ "print('RMSE: ', round(rmse,2))\n",
7411
+ "print('MAE: ', round(mae,2))"
7412
+ ]
7413
+ },
7414
+ {
7415
+ "cell_type": "code",
7416
+ "execution_count": 46,
7417
+ "metadata": {},
7418
+ "outputs": [
7419
+ {
7420
+ "name": "stdout",
7421
+ "output_type": "stream",
7422
+ "text": [
7423
+ "Forecast accuracy of Tesla\n",
7424
+ "RMSE: 11.66\n",
7425
+ "MAE: 9.66\n"
7426
+ ]
7427
+ },
7428
+ {
7429
+ "name": "stderr",
7430
+ "output_type": "stream",
7431
+ "text": [
7432
+ "/home/ibnu/miniconda3/envs/py312/lib/python3.12/site-packages/sklearn/metrics/_regression.py:483: FutureWarning:\n",
7433
+ "\n",
7434
+ "'squared' is deprecated in version 1.4 and will be removed in 1.6. To calculate the root mean squared error, use the function'root_mean_squared_error'.\n",
7435
+ "\n"
7436
+ ]
7437
+ }
7438
+ ],
7439
+ "source": [
7440
+ "rmse = mean_squared_error(combined['tesla_pred'], combined['tesla'], squared=False)\n",
7441
+ "mae = mean_absolute_error(combined['tesla_pred'], combined['tesla'])\n",
7442
+ "\n",
7443
+ "print('Forecast accuracy of Tesla')\n",
7444
+ "print('RMSE: ', round(rmse,2))\n",
7445
+ "print('MAE: ', round(mae,2))"
7446
+ ]
7447
+ },
7448
  {
7449
  "cell_type": "code",
7450
  "execution_count": null,