File size: 5,765 Bytes
56f6887
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "62252039-37f7-467f-bde2-0a576770d4be",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "e9f9088b-aab7-4faf-a158-5b6e51d1b1bc",
   "metadata": {},
   "outputs": [],
   "source": [
    "features = [\n",
    "    # \"batting_team\",\n",
    "    # \"bowling_team\",\n",
    "    # \"balls\",\n",
    "    # \"runs\",\n",
    "    # \"wickets\",\n",
    "    \"wkt_last_5_overs\",\n",
    "    # \"runrate_last_5_overs\",\n",
    "    \"current_RR\",\n",
    "    # \"average\",\n",
    "    \"balls_left\",\n",
    "    \"wkts_left\",\n",
    "    # \"required_RR\",\n",
    "    # \"projected_score_more\",\n",
    "    # \"min_score_more\",\n",
    "    # \"max_score_more\",\n",
    "    # \"projected_avg_score_more\",\n",
    "    \"runrate_last_5_overs-current_RR\",\n",
    "    \"deviation_from_projected\",\n",
    "]\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "7694e380-b6d3-4d56-af94-66f5233e6c49",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/media/instantinopaul/data/Code/ML/github.com/scorepredictor/env/lib/python3.10/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
      "  from .autonotebook import tqdm as notebook_tqdm\n"
     ]
    }
   ],
   "source": [
    "from ydata_profiling import ProfileReport"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "4845035c-3501-4eb0-a67b-0bbc5e289a8b",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/media/instantinopaul/data/Code/ML/github.com/scorepredictor/env/lib/python3.10/site-packages/ydata_profiling/utils/dataframe.py:137: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  df.rename(columns={\"index\": \"df_index\"}, inplace=True)\n",
      "Summarize dataset:   0%|          | 0/5 [00:00<?, ?it/s]/media/instantinopaul/data/Code/ML/github.com/scorepredictor/env/lib/python3.10/site-packages/ydata_profiling/model/typeset.py:125: FutureWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, CategoricalDtype) instead\n",
      "  not pdt.is_categorical_dtype(series)\n",
      "Summarize dataset: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 51/51 [00:11<00:00,  4.50it/s, Completed]                                                               \n",
      "Generate report structure: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1/1 [00:02<00:00,  2.68s/it]\n",
      "Render HTML: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1/1 [00:01<00:00,  1.43s/it]\n",
      "Export report to file: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1/1 [00:00<00:00, 210.06it/s]\n"
     ]
    }
   ],
   "source": [
    "df=pd.read_feather('data/t20features.feather')\n",
    "r=ProfileReport(df[features])\n",
    "r.to_file('result/profilereportT20.html')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "1272e5c3-2a60-4966-b70a-43f49101a5a9",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/media/instantinopaul/data/Code/ML/github.com/scorepredictor/env/lib/python3.10/site-packages/ydata_profiling/utils/dataframe.py:137: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  df.rename(columns={\"index\": \"df_index\"}, inplace=True)\n",
      "Summarize dataset:   0%|          | 0/5 [00:00<?, ?it/s]/media/instantinopaul/data/Code/ML/github.com/scorepredictor/env/lib/python3.10/site-packages/ydata_profiling/model/typeset.py:208: FutureWarning: is_categorical_dtype is deprecated and will be removed in a future version. Use isinstance(dtype, CategoricalDtype) instead\n",
      "  is_valid_dtype = pdt.is_categorical_dtype(series) and not pdt.is_bool_dtype(\n",
      "Summarize dataset: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 51/51 [00:07<00:00,  7.05it/s, Completed]                                                               \n",
      "Generate report structure: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1/1 [00:02<00:00,  2.76s/it]\n",
      "Render HTML: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1/1 [00:01<00:00,  1.32s/it]\n",
      "Export report to file: 100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1/1 [00:00<00:00, 121.46it/s]\n"
     ]
    }
   ],
   "source": [
    "df=pd.read_feather('data/odifeatures.feather')\n",
    "r=ProfileReport(df[features])\n",
    "r.to_file('result/profilereportODI.html')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e55fd847-05c8-47dc-aedc-9b96c23b4aa6",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "cricpred",
   "language": "python",
   "name": "cricpred"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}