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Ca,Ba,Fe,Type
|
2 |
+
1.52101,13.64,4.49,1.1,71.78,0.06,8.75,0,0,1
|
3 |
+
1.51761,13.89,3.6,1.36,72.73,0.48,7.83,0,0,1
|
4 |
+
1.51618,13.53,3.55,1.54,72.99,0.39,7.78,0,0,1
|
5 |
+
1.51766,13.21,3.69,1.29,72.61,0.57,8.22,0,0,1
|
6 |
+
1.51742,13.27,3.62,1.24,73.08,0.55,8.07,0,0,1
|
7 |
+
1.51596,12.79,3.61,1.62,72.97,0.64,8.07,0,0.26,1
|
8 |
+
1.51743,13.3,3.6,1.14,73.09,0.58,8.17,0,0,1
|
9 |
+
1.51756,13.15,3.61,1.05,73.24,0.57,8.24,0,0,1
|
10 |
+
1.51918,14.04,3.58,1.37,72.08,0.56,8.3,0,0,1
|
11 |
+
1.51755,13,3.6,1.36,72.99,0.57,8.4,0,0.11,1
|
12 |
+
1.51571,12.72,3.46,1.56,73.2,0.67,8.09,0,0.24,1
|
13 |
+
1.51763,12.8,3.66,1.27,73.01,0.6,8.56,0,0,1
|
14 |
+
1.51589,12.88,3.43,1.4,73.28,0.69,8.05,0,0.24,1
|
15 |
+
1.51748,12.86,3.56,1.27,73.21,0.54,8.38,0,0.17,1
|
16 |
+
1.51763,12.61,3.59,1.31,73.29,0.58,8.5,0,0,1
|
17 |
+
1.51761,12.81,3.54,1.23,73.24,0.58,8.39,0,0,1
|
18 |
+
1.51784,12.68,3.67,1.16,73.11,0.61,8.7,0,0,1
|
19 |
+
1.52196,14.36,3.85,0.89,71.36,0.15,9.15,0,0,1
|
20 |
+
1.51911,13.9,3.73,1.18,72.12,0.06,8.89,0,0,1
|
21 |
+
1.51735,13.02,3.54,1.69,72.73,0.54,8.44,0,0.07,1
|
22 |
+
1.5175,12.82,3.55,1.49,72.75,0.54,8.52,0,0.19,1
|
23 |
+
1.51966,14.77,3.75,0.29,72.02,0.03,9,0,0,1
|
24 |
+
1.51736,12.78,3.62,1.29,72.79,0.59,8.7,0,0,1
|
25 |
+
1.51751,12.81,3.57,1.35,73.02,0.62,8.59,0,0,1
|
26 |
+
1.5172,13.38,3.5,1.15,72.85,0.5,8.43,0,0,1
|
27 |
+
1.51764,12.98,3.54,1.21,73,0.65,8.53,0,0,1
|
28 |
+
1.51793,13.21,3.48,1.41,72.64,0.59,8.43,0,0,1
|
29 |
+
1.51721,12.87,3.48,1.33,73.04,0.56,8.43,0,0,1
|
30 |
+
1.51768,12.56,3.52,1.43,73.15,0.57,8.54,0,0,1
|
31 |
+
1.51784,13.08,3.49,1.28,72.86,0.6,8.49,0,0,1
|
32 |
+
1.51768,12.65,3.56,1.3,73.08,0.61,8.69,0,0.14,1
|
33 |
+
1.51747,12.84,3.5,1.14,73.27,0.56,8.55,0,0,1
|
34 |
+
1.51775,12.85,3.48,1.23,72.97,0.61,8.56,0.09,0.22,1
|
35 |
+
1.51753,12.57,3.47,1.38,73.39,0.6,8.55,0,0.06,1
|
36 |
+
1.51783,12.69,3.54,1.34,72.95,0.57,8.75,0,0,1
|
37 |
+
1.51567,13.29,3.45,1.21,72.74,0.56,8.57,0,0,1
|
38 |
+
1.51909,13.89,3.53,1.32,71.81,0.51,8.78,0.11,0,1
|
39 |
+
1.51797,12.74,3.48,1.35,72.96,0.64,8.68,0,0,1
|
40 |
+
1.52213,14.21,3.82,0.47,71.77,0.11,9.57,0,0,1
|
41 |
+
1.52213,14.21,3.82,0.47,71.77,0.11,9.57,0,0,1
|
42 |
+
1.51793,12.79,3.5,1.12,73.03,0.64,8.77,0,0,1
|
43 |
+
1.51755,12.71,3.42,1.2,73.2,0.59,8.64,0,0,1
|
44 |
+
1.51779,13.21,3.39,1.33,72.76,0.59,8.59,0,0,1
|
45 |
+
1.5221,13.73,3.84,0.72,71.76,0.17,9.74,0,0,1
|
46 |
+
1.51786,12.73,3.43,1.19,72.95,0.62,8.76,0,0.3,1
|
47 |
+
1.519,13.49,3.48,1.35,71.95,0.55,9,0,0,1
|
48 |
+
1.51869,13.19,3.37,1.18,72.72,0.57,8.83,0,0.16,1
|
49 |
+
1.52667,13.99,3.7,0.71,71.57,0.02,9.82,0,0.1,1
|
50 |
+
1.52223,13.21,3.77,0.79,71.99,0.13,10.02,0,0,1
|
51 |
+
1.51898,13.58,3.35,1.23,72.08,0.59,8.91,0,0,1
|
52 |
+
1.5232,13.72,3.72,0.51,71.75,0.09,10.06,0,0.16,1
|
53 |
+
1.51926,13.2,3.33,1.28,72.36,0.6,9.14,0,0.11,1
|
54 |
+
1.51808,13.43,2.87,1.19,72.84,0.55,9.03,0,0,1
|
55 |
+
1.51837,13.14,2.84,1.28,72.85,0.55,9.07,0,0,1
|
56 |
+
1.51778,13.21,2.81,1.29,72.98,0.51,9.02,0,0.09,1
|
57 |
+
1.51769,12.45,2.71,1.29,73.7,0.56,9.06,0,0.24,1
|
58 |
+
1.51215,12.99,3.47,1.12,72.98,0.62,8.35,0,0.31,1
|
59 |
+
1.51824,12.87,3.48,1.29,72.95,0.6,8.43,0,0,1
|
60 |
+
1.51754,13.48,3.74,1.17,72.99,0.59,8.03,0,0,1
|
61 |
+
1.51754,13.39,3.66,1.19,72.79,0.57,8.27,0,0.11,1
|
62 |
+
1.51905,13.6,3.62,1.11,72.64,0.14,8.76,0,0,1
|
63 |
+
1.51977,13.81,3.58,1.32,71.72,0.12,8.67,0.69,0,1
|
64 |
+
1.52172,13.51,3.86,0.88,71.79,0.23,9.54,0,0.11,1
|
65 |
+
1.52227,14.17,3.81,0.78,71.35,0,9.69,0,0,1
|
66 |
+
1.52172,13.48,3.74,0.9,72.01,0.18,9.61,0,0.07,1
|
67 |
+
1.52099,13.69,3.59,1.12,71.96,0.09,9.4,0,0,1
|
68 |
+
1.52152,13.05,3.65,0.87,72.22,0.19,9.85,0,0.17,1
|
69 |
+
1.52152,13.05,3.65,0.87,72.32,0.19,9.85,0,0.17,1
|
70 |
+
1.52152,13.12,3.58,0.9,72.2,0.23,9.82,0,0.16,1
|
71 |
+
1.523,13.31,3.58,0.82,71.99,0.12,10.17,0,0.03,1
|
72 |
+
1.51574,14.86,3.67,1.74,71.87,0.16,7.36,0,0.12,2
|
73 |
+
1.51848,13.64,3.87,1.27,71.96,0.54,8.32,0,0.32,2
|
74 |
+
1.51593,13.09,3.59,1.52,73.1,0.67,7.83,0,0,2
|
75 |
+
1.51631,13.34,3.57,1.57,72.87,0.61,7.89,0,0,2
|
76 |
+
1.51596,13.02,3.56,1.54,73.11,0.72,7.9,0,0,2
|
77 |
+
1.5159,13.02,3.58,1.51,73.12,0.69,7.96,0,0,2
|
78 |
+
1.51645,13.44,3.61,1.54,72.39,0.66,8.03,0,0,2
|
79 |
+
1.51627,13,3.58,1.54,72.83,0.61,8.04,0,0,2
|
80 |
+
1.51613,13.92,3.52,1.25,72.88,0.37,7.94,0,0.14,2
|
81 |
+
1.5159,12.82,3.52,1.9,72.86,0.69,7.97,0,0,2
|
82 |
+
1.51592,12.86,3.52,2.12,72.66,0.69,7.97,0,0,2
|
83 |
+
1.51593,13.25,3.45,1.43,73.17,0.61,7.86,0,0,2
|
84 |
+
1.51646,13.41,3.55,1.25,72.81,0.68,8.1,0,0,2
|
85 |
+
1.51594,13.09,3.52,1.55,72.87,0.68,8.05,0,0.09,2
|
86 |
+
1.51409,14.25,3.09,2.08,72.28,1.1,7.08,0,0,2
|
87 |
+
1.51625,13.36,3.58,1.49,72.72,0.45,8.21,0,0,2
|
88 |
+
1.51569,13.24,3.49,1.47,73.25,0.38,8.03,0,0,2
|
89 |
+
1.51645,13.4,3.49,1.52,72.65,0.67,8.08,0,0.1,2
|
90 |
+
1.51618,13.01,3.5,1.48,72.89,0.6,8.12,0,0,2
|
91 |
+
1.5164,12.55,3.48,1.87,73.23,0.63,8.08,0,0.09,2
|
92 |
+
1.51841,12.93,3.74,1.11,72.28,0.64,8.96,0,0.22,2
|
93 |
+
1.51605,12.9,3.44,1.45,73.06,0.44,8.27,0,0,2
|
94 |
+
1.51588,13.12,3.41,1.58,73.26,0.07,8.39,0,0.19,2
|
95 |
+
1.5159,13.24,3.34,1.47,73.1,0.39,8.22,0,0,2
|
96 |
+
1.51629,12.71,3.33,1.49,73.28,0.67,8.24,0,0,2
|
97 |
+
1.5186,13.36,3.43,1.43,72.26,0.51,8.6,0,0,2
|
98 |
+
1.51841,13.02,3.62,1.06,72.34,0.64,9.13,0,0.15,2
|
99 |
+
1.51743,12.2,3.25,1.16,73.55,0.62,8.9,0,0.24,2
|
100 |
+
1.51689,12.67,2.88,1.71,73.21,0.73,8.54,0,0,2
|
101 |
+
1.51811,12.96,2.96,1.43,72.92,0.6,8.79,0.14,0,2
|
102 |
+
1.51655,12.75,2.85,1.44,73.27,0.57,8.79,0.11,0.22,2
|
103 |
+
1.5173,12.35,2.72,1.63,72.87,0.7,9.23,0,0,2
|
104 |
+
1.5182,12.62,2.76,0.83,73.81,0.35,9.42,0,0.2,2
|
105 |
+
1.52725,13.8,3.15,0.66,70.57,0.08,11.64,0,0,2
|
106 |
+
1.5241,13.83,2.9,1.17,71.15,0.08,10.79,0,0,2
|
107 |
+
1.52475,11.45,0,1.88,72.19,0.81,13.24,0,0.34,2
|
108 |
+
1.53125,10.73,0,2.1,69.81,0.58,13.3,3.15,0.28,2
|
109 |
+
1.53393,12.3,0,1,70.16,0.12,16.19,0,0.24,2
|
110 |
+
1.52222,14.43,0,1,72.67,0.1,11.52,0,0.08,2
|
111 |
+
1.51818,13.72,0,0.56,74.45,0,10.99,0,0,2
|
112 |
+
1.52664,11.23,0,0.77,73.21,0,14.68,0,0,2
|
113 |
+
1.52739,11.02,0,0.75,73.08,0,14.96,0,0,2
|
114 |
+
1.52777,12.64,0,0.67,72.02,0.06,14.4,0,0,2
|
115 |
+
1.51892,13.46,3.83,1.26,72.55,0.57,8.21,0,0.14,2
|
116 |
+
1.51847,13.1,3.97,1.19,72.44,0.6,8.43,0,0,2
|
117 |
+
1.51846,13.41,3.89,1.33,72.38,0.51,8.28,0,0,2
|
118 |
+
1.51829,13.24,3.9,1.41,72.33,0.55,8.31,0,0.1,2
|
119 |
+
1.51708,13.72,3.68,1.81,72.06,0.64,7.88,0,0,2
|
120 |
+
1.51673,13.3,3.64,1.53,72.53,0.65,8.03,0,0.29,2
|
121 |
+
1.51652,13.56,3.57,1.47,72.45,0.64,7.96,0,0,2
|
122 |
+
1.51844,13.25,3.76,1.32,72.4,0.58,8.42,0,0,2
|
123 |
+
1.51663,12.93,3.54,1.62,72.96,0.64,8.03,0,0.21,2
|
124 |
+
1.51687,13.23,3.54,1.48,72.84,0.56,8.1,0,0,2
|
125 |
+
1.51707,13.48,3.48,1.71,72.52,0.62,7.99,0,0,2
|
126 |
+
1.52177,13.2,3.68,1.15,72.75,0.54,8.52,0,0,2
|
127 |
+
1.51872,12.93,3.66,1.56,72.51,0.58,8.55,0,0.12,2
|
128 |
+
1.51667,12.94,3.61,1.26,72.75,0.56,8.6,0,0,2
|
129 |
+
1.52081,13.78,2.28,1.43,71.99,0.49,9.85,0,0.17,2
|
130 |
+
1.52068,13.55,2.09,1.67,72.18,0.53,9.57,0.27,0.17,2
|
131 |
+
1.5202,13.98,1.35,1.63,71.76,0.39,10.56,0,0.18,2
|
132 |
+
1.52177,13.75,1.01,1.36,72.19,0.33,11.14,0,0,2
|
133 |
+
1.52614,13.7,0,1.36,71.24,0.19,13.44,0,0.1,2
|
134 |
+
1.51813,13.43,3.98,1.18,72.49,0.58,8.15,0,0,2
|
135 |
+
1.518,13.71,3.93,1.54,71.81,0.54,8.21,0,0.15,2
|
136 |
+
1.51811,13.33,3.85,1.25,72.78,0.52,8.12,0,0,2
|
137 |
+
1.51789,13.19,3.9,1.3,72.33,0.55,8.44,0,0.28,2
|
138 |
+
1.51806,13,3.8,1.08,73.07,0.56,8.38,0,0.12,2
|
139 |
+
1.51711,12.89,3.62,1.57,72.96,0.61,8.11,0,0,2
|
140 |
+
1.51674,12.79,3.52,1.54,73.36,0.66,7.9,0,0,2
|
141 |
+
1.51674,12.87,3.56,1.64,73.14,0.65,7.99,0,0,2
|
142 |
+
1.5169,13.33,3.54,1.61,72.54,0.68,8.11,0,0,2
|
143 |
+
1.51851,13.2,3.63,1.07,72.83,0.57,8.41,0.09,0.17,2
|
144 |
+
1.51662,12.85,3.51,1.44,73.01,0.68,8.23,0.06,0.25,2
|
145 |
+
1.51709,13,3.47,1.79,72.72,0.66,8.18,0,0,2
|
146 |
+
1.5166,12.99,3.18,1.23,72.97,0.58,8.81,0,0.24,2
|
147 |
+
1.51839,12.85,3.67,1.24,72.57,0.62,8.68,0,0.35,2
|
148 |
+
1.51769,13.65,3.66,1.11,72.77,0.11,8.6,0,0,3
|
149 |
+
1.5161,13.33,3.53,1.34,72.67,0.56,8.33,0,0,3
|
150 |
+
1.5167,13.24,3.57,1.38,72.7,0.56,8.44,0,0.1,3
|
151 |
+
1.51643,12.16,3.52,1.35,72.89,0.57,8.53,0,0,3
|
152 |
+
1.51665,13.14,3.45,1.76,72.48,0.6,8.38,0,0.17,3
|
153 |
+
1.52127,14.32,3.9,0.83,71.5,0,9.49,0,0,3
|
154 |
+
1.51779,13.64,3.65,0.65,73,0.06,8.93,0,0,3
|
155 |
+
1.5161,13.42,3.4,1.22,72.69,0.59,8.32,0,0,3
|
156 |
+
1.51694,12.86,3.58,1.31,72.61,0.61,8.79,0,0,3
|
157 |
+
1.51646,13.04,3.4,1.26,73.01,0.52,8.58,0,0,3
|
158 |
+
1.51655,13.41,3.39,1.28,72.64,0.52,8.65,0,0,3
|
159 |
+
1.52121,14.03,3.76,0.58,71.79,0.11,9.65,0,0,3
|
160 |
+
1.51776,13.53,3.41,1.52,72.04,0.58,8.79,0,0,3
|
161 |
+
1.51796,13.5,3.36,1.63,71.94,0.57,8.81,0,0.09,3
|
162 |
+
1.51832,13.33,3.34,1.54,72.14,0.56,8.99,0,0,3
|
163 |
+
1.51934,13.64,3.54,0.75,72.65,0.16,8.89,0.15,0.24,3
|
164 |
+
1.52211,14.19,3.78,0.91,71.36,0.23,9.14,0,0.37,3
|
165 |
+
1.51514,14.01,2.68,3.5,69.89,1.68,5.87,2.2,0,5
|
166 |
+
1.51915,12.73,1.85,1.86,72.69,0.6,10.09,0,0,5
|
167 |
+
1.52171,11.56,1.88,1.56,72.86,0.47,11.41,0,0,5
|
168 |
+
1.52151,11.03,1.71,1.56,73.44,0.58,11.62,0,0,5
|
169 |
+
1.51969,12.64,0,1.65,73.75,0.38,11.53,0,0,5
|
170 |
+
1.51666,12.86,0,1.83,73.88,0.97,10.17,0,0,5
|
171 |
+
1.51994,13.27,0,1.76,73.03,0.47,11.32,0,0,5
|
172 |
+
1.52369,13.44,0,1.58,72.22,0.32,12.24,0,0,5
|
173 |
+
1.51316,13.02,0,3.04,70.48,6.21,6.96,0,0,5
|
174 |
+
1.51321,13,0,3.02,70.7,6.21,6.93,0,0,5
|
175 |
+
1.52043,13.38,0,1.4,72.25,0.33,12.5,0,0,5
|
176 |
+
1.52058,12.85,1.61,2.17,72.18,0.76,9.7,0.24,0.51,5
|
177 |
+
1.52119,12.97,0.33,1.51,73.39,0.13,11.27,0,0.28,5
|
178 |
+
1.51905,14,2.39,1.56,72.37,0,9.57,0,0,6
|
179 |
+
1.51937,13.79,2.41,1.19,72.76,0,9.77,0,0,6
|
180 |
+
1.51829,14.46,2.24,1.62,72.38,0,9.26,0,0,6
|
181 |
+
1.51852,14.09,2.19,1.66,72.67,0,9.32,0,0,6
|
182 |
+
1.51299,14.4,1.74,1.54,74.55,0,7.59,0,0,6
|
183 |
+
1.51888,14.99,0.78,1.74,72.5,0,9.95,0,0,6
|
184 |
+
1.51916,14.15,0,2.09,72.74,0,10.88,0,0,6
|
185 |
+
1.51969,14.56,0,0.56,73.48,0,11.22,0,0,6
|
186 |
+
1.51115,17.38,0,0.34,75.41,0,6.65,0,0,6
|
187 |
+
1.51131,13.69,3.2,1.81,72.81,1.76,5.43,1.19,0,7
|
188 |
+
1.51838,14.32,3.26,2.22,71.25,1.46,5.79,1.63,0,7
|
189 |
+
1.52315,13.44,3.34,1.23,72.38,0.6,8.83,0,0,7
|
190 |
+
1.52247,14.86,2.2,2.06,70.26,0.76,9.76,0,0,7
|
191 |
+
1.52365,15.79,1.83,1.31,70.43,0.31,8.61,1.68,0,7
|
192 |
+
1.51613,13.88,1.78,1.79,73.1,0,8.67,0.76,0,7
|
193 |
+
1.51602,14.85,0,2.38,73.28,0,8.76,0.64,0.09,7
|
194 |
+
1.51623,14.2,0,2.79,73.46,0.04,9.04,0.4,0.09,7
|
195 |
+
1.51719,14.75,0,2,73.02,0,8.53,1.59,0.08,7
|
196 |
+
1.51683,14.56,0,1.98,73.29,0,8.52,1.57,0.07,7
|
197 |
+
1.51545,14.14,0,2.68,73.39,0.08,9.07,0.61,0.05,7
|
198 |
+
1.51556,13.87,0,2.54,73.23,0.14,9.41,0.81,0.01,7
|
199 |
+
1.51727,14.7,0,2.34,73.28,0,8.95,0.66,0,7
|
200 |
+
1.51531,14.38,0,2.66,73.1,0.04,9.08,0.64,0,7
|
201 |
+
1.51609,15.01,0,2.51,73.05,0.05,8.83,0.53,0,7
|
202 |
+
1.51508,15.15,0,2.25,73.5,0,8.34,0.63,0,7
|
203 |
+
1.51653,11.95,0,1.19,75.18,2.7,8.93,0,0,7
|
204 |
+
1.51514,14.85,0,2.42,73.72,0,8.39,0.56,0,7
|
205 |
+
1.51658,14.8,0,1.99,73.11,0,8.28,1.71,0,7
|
206 |
+
1.51617,14.95,0,2.27,73.3,0,8.71,0.67,0,7
|
207 |
+
1.51732,14.95,0,1.8,72.99,0,8.61,1.55,0,7
|
208 |
+
1.51645,14.94,0,1.87,73.11,0,8.67,1.38,0,7
|
209 |
+
1.51831,14.39,0,1.82,72.86,1.41,6.47,2.88,0,7
|
210 |
+
1.5164,14.37,0,2.74,72.85,0,9.45,0.54,0,7
|
211 |
+
1.51623,14.14,0,2.88,72.61,0.08,9.18,1.06,0,7
|
212 |
+
1.51685,14.92,0,1.99,73.06,0,8.4,1.59,0,7
|
213 |
+
1.52065,14.36,0,2.02,73.42,0,8.44,1.64,0,7
|
214 |
+
1.51651,14.38,0,1.94,73.61,0,8.48,1.57,0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+
{
|
13 |
+
"cell_type": "code",
|
14 |
+
"source": [
|
15 |
+
"try:\n",
|
16 |
+
" import opendatasets as od\n",
|
17 |
+
" import pandas as pd\n",
|
18 |
+
"except:\n",
|
19 |
+
" !pip install opendatasets\n",
|
20 |
+
" import opendatasets as od\n",
|
21 |
+
"from os import path\n",
|
22 |
+
"\n",
|
23 |
+
"url = \"https://www.kaggle.com/datasets/uciml/glass\" ### kaggle dataset url here\n",
|
24 |
+
"data_dir = \"/content/\" ### directory where you want to save data\n",
|
25 |
+
"\n",
|
26 |
+
"# Go to the account tab and under API section, click Create New API Token.\n",
|
27 |
+
"\n",
|
28 |
+
"# A JSON file will be downloaded, open it locally or you can also use any online JSON viewer and upload it there.\n",
|
29 |
+
"\n",
|
30 |
+
"# On opening this file, you will find the username and key in it. Copy the username and password and paste it into the prompted Notebook cell.\n",
|
31 |
+
"# The content of the downloaded file would look like this.\n",
|
32 |
+
"\n",
|
33 |
+
"# {\"username\":<KAGGLE USERNAME>,\"key\":<KAGGLE KEY>}\n",
|
34 |
+
"\n",
|
35 |
+
"\n",
|
36 |
+
"def download_data(url, data_dir):\n",
|
37 |
+
" od.download(url, data_dir)"
|
38 |
+
],
|
39 |
+
"metadata": {
|
40 |
+
"id": "5ewudtMkfnPL",
|
41 |
+
"outputId": "6abe70ec-7a22-4872-b0e6-623d9e18e1fe",
|
42 |
+
"colab": {
|
43 |
+
"base_uri": "https://localhost:8080/"
|
44 |
+
}
|
45 |
+
},
|
46 |
+
"execution_count": 1,
|
47 |
+
"outputs": [
|
48 |
+
{
|
49 |
+
"output_type": "stream",
|
50 |
+
"name": "stdout",
|
51 |
+
"text": [
|
52 |
+
"Collecting opendatasets\n",
|
53 |
+
" Downloading opendatasets-0.1.22-py3-none-any.whl (15 kB)\n",
|
54 |
+
"Requirement already satisfied: tqdm in /usr/local/lib/python3.10/dist-packages (from opendatasets) (4.66.1)\n",
|
55 |
+
"Requirement already satisfied: kaggle in /usr/local/lib/python3.10/dist-packages (from opendatasets) (1.5.16)\n",
|
56 |
+
"Requirement already satisfied: click in /usr/local/lib/python3.10/dist-packages (from opendatasets) (8.1.7)\n",
|
57 |
+
"Requirement already satisfied: six>=1.10 in /usr/local/lib/python3.10/dist-packages (from kaggle->opendatasets) (1.16.0)\n",
|
58 |
+
"Requirement already satisfied: certifi in /usr/local/lib/python3.10/dist-packages (from kaggle->opendatasets) (2023.11.17)\n",
|
59 |
+
"Requirement already satisfied: python-dateutil in /usr/local/lib/python3.10/dist-packages (from kaggle->opendatasets) (2.8.2)\n",
|
60 |
+
"Requirement already satisfied: requests in /usr/local/lib/python3.10/dist-packages (from kaggle->opendatasets) (2.31.0)\n",
|
61 |
+
"Requirement already satisfied: python-slugify in /usr/local/lib/python3.10/dist-packages (from kaggle->opendatasets) (8.0.1)\n",
|
62 |
+
"Requirement already satisfied: urllib3 in /usr/local/lib/python3.10/dist-packages (from kaggle->opendatasets) (2.0.7)\n",
|
63 |
+
"Requirement already satisfied: bleach in /usr/local/lib/python3.10/dist-packages (from kaggle->opendatasets) (6.1.0)\n",
|
64 |
+
"Requirement already satisfied: webencodings in /usr/local/lib/python3.10/dist-packages (from bleach->kaggle->opendatasets) (0.5.1)\n",
|
65 |
+
"Requirement already satisfied: text-unidecode>=1.3 in /usr/local/lib/python3.10/dist-packages (from python-slugify->kaggle->opendatasets) (1.3)\n",
|
66 |
+
"Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests->kaggle->opendatasets) (3.3.2)\n",
|
67 |
+
"Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests->kaggle->opendatasets) (3.6)\n",
|
68 |
+
"Installing collected packages: opendatasets\n",
|
69 |
+
"Successfully installed opendatasets-0.1.22\n"
|
70 |
+
]
|
71 |
+
}
|
72 |
+
]
|
73 |
+
},
|
74 |
+
{
|
75 |
+
"cell_type": "code",
|
76 |
+
"source": [
|
77 |
+
"download_data(url, data_dir)"
|
78 |
+
],
|
79 |
+
"metadata": {
|
80 |
+
"id": "y-gTjPFggtAM",
|
81 |
+
"outputId": "02890664-5063-4698-d664-ee458de7b125",
|
82 |
+
"colab": {
|
83 |
+
"base_uri": "https://localhost:8080/"
|
84 |
+
}
|
85 |
+
},
|
86 |
+
"execution_count": 2,
|
87 |
+
"outputs": [
|
88 |
+
{
|
89 |
+
"output_type": "stream",
|
90 |
+
"name": "stdout",
|
91 |
+
"text": [
|
92 |
+
"Please provide your Kaggle credentials to download this dataset. Learn more: http://bit.ly/kaggle-creds\n",
|
93 |
+
"Your Kaggle username: bartmiller\n",
|
94 |
+
"Your Kaggle Key: Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·\n",
|
95 |
+
"Downloading glass.zip to /content/glass\n"
|
96 |
+
]
|
97 |
+
},
|
98 |
+
{
|
99 |
+
"output_type": "stream",
|
100 |
+
"name": "stderr",
|
101 |
+
"text": [
|
102 |
+
"100%|ββββββββββ| 3.42k/3.42k [00:00<00:00, 2.36MB/s]"
|
103 |
+
]
|
104 |
+
},
|
105 |
+
{
|
106 |
+
"output_type": "stream",
|
107 |
+
"name": "stdout",
|
108 |
+
"text": [
|
109 |
+
"\n"
|
110 |
+
]
|
111 |
+
},
|
112 |
+
{
|
113 |
+
"output_type": "stream",
|
114 |
+
"name": "stderr",
|
115 |
+
"text": [
|
116 |
+
"\n"
|
117 |
+
]
|
118 |
+
}
|
119 |
+
]
|
120 |
+
},
|
121 |
+
{
|
122 |
+
"cell_type": "code",
|
123 |
+
"execution_count": 3,
|
124 |
+
"metadata": {
|
125 |
+
"colab": {
|
126 |
+
"base_uri": "https://localhost:8080/",
|
127 |
+
"height": 143
|
128 |
+
},
|
129 |
+
"id": "lIYdn1woOS1n",
|
130 |
+
"outputId": "046caad7-0e5b-4f95-ebb1-ea972539b936"
|
131 |
+
},
|
132 |
+
"outputs": [
|
133 |
+
{
|
134 |
+
"output_type": "execute_result",
|
135 |
+
"data": {
|
136 |
+
"text/plain": [
|
137 |
+
" RI Na Mg Al Si K Ca Ba Fe Type\n",
|
138 |
+
"6 1.51743 13.30 3.60 1.14 73.09 0.58 8.17 0.0 0.0 1\n",
|
139 |
+
"138 1.51674 12.79 3.52 1.54 73.36 0.66 7.90 0.0 0.0 2\n",
|
140 |
+
"40 1.51793 12.79 3.50 1.12 73.03 0.64 8.77 0.0 0.0 1"
|
141 |
+
],
|
142 |
+
"text/html": [
|
143 |
+
"\n",
|
144 |
+
" <div id=\"df-cbce004c-2373-4269-b108-792cb1bca131\" class=\"colab-df-container\">\n",
|
145 |
+
" <div>\n",
|
146 |
+
"<style scoped>\n",
|
147 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
148 |
+
" vertical-align: middle;\n",
|
149 |
+
" }\n",
|
150 |
+
"\n",
|
151 |
+
" .dataframe tbody tr th {\n",
|
152 |
+
" vertical-align: top;\n",
|
153 |
+
" }\n",
|
154 |
+
"\n",
|
155 |
+
" .dataframe thead th {\n",
|
156 |
+
" text-align: right;\n",
|
157 |
+
" }\n",
|
158 |
+
"</style>\n",
|
159 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
160 |
+
" <thead>\n",
|
161 |
+
" <tr style=\"text-align: right;\">\n",
|
162 |
+
" <th></th>\n",
|
163 |
+
" <th>RI</th>\n",
|
164 |
+
" <th>Na</th>\n",
|
165 |
+
" <th>Mg</th>\n",
|
166 |
+
" <th>Al</th>\n",
|
167 |
+
" <th>Si</th>\n",
|
168 |
+
" <th>K</th>\n",
|
169 |
+
" <th>Ca</th>\n",
|
170 |
+
" <th>Ba</th>\n",
|
171 |
+
" <th>Fe</th>\n",
|
172 |
+
" <th>Type</th>\n",
|
173 |
+
" </tr>\n",
|
174 |
+
" </thead>\n",
|
175 |
+
" <tbody>\n",
|
176 |
+
" <tr>\n",
|
177 |
+
" <th>6</th>\n",
|
178 |
+
" <td>1.51743</td>\n",
|
179 |
+
" <td>13.30</td>\n",
|
180 |
+
" <td>3.60</td>\n",
|
181 |
+
" <td>1.14</td>\n",
|
182 |
+
" <td>73.09</td>\n",
|
183 |
+
" <td>0.58</td>\n",
|
184 |
+
" <td>8.17</td>\n",
|
185 |
+
" <td>0.0</td>\n",
|
186 |
+
" <td>0.0</td>\n",
|
187 |
+
" <td>1</td>\n",
|
188 |
+
" </tr>\n",
|
189 |
+
" <tr>\n",
|
190 |
+
" <th>138</th>\n",
|
191 |
+
" <td>1.51674</td>\n",
|
192 |
+
" <td>12.79</td>\n",
|
193 |
+
" <td>3.52</td>\n",
|
194 |
+
" <td>1.54</td>\n",
|
195 |
+
" <td>73.36</td>\n",
|
196 |
+
" <td>0.66</td>\n",
|
197 |
+
" <td>7.90</td>\n",
|
198 |
+
" <td>0.0</td>\n",
|
199 |
+
" <td>0.0</td>\n",
|
200 |
+
" <td>2</td>\n",
|
201 |
+
" </tr>\n",
|
202 |
+
" <tr>\n",
|
203 |
+
" <th>40</th>\n",
|
204 |
+
" <td>1.51793</td>\n",
|
205 |
+
" <td>12.79</td>\n",
|
206 |
+
" <td>3.50</td>\n",
|
207 |
+
" <td>1.12</td>\n",
|
208 |
+
" <td>73.03</td>\n",
|
209 |
+
" <td>0.64</td>\n",
|
210 |
+
" <td>8.77</td>\n",
|
211 |
+
" <td>0.0</td>\n",
|
212 |
+
" <td>0.0</td>\n",
|
213 |
+
" <td>1</td>\n",
|
214 |
+
" </tr>\n",
|
215 |
+
" </tbody>\n",
|
216 |
+
"</table>\n",
|
217 |
+
"</div>\n",
|
218 |
+
" <div class=\"colab-df-buttons\">\n",
|
219 |
+
"\n",
|
220 |
+
" <div class=\"colab-df-container\">\n",
|
221 |
+
" <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-cbce004c-2373-4269-b108-792cb1bca131')\"\n",
|
222 |
+
" title=\"Convert this dataframe to an interactive table.\"\n",
|
223 |
+
" style=\"display:none;\">\n",
|
224 |
+
"\n",
|
225 |
+
" <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\">\n",
|
226 |
+
" <path d=\"M120-120v-720h720v720H120Zm60-500h600v-160H180v160Zm220 220h160v-160H400v160Zm0 220h160v-160H400v160ZM180-400h160v-160H180v160Zm440 0h160v-160H620v160ZM180-180h160v-160H180v160Zm440 0h160v-160H620v160Z\"/>\n",
|
227 |
+
" </svg>\n",
|
228 |
+
" </button>\n",
|
229 |
+
"\n",
|
230 |
+
" <style>\n",
|
231 |
+
" .colab-df-container {\n",
|
232 |
+
" display:flex;\n",
|
233 |
+
" gap: 12px;\n",
|
234 |
+
" }\n",
|
235 |
+
"\n",
|
236 |
+
" .colab-df-convert {\n",
|
237 |
+
" background-color: #E8F0FE;\n",
|
238 |
+
" border: none;\n",
|
239 |
+
" border-radius: 50%;\n",
|
240 |
+
" cursor: pointer;\n",
|
241 |
+
" display: none;\n",
|
242 |
+
" fill: #1967D2;\n",
|
243 |
+
" height: 32px;\n",
|
244 |
+
" padding: 0 0 0 0;\n",
|
245 |
+
" width: 32px;\n",
|
246 |
+
" }\n",
|
247 |
+
"\n",
|
248 |
+
" .colab-df-convert:hover {\n",
|
249 |
+
" background-color: #E2EBFA;\n",
|
250 |
+
" box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
|
251 |
+
" fill: #174EA6;\n",
|
252 |
+
" }\n",
|
253 |
+
"\n",
|
254 |
+
" .colab-df-buttons div {\n",
|
255 |
+
" margin-bottom: 4px;\n",
|
256 |
+
" }\n",
|
257 |
+
"\n",
|
258 |
+
" [theme=dark] .colab-df-convert {\n",
|
259 |
+
" background-color: #3B4455;\n",
|
260 |
+
" fill: #D2E3FC;\n",
|
261 |
+
" }\n",
|
262 |
+
"\n",
|
263 |
+
" [theme=dark] .colab-df-convert:hover {\n",
|
264 |
+
" background-color: #434B5C;\n",
|
265 |
+
" box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n",
|
266 |
+
" filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n",
|
267 |
+
" fill: #FFFFFF;\n",
|
268 |
+
" }\n",
|
269 |
+
" </style>\n",
|
270 |
+
"\n",
|
271 |
+
" <script>\n",
|
272 |
+
" const buttonEl =\n",
|
273 |
+
" document.querySelector('#df-cbce004c-2373-4269-b108-792cb1bca131 button.colab-df-convert');\n",
|
274 |
+
" buttonEl.style.display =\n",
|
275 |
+
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
|
276 |
+
"\n",
|
277 |
+
" async function convertToInteractive(key) {\n",
|
278 |
+
" const element = document.querySelector('#df-cbce004c-2373-4269-b108-792cb1bca131');\n",
|
279 |
+
" const dataTable =\n",
|
280 |
+
" await google.colab.kernel.invokeFunction('convertToInteractive',\n",
|
281 |
+
" [key], {});\n",
|
282 |
+
" if (!dataTable) return;\n",
|
283 |
+
"\n",
|
284 |
+
" const docLinkHtml = 'Like what you see? Visit the ' +\n",
|
285 |
+
" '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n",
|
286 |
+
" + ' to learn more about interactive tables.';\n",
|
287 |
+
" element.innerHTML = '';\n",
|
288 |
+
" dataTable['output_type'] = 'display_data';\n",
|
289 |
+
" await google.colab.output.renderOutput(dataTable, element);\n",
|
290 |
+
" const docLink = document.createElement('div');\n",
|
291 |
+
" docLink.innerHTML = docLinkHtml;\n",
|
292 |
+
" element.appendChild(docLink);\n",
|
293 |
+
" }\n",
|
294 |
+
" </script>\n",
|
295 |
+
" </div>\n",
|
296 |
+
"\n",
|
297 |
+
"\n",
|
298 |
+
"<div id=\"df-5f58b948-c3a9-4d61-8174-2c1825c6237e\">\n",
|
299 |
+
" <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-5f58b948-c3a9-4d61-8174-2c1825c6237e')\"\n",
|
300 |
+
" title=\"Suggest charts\"\n",
|
301 |
+
" style=\"display:none;\">\n",
|
302 |
+
"\n",
|
303 |
+
"<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n",
|
304 |
+
" width=\"24px\">\n",
|
305 |
+
" <g>\n",
|
306 |
+
" <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n",
|
307 |
+
" </g>\n",
|
308 |
+
"</svg>\n",
|
309 |
+
" </button>\n",
|
310 |
+
"\n",
|
311 |
+
"<style>\n",
|
312 |
+
" .colab-df-quickchart {\n",
|
313 |
+
" --bg-color: #E8F0FE;\n",
|
314 |
+
" --fill-color: #1967D2;\n",
|
315 |
+
" --hover-bg-color: #E2EBFA;\n",
|
316 |
+
" --hover-fill-color: #174EA6;\n",
|
317 |
+
" --disabled-fill-color: #AAA;\n",
|
318 |
+
" --disabled-bg-color: #DDD;\n",
|
319 |
+
" }\n",
|
320 |
+
"\n",
|
321 |
+
" [theme=dark] .colab-df-quickchart {\n",
|
322 |
+
" --bg-color: #3B4455;\n",
|
323 |
+
" --fill-color: #D2E3FC;\n",
|
324 |
+
" --hover-bg-color: #434B5C;\n",
|
325 |
+
" --hover-fill-color: #FFFFFF;\n",
|
326 |
+
" --disabled-bg-color: #3B4455;\n",
|
327 |
+
" --disabled-fill-color: #666;\n",
|
328 |
+
" }\n",
|
329 |
+
"\n",
|
330 |
+
" .colab-df-quickchart {\n",
|
331 |
+
" background-color: var(--bg-color);\n",
|
332 |
+
" border: none;\n",
|
333 |
+
" border-radius: 50%;\n",
|
334 |
+
" cursor: pointer;\n",
|
335 |
+
" display: none;\n",
|
336 |
+
" fill: var(--fill-color);\n",
|
337 |
+
" height: 32px;\n",
|
338 |
+
" padding: 0;\n",
|
339 |
+
" width: 32px;\n",
|
340 |
+
" }\n",
|
341 |
+
"\n",
|
342 |
+
" .colab-df-quickchart:hover {\n",
|
343 |
+
" background-color: var(--hover-bg-color);\n",
|
344 |
+
" box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);\n",
|
345 |
+
" fill: var(--button-hover-fill-color);\n",
|
346 |
+
" }\n",
|
347 |
+
"\n",
|
348 |
+
" .colab-df-quickchart-complete:disabled,\n",
|
349 |
+
" .colab-df-quickchart-complete:disabled:hover {\n",
|
350 |
+
" background-color: var(--disabled-bg-color);\n",
|
351 |
+
" fill: var(--disabled-fill-color);\n",
|
352 |
+
" box-shadow: none;\n",
|
353 |
+
" }\n",
|
354 |
+
"\n",
|
355 |
+
" .colab-df-spinner {\n",
|
356 |
+
" border: 2px solid var(--fill-color);\n",
|
357 |
+
" border-color: transparent;\n",
|
358 |
+
" border-bottom-color: var(--fill-color);\n",
|
359 |
+
" animation:\n",
|
360 |
+
" spin 1s steps(1) infinite;\n",
|
361 |
+
" }\n",
|
362 |
+
"\n",
|
363 |
+
" @keyframes spin {\n",
|
364 |
+
" 0% {\n",
|
365 |
+
" border-color: transparent;\n",
|
366 |
+
" border-bottom-color: var(--fill-color);\n",
|
367 |
+
" border-left-color: var(--fill-color);\n",
|
368 |
+
" }\n",
|
369 |
+
" 20% {\n",
|
370 |
+
" border-color: transparent;\n",
|
371 |
+
" border-left-color: var(--fill-color);\n",
|
372 |
+
" border-top-color: var(--fill-color);\n",
|
373 |
+
" }\n",
|
374 |
+
" 30% {\n",
|
375 |
+
" border-color: transparent;\n",
|
376 |
+
" border-left-color: var(--fill-color);\n",
|
377 |
+
" border-top-color: var(--fill-color);\n",
|
378 |
+
" border-right-color: var(--fill-color);\n",
|
379 |
+
" }\n",
|
380 |
+
" 40% {\n",
|
381 |
+
" border-color: transparent;\n",
|
382 |
+
" border-right-color: var(--fill-color);\n",
|
383 |
+
" border-top-color: var(--fill-color);\n",
|
384 |
+
" }\n",
|
385 |
+
" 60% {\n",
|
386 |
+
" border-color: transparent;\n",
|
387 |
+
" border-right-color: var(--fill-color);\n",
|
388 |
+
" }\n",
|
389 |
+
" 80% {\n",
|
390 |
+
" border-color: transparent;\n",
|
391 |
+
" border-right-color: var(--fill-color);\n",
|
392 |
+
" border-bottom-color: var(--fill-color);\n",
|
393 |
+
" }\n",
|
394 |
+
" 90% {\n",
|
395 |
+
" border-color: transparent;\n",
|
396 |
+
" border-bottom-color: var(--fill-color);\n",
|
397 |
+
" }\n",
|
398 |
+
" }\n",
|
399 |
+
"</style>\n",
|
400 |
+
"\n",
|
401 |
+
" <script>\n",
|
402 |
+
" async function quickchart(key) {\n",
|
403 |
+
" const quickchartButtonEl =\n",
|
404 |
+
" document.querySelector('#' + key + ' button');\n",
|
405 |
+
" quickchartButtonEl.disabled = true; // To prevent multiple clicks.\n",
|
406 |
+
" quickchartButtonEl.classList.add('colab-df-spinner');\n",
|
407 |
+
" try {\n",
|
408 |
+
" const charts = await google.colab.kernel.invokeFunction(\n",
|
409 |
+
" 'suggestCharts', [key], {});\n",
|
410 |
+
" } catch (error) {\n",
|
411 |
+
" console.error('Error during call to suggestCharts:', error);\n",
|
412 |
+
" }\n",
|
413 |
+
" quickchartButtonEl.classList.remove('colab-df-spinner');\n",
|
414 |
+
" quickchartButtonEl.classList.add('colab-df-quickchart-complete');\n",
|
415 |
+
" }\n",
|
416 |
+
" (() => {\n",
|
417 |
+
" let quickchartButtonEl =\n",
|
418 |
+
" document.querySelector('#df-5f58b948-c3a9-4d61-8174-2c1825c6237e button');\n",
|
419 |
+
" quickchartButtonEl.style.display =\n",
|
420 |
+
" google.colab.kernel.accessAllowed ? 'block' : 'none';\n",
|
421 |
+
" })();\n",
|
422 |
+
" </script>\n",
|
423 |
+
"</div>\n",
|
424 |
+
"\n",
|
425 |
+
" </div>\n",
|
426 |
+
" </div>\n"
|
427 |
+
]
|
428 |
+
},
|
429 |
+
"metadata": {},
|
430 |
+
"execution_count": 3
|
431 |
+
}
|
432 |
+
],
|
433 |
+
"source": [
|
434 |
+
"import pandas as pd\n",
|
435 |
+
"glass_df = pd.read_csv(\"/content/glass/glass.csv\")\n",
|
436 |
+
"glass_df = glass_df.sample(frac = 1)\n",
|
437 |
+
"glass_df.head(3)"
|
438 |
+
]
|
439 |
+
},
|
440 |
+
{
|
441 |
+
"cell_type": "code",
|
442 |
+
"source": [
|
443 |
+
"from sklearn.model_selection import train_test_split\n",
|
444 |
+
"\n",
|
445 |
+
"X = glass_df.drop(\"Type\",axis=1)\n",
|
446 |
+
"y = glass_df.Type\n",
|
447 |
+
"\n",
|
448 |
+
"X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=125)"
|
449 |
+
],
|
450 |
+
"metadata": {
|
451 |
+
"id": "7_eWUKS6hV2o"
|
452 |
+
},
|
453 |
+
"execution_count": 4,
|
454 |
+
"outputs": []
|
455 |
+
},
|
456 |
+
{
|
457 |
+
"cell_type": "code",
|
458 |
+
"source": [
|
459 |
+
"from sklearn.ensemble import RandomForestClassifier\n",
|
460 |
+
"from sklearn.preprocessing import StandardScaler\n",
|
461 |
+
"from sklearn.impute import SimpleImputer\n",
|
462 |
+
"from sklearn.pipeline import Pipeline\n",
|
463 |
+
"\n",
|
464 |
+
"\n",
|
465 |
+
"pipe = Pipeline(\n",
|
466 |
+
" steps=[\n",
|
467 |
+
" (\"imputer\", SimpleImputer()),\n",
|
468 |
+
" (\"scaler\", StandardScaler()),\n",
|
469 |
+
" (\"model\", RandomForestClassifier(n_estimators=100, random_state=125)),\n",
|
470 |
+
" ]\n",
|
471 |
+
")\n",
|
472 |
+
"pipe.fit(X_train, y_train)\n",
|
473 |
+
"\n",
|
474 |
+
"pipe.score(X_test, y_test)"
|
475 |
+
],
|
476 |
+
"metadata": {
|
477 |
+
"colab": {
|
478 |
+
"base_uri": "https://localhost:8080/"
|
479 |
+
},
|
480 |
+
"id": "MTMLGHGuhvAA",
|
481 |
+
"outputId": "cb35ca9e-8e24-49ec-8c9b-06d195905fd1"
|
482 |
+
},
|
483 |
+
"execution_count": 5,
|
484 |
+
"outputs": [
|
485 |
+
{
|
486 |
+
"output_type": "execute_result",
|
487 |
+
"data": {
|
488 |
+
"text/plain": [
|
489 |
+
"0.8"
|
490 |
+
]
|
491 |
+
},
|
492 |
+
"metadata": {},
|
493 |
+
"execution_count": 5
|
494 |
+
}
|
495 |
+
]
|
496 |
+
},
|
497 |
+
{
|
498 |
+
"cell_type": "code",
|
499 |
+
"source": [
|
500 |
+
"from sklearn.metrics import classification_report\n",
|
501 |
+
"\n",
|
502 |
+
"y_pred = pipe.predict(X_test)\n",
|
503 |
+
"print(classification_report(y_test,y_pred))"
|
504 |
+
],
|
505 |
+
"metadata": {
|
506 |
+
"colab": {
|
507 |
+
"base_uri": "https://localhost:8080/"
|
508 |
+
},
|
509 |
+
"id": "EREHPUy_h0Zq",
|
510 |
+
"outputId": "46d7bc64-0ddb-4be1-fbfb-b43c7ded4e35"
|
511 |
+
},
|
512 |
+
"execution_count": 6,
|
513 |
+
"outputs": [
|
514 |
+
{
|
515 |
+
"output_type": "stream",
|
516 |
+
"name": "stdout",
|
517 |
+
"text": [
|
518 |
+
" precision recall f1-score support\n",
|
519 |
+
"\n",
|
520 |
+
" 1 0.81 0.92 0.86 24\n",
|
521 |
+
" 2 0.75 0.88 0.81 17\n",
|
522 |
+
" 3 0.67 0.25 0.36 8\n",
|
523 |
+
" 5 0.67 0.67 0.67 3\n",
|
524 |
+
" 6 1.00 1.00 1.00 3\n",
|
525 |
+
" 7 0.89 0.80 0.84 10\n",
|
526 |
+
"\n",
|
527 |
+
" accuracy 0.80 65\n",
|
528 |
+
" macro avg 0.80 0.75 0.76 65\n",
|
529 |
+
"weighted avg 0.79 0.80 0.78 65\n",
|
530 |
+
"\n"
|
531 |
+
]
|
532 |
+
}
|
533 |
+
]
|
534 |
+
},
|
535 |
+
{
|
536 |
+
"cell_type": "code",
|
537 |
+
"source": [
|
538 |
+
"!pip install skops"
|
539 |
+
],
|
540 |
+
"metadata": {
|
541 |
+
"colab": {
|
542 |
+
"base_uri": "https://localhost:8080/"
|
543 |
+
},
|
544 |
+
"id": "56jjXsBxiAiB",
|
545 |
+
"outputId": "27f71a89-8eec-4e8a-b23b-f3f1f7329cbe"
|
546 |
+
},
|
547 |
+
"execution_count": 8,
|
548 |
+
"outputs": [
|
549 |
+
{
|
550 |
+
"output_type": "stream",
|
551 |
+
"name": "stdout",
|
552 |
+
"text": [
|
553 |
+
"Collecting skops\n",
|
554 |
+
" Downloading skops-0.9.0-py3-none-any.whl (120 kB)\n",
|
555 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m120.7/120.7 kB\u001b[0m \u001b[31m1.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
556 |
+
"\u001b[?25hRequirement already satisfied: scikit-learn>=0.24 in /usr/local/lib/python3.10/dist-packages (from skops) (1.2.2)\n",
|
557 |
+
"Requirement already satisfied: huggingface-hub>=0.17.0 in /usr/local/lib/python3.10/dist-packages (from skops) (0.19.4)\n",
|
558 |
+
"Requirement already satisfied: tabulate>=0.8.8 in /usr/local/lib/python3.10/dist-packages (from skops) (0.9.0)\n",
|
559 |
+
"Requirement already satisfied: packaging>=17.0 in /usr/local/lib/python3.10/dist-packages (from skops) (23.2)\n",
|
560 |
+
"Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from huggingface-hub>=0.17.0->skops) (3.13.1)\n",
|
561 |
+
"Requirement already satisfied: fsspec>=2023.5.0 in /usr/local/lib/python3.10/dist-packages (from huggingface-hub>=0.17.0->skops) (2023.6.0)\n",
|
562 |
+
"Requirement already satisfied: requests in /usr/local/lib/python3.10/dist-packages (from huggingface-hub>=0.17.0->skops) (2.31.0)\n",
|
563 |
+
"Requirement already satisfied: tqdm>=4.42.1 in /usr/local/lib/python3.10/dist-packages (from huggingface-hub>=0.17.0->skops) (4.66.1)\n",
|
564 |
+
"Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.10/dist-packages (from huggingface-hub>=0.17.0->skops) (6.0.1)\n",
|
565 |
+
"Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.10/dist-packages (from huggingface-hub>=0.17.0->skops) (4.5.0)\n",
|
566 |
+
"Requirement already satisfied: numpy>=1.17.3 in /usr/local/lib/python3.10/dist-packages (from scikit-learn>=0.24->skops) (1.23.5)\n",
|
567 |
+
"Requirement already satisfied: scipy>=1.3.2 in /usr/local/lib/python3.10/dist-packages (from scikit-learn>=0.24->skops) (1.11.4)\n",
|
568 |
+
"Requirement already satisfied: joblib>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from scikit-learn>=0.24->skops) (1.3.2)\n",
|
569 |
+
"Requirement already satisfied: threadpoolctl>=2.0.0 in /usr/local/lib/python3.10/dist-packages (from scikit-learn>=0.24->skops) (3.2.0)\n",
|
570 |
+
"Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests->huggingface-hub>=0.17.0->skops) (3.3.2)\n",
|
571 |
+
"Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests->huggingface-hub>=0.17.0->skops) (3.6)\n",
|
572 |
+
"Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests->huggingface-hub>=0.17.0->skops) (2.0.7)\n",
|
573 |
+
"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests->huggingface-hub>=0.17.0->skops) (2023.11.17)\n",
|
574 |
+
"Installing collected packages: skops\n",
|
575 |
+
"Successfully installed skops-0.9.0\n"
|
576 |
+
]
|
577 |
+
}
|
578 |
+
]
|
579 |
+
},
|
580 |
+
{
|
581 |
+
"cell_type": "code",
|
582 |
+
"source": [
|
583 |
+
"import skops.io as sio\n",
|
584 |
+
"sio.dump(pipe, \"glass_pipeline.skops\")"
|
585 |
+
],
|
586 |
+
"metadata": {
|
587 |
+
"id": "wZARmF26h4S9"
|
588 |
+
},
|
589 |
+
"execution_count": 9,
|
590 |
+
"outputs": []
|
591 |
+
},
|
592 |
+
{
|
593 |
+
"cell_type": "code",
|
594 |
+
"source": [
|
595 |
+
"sio.load(\"glass_pipeline.skops\", trusted=True)\n"
|
596 |
+
],
|
597 |
+
"metadata": {
|
598 |
+
"colab": {
|
599 |
+
"base_uri": "https://localhost:8080/",
|
600 |
+
"height": 161
|
601 |
+
},
|
602 |
+
"id": "DQ1zj-mjiIRL",
|
603 |
+
"outputId": "00d4ebb0-2f95-45f7-972f-05c257a3af53"
|
604 |
+
},
|
605 |
+
"execution_count": 10,
|
606 |
+
"outputs": [
|
607 |
+
{
|
608 |
+
"output_type": "execute_result",
|
609 |
+
"data": {
|
610 |
+
"text/plain": [
|
611 |
+
"Pipeline(steps=[('imputer', SimpleImputer()), ('scaler', StandardScaler()),\n",
|
612 |
+
" ('model', RandomForestClassifier(random_state=125))])"
|
613 |
+
],
|
614 |
+
"text/html": [
|
615 |
+
"<style>#sk-container-id-1 {color: black;background-color: white;}#sk-container-id-1 pre{padding: 0;}#sk-container-id-1 div.sk-toggleable {background-color: white;}#sk-container-id-1 label.sk-toggleable__label {cursor: pointer;display: block;width: 100%;margin-bottom: 0;padding: 0.3em;box-sizing: border-box;text-align: center;}#sk-container-id-1 label.sk-toggleable__label-arrow:before {content: \"βΈ\";float: left;margin-right: 0.25em;color: #696969;}#sk-container-id-1 label.sk-toggleable__label-arrow:hover:before {color: black;}#sk-container-id-1 div.sk-estimator:hover label.sk-toggleable__label-arrow:before {color: black;}#sk-container-id-1 div.sk-toggleable__content {max-height: 0;max-width: 0;overflow: hidden;text-align: left;background-color: #f0f8ff;}#sk-container-id-1 div.sk-toggleable__content pre {margin: 0.2em;color: black;border-radius: 0.25em;background-color: #f0f8ff;}#sk-container-id-1 input.sk-toggleable__control:checked~div.sk-toggleable__content {max-height: 200px;max-width: 100%;overflow: auto;}#sk-container-id-1 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {content: \"βΎ\";}#sk-container-id-1 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-1 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-1 input.sk-hidden--visually {border: 0;clip: rect(1px 1px 1px 1px);clip: rect(1px, 1px, 1px, 1px);height: 1px;margin: -1px;overflow: hidden;padding: 0;position: absolute;width: 1px;}#sk-container-id-1 div.sk-estimator {font-family: monospace;background-color: #f0f8ff;border: 1px dotted black;border-radius: 0.25em;box-sizing: border-box;margin-bottom: 0.5em;}#sk-container-id-1 div.sk-estimator:hover {background-color: #d4ebff;}#sk-container-id-1 div.sk-parallel-item::after {content: \"\";width: 100%;border-bottom: 1px solid gray;flex-grow: 1;}#sk-container-id-1 div.sk-label:hover label.sk-toggleable__label {background-color: #d4ebff;}#sk-container-id-1 div.sk-serial::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: 0;}#sk-container-id-1 div.sk-serial {display: flex;flex-direction: column;align-items: center;background-color: white;padding-right: 0.2em;padding-left: 0.2em;position: relative;}#sk-container-id-1 div.sk-item {position: relative;z-index: 1;}#sk-container-id-1 div.sk-parallel {display: flex;align-items: stretch;justify-content: center;background-color: white;position: relative;}#sk-container-id-1 div.sk-item::before, #sk-container-id-1 div.sk-parallel-item::before {content: \"\";position: absolute;border-left: 1px solid gray;box-sizing: border-box;top: 0;bottom: 0;left: 50%;z-index: -1;}#sk-container-id-1 div.sk-parallel-item {display: flex;flex-direction: column;z-index: 1;position: relative;background-color: white;}#sk-container-id-1 div.sk-parallel-item:first-child::after {align-self: flex-end;width: 50%;}#sk-container-id-1 div.sk-parallel-item:last-child::after {align-self: flex-start;width: 50%;}#sk-container-id-1 div.sk-parallel-item:only-child::after {width: 0;}#sk-container-id-1 div.sk-dashed-wrapped {border: 1px dashed gray;margin: 0 0.4em 0.5em 0.4em;box-sizing: border-box;padding-bottom: 0.4em;background-color: white;}#sk-container-id-1 div.sk-label label {font-family: monospace;font-weight: bold;display: inline-block;line-height: 1.2em;}#sk-container-id-1 div.sk-label-container {text-align: center;}#sk-container-id-1 div.sk-container {/* jupyter's `normalize.less` sets `[hidden] { display: none; }` but bootstrap.min.css set `[hidden] { display: none !important; }` so we also need the `!important` here to be able to override the default hidden behavior on the sphinx rendered scikit-learn.org. See: https://github.com/scikit-learn/scikit-learn/issues/21755 */display: inline-block !important;position: relative;}#sk-container-id-1 div.sk-text-repr-fallback {display: none;}</style><div id=\"sk-container-id-1\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>Pipeline(steps=[('imputer', SimpleImputer()), ('scaler', StandardScaler()),\n",
|
616 |
+
" ('model', RandomForestClassifier(random_state=125))])</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item sk-dashed-wrapped\"><div class=\"sk-label-container\"><div class=\"sk-label sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-1\" type=\"checkbox\" ><label for=\"sk-estimator-id-1\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">Pipeline</label><div class=\"sk-toggleable__content\"><pre>Pipeline(steps=[('imputer', SimpleImputer()), ('scaler', StandardScaler()),\n",
|
617 |
+
" ('model', RandomForestClassifier(random_state=125))])</pre></div></div></div><div class=\"sk-serial\"><div class=\"sk-item\"><div class=\"sk-estimator sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-2\" type=\"checkbox\" ><label for=\"sk-estimator-id-2\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">SimpleImputer</label><div class=\"sk-toggleable__content\"><pre>SimpleImputer()</pre></div></div></div><div class=\"sk-item\"><div class=\"sk-estimator sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-3\" type=\"checkbox\" ><label for=\"sk-estimator-id-3\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">StandardScaler</label><div class=\"sk-toggleable__content\"><pre>StandardScaler()</pre></div></div></div><div class=\"sk-item\"><div class=\"sk-estimator sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-4\" type=\"checkbox\" ><label for=\"sk-estimator-id-4\" class=\"sk-toggleable__label sk-toggleable__label-arrow\">RandomForestClassifier</label><div class=\"sk-toggleable__content\"><pre>RandomForestClassifier(random_state=125)</pre></div></div></div></div></div></div></div>"
|
618 |
+
]
|
619 |
+
},
|
620 |
+
"metadata": {},
|
621 |
+
"execution_count": 10
|
622 |
+
}
|
623 |
+
]
|
624 |
+
},
|
625 |
+
{
|
626 |
+
"cell_type": "code",
|
627 |
+
"source": [
|
628 |
+
"!pip install gradio"
|
629 |
+
],
|
630 |
+
"metadata": {
|
631 |
+
"colab": {
|
632 |
+
"base_uri": "https://localhost:8080/"
|
633 |
+
},
|
634 |
+
"id": "beFfVpBQiWMo",
|
635 |
+
"outputId": "2ade8915-50a8-44c2-c53a-b7bd0583f8fb"
|
636 |
+
},
|
637 |
+
"execution_count": 12,
|
638 |
+
"outputs": [
|
639 |
+
{
|
640 |
+
"output_type": "stream",
|
641 |
+
"name": "stdout",
|
642 |
+
"text": [
|
643 |
+
"Collecting gradio\n",
|
644 |
+
" Downloading gradio-4.12.0-py3-none-any.whl (16.6 MB)\n",
|
645 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m16.6/16.6 MB\u001b[0m \u001b[31m42.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
646 |
+
"\u001b[?25hCollecting aiofiles<24.0,>=22.0 (from gradio)\n",
|
647 |
+
" Downloading aiofiles-23.2.1-py3-none-any.whl (15 kB)\n",
|
648 |
+
"Requirement already satisfied: altair<6.0,>=4.2.0 in /usr/local/lib/python3.10/dist-packages (from gradio) (4.2.2)\n",
|
649 |
+
"Collecting fastapi (from gradio)\n",
|
650 |
+
" Downloading fastapi-0.108.0-py3-none-any.whl (92 kB)\n",
|
651 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m92.0/92.0 kB\u001b[0m \u001b[31m12.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
652 |
+
"\u001b[?25hCollecting ffmpy (from gradio)\n",
|
653 |
+
" Downloading ffmpy-0.3.1.tar.gz (5.5 kB)\n",
|
654 |
+
" Preparing metadata (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
|
655 |
+
"Collecting gradio-client==0.8.0 (from gradio)\n",
|
656 |
+
" Downloading gradio_client-0.8.0-py3-none-any.whl (305 kB)\n",
|
657 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m305.1/305.1 kB\u001b[0m \u001b[31m30.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
658 |
+
"\u001b[?25hCollecting httpx (from gradio)\n",
|
659 |
+
" Downloading httpx-0.26.0-py3-none-any.whl (75 kB)\n",
|
660 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m75.9/75.9 kB\u001b[0m \u001b[31m8.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
661 |
+
"\u001b[?25hRequirement already satisfied: huggingface-hub>=0.19.3 in /usr/local/lib/python3.10/dist-packages (from gradio) (0.19.4)\n",
|
662 |
+
"Requirement already satisfied: importlib-resources<7.0,>=1.3 in /usr/local/lib/python3.10/dist-packages (from gradio) (6.1.1)\n",
|
663 |
+
"Requirement already satisfied: jinja2<4.0 in /usr/local/lib/python3.10/dist-packages (from gradio) (3.1.2)\n",
|
664 |
+
"Requirement already satisfied: markupsafe~=2.0 in /usr/local/lib/python3.10/dist-packages (from gradio) (2.1.3)\n",
|
665 |
+
"Requirement already satisfied: matplotlib~=3.0 in /usr/local/lib/python3.10/dist-packages (from gradio) (3.7.1)\n",
|
666 |
+
"Requirement already satisfied: numpy~=1.0 in /usr/local/lib/python3.10/dist-packages (from gradio) (1.23.5)\n",
|
667 |
+
"Collecting orjson~=3.0 (from gradio)\n",
|
668 |
+
" Downloading orjson-3.9.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (138 kB)\n",
|
669 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m138.7/138.7 kB\u001b[0m \u001b[31m15.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
670 |
+
"\u001b[?25hRequirement already satisfied: packaging in /usr/local/lib/python3.10/dist-packages (from gradio) (23.2)\n",
|
671 |
+
"Requirement already satisfied: pandas<3.0,>=1.0 in /usr/local/lib/python3.10/dist-packages (from gradio) (1.5.3)\n",
|
672 |
+
"Requirement already satisfied: pillow<11.0,>=8.0 in /usr/local/lib/python3.10/dist-packages (from gradio) (9.4.0)\n",
|
673 |
+
"Collecting pydantic>=2.0 (from gradio)\n",
|
674 |
+
" Downloading pydantic-2.5.3-py3-none-any.whl (381 kB)\n",
|
675 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m381.9/381.9 kB\u001b[0m \u001b[31m34.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
676 |
+
"\u001b[?25hCollecting pydub (from gradio)\n",
|
677 |
+
" Downloading pydub-0.25.1-py2.py3-none-any.whl (32 kB)\n",
|
678 |
+
"Collecting python-multipart (from gradio)\n",
|
679 |
+
" Downloading python_multipart-0.0.6-py3-none-any.whl (45 kB)\n",
|
680 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m45.7/45.7 kB\u001b[0m \u001b[31m5.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
681 |
+
"\u001b[?25hRequirement already satisfied: pyyaml<7.0,>=5.0 in /usr/local/lib/python3.10/dist-packages (from gradio) (6.0.1)\n",
|
682 |
+
"Collecting semantic-version~=2.0 (from gradio)\n",
|
683 |
+
" Downloading semantic_version-2.10.0-py2.py3-none-any.whl (15 kB)\n",
|
684 |
+
"Collecting tomlkit==0.12.0 (from gradio)\n",
|
685 |
+
" Downloading tomlkit-0.12.0-py3-none-any.whl (37 kB)\n",
|
686 |
+
"Requirement already satisfied: typer[all]<1.0,>=0.9 in /usr/local/lib/python3.10/dist-packages (from gradio) (0.9.0)\n",
|
687 |
+
"Requirement already satisfied: typing-extensions~=4.0 in /usr/local/lib/python3.10/dist-packages (from gradio) (4.5.0)\n",
|
688 |
+
"Collecting uvicorn>=0.14.0 (from gradio)\n",
|
689 |
+
" Downloading uvicorn-0.25.0-py3-none-any.whl (60 kB)\n",
|
690 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m60.3/60.3 kB\u001b[0m \u001b[31m7.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
691 |
+
"\u001b[?25hRequirement already satisfied: fsspec in /usr/local/lib/python3.10/dist-packages (from gradio-client==0.8.0->gradio) (2023.6.0)\n",
|
692 |
+
"Collecting websockets<12.0,>=10.0 (from gradio-client==0.8.0->gradio)\n",
|
693 |
+
" Downloading websockets-11.0.3-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (129 kB)\n",
|
694 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m129.9/129.9 kB\u001b[0m \u001b[31m14.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
695 |
+
"\u001b[?25hRequirement already satisfied: entrypoints in /usr/local/lib/python3.10/dist-packages (from altair<6.0,>=4.2.0->gradio) (0.4)\n",
|
696 |
+
"Requirement already satisfied: jsonschema>=3.0 in /usr/local/lib/python3.10/dist-packages (from altair<6.0,>=4.2.0->gradio) (4.19.2)\n",
|
697 |
+
"Requirement already satisfied: toolz in /usr/local/lib/python3.10/dist-packages (from altair<6.0,>=4.2.0->gradio) (0.12.0)\n",
|
698 |
+
"Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from huggingface-hub>=0.19.3->gradio) (3.13.1)\n",
|
699 |
+
"Requirement already satisfied: requests in /usr/local/lib/python3.10/dist-packages (from huggingface-hub>=0.19.3->gradio) (2.31.0)\n",
|
700 |
+
"Requirement already satisfied: tqdm>=4.42.1 in /usr/local/lib/python3.10/dist-packages (from huggingface-hub>=0.19.3->gradio) (4.66.1)\n",
|
701 |
+
"Requirement already satisfied: contourpy>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib~=3.0->gradio) (1.2.0)\n",
|
702 |
+
"Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.10/dist-packages (from matplotlib~=3.0->gradio) (0.12.1)\n",
|
703 |
+
"Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib~=3.0->gradio) (4.46.0)\n",
|
704 |
+
"Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib~=3.0->gradio) (1.4.5)\n",
|
705 |
+
"Requirement already satisfied: pyparsing>=2.3.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib~=3.0->gradio) (3.1.1)\n",
|
706 |
+
"Requirement already satisfied: python-dateutil>=2.7 in /usr/local/lib/python3.10/dist-packages (from matplotlib~=3.0->gradio) (2.8.2)\n",
|
707 |
+
"Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.10/dist-packages (from pandas<3.0,>=1.0->gradio) (2023.3.post1)\n",
|
708 |
+
"Collecting annotated-types>=0.4.0 (from pydantic>=2.0->gradio)\n",
|
709 |
+
" Downloading annotated_types-0.6.0-py3-none-any.whl (12 kB)\n",
|
710 |
+
"Collecting pydantic-core==2.14.6 (from pydantic>=2.0->gradio)\n",
|
711 |
+
" Downloading pydantic_core-2.14.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.1 MB)\n",
|
712 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m2.1/2.1 MB\u001b[0m \u001b[31m40.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
713 |
+
"\u001b[?25hCollecting typing-extensions~=4.0 (from gradio)\n",
|
714 |
+
" Downloading typing_extensions-4.9.0-py3-none-any.whl (32 kB)\n",
|
715 |
+
"Requirement already satisfied: click<9.0.0,>=7.1.1 in /usr/local/lib/python3.10/dist-packages (from typer[all]<1.0,>=0.9->gradio) (8.1.7)\n",
|
716 |
+
"Collecting colorama<0.5.0,>=0.4.3 (from typer[all]<1.0,>=0.9->gradio)\n",
|
717 |
+
" Downloading colorama-0.4.6-py2.py3-none-any.whl (25 kB)\n",
|
718 |
+
"Collecting shellingham<2.0.0,>=1.3.0 (from typer[all]<1.0,>=0.9->gradio)\n",
|
719 |
+
" Downloading shellingham-1.5.4-py2.py3-none-any.whl (9.8 kB)\n",
|
720 |
+
"Requirement already satisfied: rich<14.0.0,>=10.11.0 in /usr/local/lib/python3.10/dist-packages (from typer[all]<1.0,>=0.9->gradio) (13.7.0)\n",
|
721 |
+
"Collecting h11>=0.8 (from uvicorn>=0.14.0->gradio)\n",
|
722 |
+
" Downloading h11-0.14.0-py3-none-any.whl (58 kB)\n",
|
723 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m58.3/58.3 kB\u001b[0m \u001b[31m7.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
724 |
+
"\u001b[?25hCollecting starlette<0.33.0,>=0.29.0 (from fastapi->gradio)\n",
|
725 |
+
" Downloading starlette-0.32.0.post1-py3-none-any.whl (70 kB)\n",
|
726 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m70.0/70.0 kB\u001b[0m \u001b[31m8.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
727 |
+
"\u001b[?25hRequirement already satisfied: anyio in /usr/local/lib/python3.10/dist-packages (from httpx->gradio) (3.7.1)\n",
|
728 |
+
"Requirement already satisfied: certifi in /usr/local/lib/python3.10/dist-packages (from httpx->gradio) (2023.11.17)\n",
|
729 |
+
"Collecting httpcore==1.* (from httpx->gradio)\n",
|
730 |
+
" Downloading httpcore-1.0.2-py3-none-any.whl (76 kB)\n",
|
731 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m76.9/76.9 kB\u001b[0m \u001b[31m10.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
732 |
+
"\u001b[?25hRequirement already satisfied: idna in /usr/local/lib/python3.10/dist-packages (from httpx->gradio) (3.6)\n",
|
733 |
+
"Requirement already satisfied: sniffio in /usr/local/lib/python3.10/dist-packages (from httpx->gradio) (1.3.0)\n",
|
734 |
+
"Requirement already satisfied: attrs>=22.2.0 in /usr/local/lib/python3.10/dist-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (23.1.0)\n",
|
735 |
+
"Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /usr/local/lib/python3.10/dist-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (2023.11.2)\n",
|
736 |
+
"Requirement already satisfied: referencing>=0.28.4 in /usr/local/lib/python3.10/dist-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (0.32.0)\n",
|
737 |
+
"Requirement already satisfied: rpds-py>=0.7.1 in /usr/local/lib/python3.10/dist-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (0.15.2)\n",
|
738 |
+
"Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil>=2.7->matplotlib~=3.0->gradio) (1.16.0)\n",
|
739 |
+
"Requirement already satisfied: markdown-it-py>=2.2.0 in /usr/local/lib/python3.10/dist-packages (from rich<14.0.0,>=10.11.0->typer[all]<1.0,>=0.9->gradio) (3.0.0)\n",
|
740 |
+
"Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /usr/local/lib/python3.10/dist-packages (from rich<14.0.0,>=10.11.0->typer[all]<1.0,>=0.9->gradio) (2.16.1)\n",
|
741 |
+
"Requirement already satisfied: exceptiongroup in /usr/local/lib/python3.10/dist-packages (from anyio->httpx->gradio) (1.2.0)\n",
|
742 |
+
"Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests->huggingface-hub>=0.19.3->gradio) (3.3.2)\n",
|
743 |
+
"Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests->huggingface-hub>=0.19.3->gradio) (2.0.7)\n",
|
744 |
+
"Requirement already satisfied: mdurl~=0.1 in /usr/local/lib/python3.10/dist-packages (from markdown-it-py>=2.2.0->rich<14.0.0,>=10.11.0->typer[all]<1.0,>=0.9->gradio) (0.1.2)\n",
|
745 |
+
"Building wheels for collected packages: ffmpy\n",
|
746 |
+
" Building wheel for ffmpy (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
|
747 |
+
" Created wheel for ffmpy: filename=ffmpy-0.3.1-py3-none-any.whl size=5579 sha256=88940a0ba2d1088e0d93a684f25374ff2dfc47a1278ffaa94013d7b19a45d13f\n",
|
748 |
+
" Stored in directory: /root/.cache/pip/wheels/01/a6/d1/1c0828c304a4283b2c1639a09ad86f83d7c487ef34c6b4a1bf\n",
|
749 |
+
"Successfully built ffmpy\n",
|
750 |
+
"Installing collected packages: pydub, ffmpy, websockets, typing-extensions, tomlkit, shellingham, semantic-version, python-multipart, orjson, h11, colorama, annotated-types, aiofiles, uvicorn, starlette, pydantic-core, httpcore, pydantic, httpx, gradio-client, fastapi, gradio\n",
|
751 |
+
" Attempting uninstall: typing-extensions\n",
|
752 |
+
" Found existing installation: typing_extensions 4.5.0\n",
|
753 |
+
" Uninstalling typing_extensions-4.5.0:\n",
|
754 |
+
" Successfully uninstalled typing_extensions-4.5.0\n",
|
755 |
+
" Attempting uninstall: pydantic\n",
|
756 |
+
" Found existing installation: pydantic 1.10.13\n",
|
757 |
+
" Uninstalling pydantic-1.10.13:\n",
|
758 |
+
" Successfully uninstalled pydantic-1.10.13\n",
|
759 |
+
"\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n",
|
760 |
+
"lida 0.0.10 requires kaleido, which is not installed.\n",
|
761 |
+
"llmx 0.0.15a0 requires cohere, which is not installed.\n",
|
762 |
+
"llmx 0.0.15a0 requires openai, which is not installed.\n",
|
763 |
+
"llmx 0.0.15a0 requires tiktoken, which is not installed.\n",
|
764 |
+
"tensorflow-probability 0.22.0 requires typing-extensions<4.6.0, but you have typing-extensions 4.9.0 which is incompatible.\u001b[0m\u001b[31m\n",
|
765 |
+
"\u001b[0mSuccessfully installed aiofiles-23.2.1 annotated-types-0.6.0 colorama-0.4.6 fastapi-0.108.0 ffmpy-0.3.1 gradio-4.12.0 gradio-client-0.8.0 h11-0.14.0 httpcore-1.0.2 httpx-0.26.0 orjson-3.9.10 pydantic-2.5.3 pydantic-core-2.14.6 pydub-0.25.1 python-multipart-0.0.6 semantic-version-2.10.0 shellingham-1.5.4 starlette-0.32.0.post1 tomlkit-0.12.0 typing-extensions-4.9.0 uvicorn-0.25.0 websockets-11.0.3\n"
|
766 |
+
]
|
767 |
+
}
|
768 |
+
]
|
769 |
+
},
|
770 |
+
{
|
771 |
+
"cell_type": "code",
|
772 |
+
"source": [
|
773 |
+
"!pip install --upgrade typing\n",
|
774 |
+
"\n"
|
775 |
+
],
|
776 |
+
"metadata": {
|
777 |
+
"colab": {
|
778 |
+
"base_uri": "https://localhost:8080/",
|
779 |
+
"height": 324
|
780 |
+
},
|
781 |
+
"id": "hkRt-nm-i7n3",
|
782 |
+
"outputId": "c5674dce-ad3d-4d5b-c6e5-2c6b32b1f8dd"
|
783 |
+
},
|
784 |
+
"execution_count": 16,
|
785 |
+
"outputs": [
|
786 |
+
{
|
787 |
+
"output_type": "stream",
|
788 |
+
"name": "stdout",
|
789 |
+
"text": [
|
790 |
+
"Collecting typing\n",
|
791 |
+
" Downloading typing-3.7.4.3.tar.gz (78 kB)\n",
|
792 |
+
"\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m78.6/78.6 kB\u001b[0m \u001b[31m1.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
793 |
+
"\u001b[?25h Preparing metadata (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
|
794 |
+
"Building wheels for collected packages: typing\n",
|
795 |
+
" Building wheel for typing (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
|
796 |
+
" Created wheel for typing: filename=typing-3.7.4.3-py3-none-any.whl size=26304 sha256=bf404f3c867298c09d5af2c5776ea8cc26cf0f9dd1dddf01a02d6bf8226939a3\n",
|
797 |
+
" Stored in directory: /root/.cache/pip/wheels/7c/d0/9e/1f26ebb66d9e1732e4098bc5a6c2d91f6c9a529838f0284890\n",
|
798 |
+
"Successfully built typing\n",
|
799 |
+
"Installing collected packages: typing\n",
|
800 |
+
"Successfully installed typing-3.7.4.3\n"
|
801 |
+
]
|
802 |
+
},
|
803 |
+
{
|
804 |
+
"output_type": "display_data",
|
805 |
+
"data": {
|
806 |
+
"application/vnd.colab-display-data+json": {
|
807 |
+
"pip_warning": {
|
808 |
+
"packages": [
|
809 |
+
"typing"
|
810 |
+
]
|
811 |
+
}
|
812 |
+
}
|
813 |
+
},
|
814 |
+
"metadata": {}
|
815 |
+
}
|
816 |
+
]
|
817 |
+
},
|
818 |
+
{
|
819 |
+
"cell_type": "code",
|
820 |
+
"source": [
|
821 |
+
"import gradio as gr\n",
|
822 |
+
"import skops.io as sio\n",
|
823 |
+
"\n",
|
824 |
+
"pipe = sio.load(\"glass_pipeline.skops\", trusted=True)\n",
|
825 |
+
"\n",
|
826 |
+
"classes = [\n",
|
827 |
+
" \"None\",\n",
|
828 |
+
" \"Building Windows Float Processed\",\n",
|
829 |
+
" \"Building Windows Non Float Processed\",\n",
|
830 |
+
" \"Vehicle Windows Float Processed\",\n",
|
831 |
+
" \"Vehicle Windows Non Float Processed\",\n",
|
832 |
+
" \"Containers\",\n",
|
833 |
+
" \"Tableware\",\n",
|
834 |
+
" \"Headlamps\",\n",
|
835 |
+
"]\n",
|
836 |
+
"\n",
|
837 |
+
"\n",
|
838 |
+
"def classifier(RI, Na, Mg, Al, Si, K, Ca, Ba, Fe):\n",
|
839 |
+
" pred_glass = pipe.predict([[RI, Na, Mg, Al, Si, K, Ca, Ba, Fe]])[0]\n",
|
840 |
+
" label = f\"Predicted Glass label: **{classes[pred_glass]}**\"\n",
|
841 |
+
" return label\n",
|
842 |
+
"\n",
|
843 |
+
"\n",
|
844 |
+
"inputs = [\n",
|
845 |
+
" gr.Slider(1.51, 1.54, step=0.01, label=\"Refractive Index\"),\n",
|
846 |
+
" gr.Slider(10, 17, step=1, label=\"Sodium\"),\n",
|
847 |
+
" gr.Slider(0, 4.5, step=0.5, label=\"Magnesium\"),\n",
|
848 |
+
" gr.Slider(0.3, 3.5, step=0.1, label=\"Aluminum\"),\n",
|
849 |
+
" gr.Slider(69.8, 75.4, step=0.1, label=\"Silicon\"),\n",
|
850 |
+
" gr.Slider(0, 6.2, step=0.1, label=\"Potassium\"),\n",
|
851 |
+
" gr.Slider(5.4, 16.19, step=0.1, label=\"Calcium\"),\n",
|
852 |
+
" gr.Slider(0, 3, step=0.1, label=\"Barium\"),\n",
|
853 |
+
" gr.Slider(0, 0.5, step=0.1, label=\"Iron\"),\n",
|
854 |
+
"]\n",
|
855 |
+
"outputs = [gr.Label(num_top_classes=7)]\n",
|
856 |
+
"\n",
|
857 |
+
"title = \"Glass Classification\"\n",
|
858 |
+
"description = \"Enter the details to correctly identify glass type?\"\n",
|
859 |
+
"\n",
|
860 |
+
"gr.Interface(\n",
|
861 |
+
" fn=classifier,\n",
|
862 |
+
" inputs=inputs,\n",
|
863 |
+
" outputs=outputs,\n",
|
864 |
+
" title=title,\n",
|
865 |
+
" description=description,\n",
|
866 |
+
").launch()"
|
867 |
+
],
|
868 |
+
"metadata": {
|
869 |
+
"colab": {
|
870 |
+
"base_uri": "https://localhost:8080/",
|
871 |
+
"height": 1000
|
872 |
+
},
|
873 |
+
"id": "A8KXp_EFiS1U",
|
874 |
+
"outputId": "c021cdbf-b938-4951-f5e7-8bc0988e9d8a"
|
875 |
+
},
|
876 |
+
"execution_count": 1,
|
877 |
+
"outputs": [
|
878 |
+
{
|
879 |
+
"output_type": "stream",
|
880 |
+
"name": "stderr",
|
881 |
+
"text": [
|
882 |
+
"Exception in thread Thread-5 (attachment_entry):\n",
|
883 |
+
"Traceback (most recent call last):\n",
|
884 |
+
" File \"/usr/local/lib/python3.10/dist-packages/debugpy/server/api.py\", line 237, in listen\n",
|
885 |
+
" sock, _ = endpoints_listener.accept()\n",
|
886 |
+
" File \"/usr/lib/python3.10/socket.py\", line 293, in accept\n",
|
887 |
+
" fd, addr = self._accept()\n",
|
888 |
+
"TimeoutError: timed out\n",
|
889 |
+
"\n",
|
890 |
+
"During handling of the above exception, another exception occurred:\n",
|
891 |
+
"\n",
|
892 |
+
"Traceback (most recent call last):\n",
|
893 |
+
" File \"/usr/lib/python3.10/threading.py\", line 1016, in _bootstrap_inner\n",
|
894 |
+
" self.run()\n",
|
895 |
+
" File \"/usr/lib/python3.10/threading.py\", line 953, in run\n",
|
896 |
+
" self._target(*self._args, **self._kwargs)\n",
|
897 |
+
" File \"/usr/local/lib/python3.10/dist-packages/google/colab/_debugpy.py\", line 52, in attachment_entry\n",
|
898 |
+
" debugpy.listen(_dap_port)\n",
|
899 |
+
" File \"/usr/local/lib/python3.10/dist-packages/debugpy/public_api.py\", line 31, in wrapper\n",
|
900 |
+
" return wrapped(*args, **kwargs)\n",
|
901 |
+
" File \"/usr/local/lib/python3.10/dist-packages/debugpy/server/api.py\", line 143, in debug\n",
|
902 |
+
" log.reraise_exception(\"{0}() failed:\", func.__name__, level=\"info\")\n",
|
903 |
+
" File \"/usr/local/lib/python3.10/dist-packages/debugpy/server/api.py\", line 141, in debug\n",
|
904 |
+
" return func(address, settrace_kwargs, **kwargs)\n",
|
905 |
+
" File \"/usr/local/lib/python3.10/dist-packages/debugpy/server/api.py\", line 251, in listen\n",
|
906 |
+
" raise RuntimeError(\"timed out waiting for adapter to connect\")\n",
|
907 |
+
"RuntimeError: timed out waiting for adapter to connect\n"
|
908 |
+
]
|
909 |
+
},
|
910 |
+
{
|
911 |
+
"output_type": "stream",
|
912 |
+
"name": "stdout",
|
913 |
+
"text": [
|
914 |
+
"Setting queue=True in a Colab notebook requires sharing enabled. Setting `share=True` (you can turn this off by setting `share=False` in `launch()` explicitly).\n",
|
915 |
+
"\n",
|
916 |
+
"Colab notebook detected. To show errors in colab notebook, set debug=True in launch()\n",
|
917 |
+
"Running on public URL: https://efa6ecf31e4b5a440c.gradio.live\n",
|
918 |
+
"\n",
|
919 |
+
"This share link expires in 72 hours. For free permanent hosting and GPU upgrades, run `gradio deploy` from Terminal to deploy to Spaces (https://huggingface.co/spaces)\n"
|
920 |
+
]
|
921 |
+
},
|
922 |
+
{
|
923 |
+
"output_type": "display_data",
|
924 |
+
"data": {
|
925 |
+
"text/plain": [
|
926 |
+
"<IPython.core.display.HTML object>"
|
927 |
+
],
|
928 |
+
"text/html": [
|
929 |
+
"<div><iframe src=\"https://efa6ecf31e4b5a440c.gradio.live\" width=\"100%\" height=\"500\" allow=\"autoplay; camera; microphone; clipboard-read; clipboard-write;\" frameborder=\"0\" allowfullscreen></iframe></div>"
|
930 |
+
]
|
931 |
+
},
|
932 |
+
"metadata": {}
|
933 |
+
},
|
934 |
+
{
|
935 |
+
"output_type": "execute_result",
|
936 |
+
"data": {
|
937 |
+
"text/plain": []
|
938 |
+
},
|
939 |
+
"metadata": {},
|
940 |
+
"execution_count": 1
|
941 |
+
}
|
942 |
+
]
|
943 |
+
}
|
944 |
+
],
|
945 |
+
"metadata": {
|
946 |
+
"colab": {
|
947 |
+
"provenance": []
|
948 |
+
},
|
949 |
+
"kernelspec": {
|
950 |
+
"display_name": "Python 3",
|
951 |
+
"name": "python3"
|
952 |
+
}
|
953 |
+
},
|
954 |
+
"nbformat": 4,
|
955 |
+
"nbformat_minor": 0
|
956 |
+
}
|