diff --git a/Chapter03/drift/data_drift_report.html b/Chapter03/drift/data_drift_report.html index 65b0b43..53d773b 100644 --- a/Chapter03/drift/data_drift_report.html +++ b/Chapter03/drift/data_drift_report.html @@ -1,46 +1,657 @@ - - - - - - - -
Loading...
- - - + - + + + + + diff --git a/Chapter03/drift/data_drift_report.json b/Chapter03/drift/data_drift_report.json index 5efa967..7a6fe0b 100644 --- a/Chapter03/drift/data_drift_report.json +++ b/Chapter03/drift/data_drift_report.json @@ -1,885 +1 @@ -{ - "version": "0.3.1", - "timestamp": "2023-05-01 14:55:28.221095", - "metrics": [ - { - "metric": "DatasetDriftMetric", - "result": { - "drift_share": 0.5, - "number_of_columns": 13, - "number_of_drifted_columns": 0, - "share_of_drifted_columns": 0.0, - "dataset_drift": false - } - }, - { - "metric": "DataDriftTable", - "result": { - "number_of_columns": 13, - "number_of_drifted_columns": 0, - "share_of_drifted_columns": 0.0, - "dataset_drift": false, - "drift_by_columns": { - "alcalinity_of_ash": { - "column_name": "alcalinity_of_ash", - "column_type": "num", - "stattest_name": "K-S p_value", - "stattest_threshold": 0.05, - "drift_score": 0.39530698914758006, - "drift_detected": false, - "current": { - "small_distribution": { - "x": [ - 14.6, - 15.99, - 17.38, - 18.77, - 20.16, - 21.55, - 22.939999999999998, - 24.33, - 25.72, - 27.11, - 28.5 - ], - "y": [ - 0.06466736722981163, - 0.16975183897825574, - 0.08891762994099099, - 0.16975183897825552, - 0.08891762994099099, - 0.040417104518632375, - 0.04041710451863227, - 0.04041710451863227, - 0.008083420903726454, - 0.008083420903726454 - ] - } - }, - "reference": { - "small_distribution": { - "x": [ - 10.6, - 12.54, - 14.48, - 16.42, - 18.36, - 20.299999999999997, - 22.240000000000002, - 24.18, - 26.119999999999997, - 28.060000000000002, - 30.0 - ], - "y": [ - 0.028958647052009737, - 0.017375188231205825, - 0.028958647052009713, - 0.09266767056643124, - 0.12162631761844102, - 0.1274180470288425, - 0.05212556469361758, - 0.02895864705200976, - 0.005791729410401932, - 0.011583458820803905 - ] - } - } - }, - "alcohol": { - "column_name": "alcohol", - "column_type": "num", - "stattest_name": "K-S p_value", - "stattest_threshold": 0.05, - "drift_score": 0.39530698914758006, - "drift_detected": false, - "current": { - "small_distribution": { - "x": [ - 11.41, - 11.708, - 12.006, - 12.304, - 12.602, - 12.9, - 13.198, - 13.496, - 13.794, - 14.092, - 14.39 - ], - "y": [ - 0.11311364150516551, - 0.11311364150516551, - 0.41475001885227347, - 0.527863660357439, - 0.301636377347108, - 0.3393409245154965, - 0.45245456602066203, - 0.527863660357439, - 0.22622728301033102, - 0.3393409245154965 - ] - } - }, - "reference": { - "small_distribution": { - "x": [ - 11.03, - 11.41, - 11.79, - 12.17, - 12.549999999999999, - 12.93, - 13.309999999999999, - 13.69, - 14.07, - 14.45, - 14.83 - ], - "y": [ - 0.029568302779420397, - 0.20697811945594377, - 0.3548196333530448, - 0.32525133057362593, - 0.3548196333530448, - 0.41395623891188754, - 0.2069781194559428, - 0.443524541691306, - 0.23654642223536432, - 0.059136605558840795 - ] - } - } - }, - "ash": { - "column_name": "ash", - "column_type": "num", - "stattest_name": "K-S p_value", - "stattest_threshold": 0.05, - "drift_score": 0.6308040582226205, - "drift_detected": false, - "current": { - "small_distribution": { - "x": [ - 1.7, - 1.8519999999999999, - 2.004, - 2.156, - 2.308, - 2.46, - 2.612, - 2.7640000000000002, - 2.9160000000000004, - 3.0680000000000005, - 3.22 - ], - "y": [ - 0.2956830277942048, - 0.5913660555884087, - 0.5913660555884087, - 1.478415138971026, - 1.1088113542282663, - 1.0348905972797153, - 1.0348905972797153, - 0.3696037847427554, - 0.0, - 0.07392075694855131 - ] - } - }, - "reference": { - "small_distribution": { - "x": [ - 1.36, - 1.5470000000000002, - 1.734, - 1.921, - 2.108, - 2.295, - 2.482, - 2.669, - 2.856, - 3.043, - 3.23 - ], - "y": [ - 0.06008532115604156, - 0.0, - 0.24034128462416623, - 0.24034128462416623, - 1.4420477077449991, - 1.8025596346812447, - 1.0214504596527079, - 0.42059724809229143, - 0.06008532115604149, - 0.06008532115604163 - ] - } - } - }, - "color_intensity": { - "column_name": "color_intensity", - "column_type": "num", - "stattest_name": "K-S p_value", - "stattest_threshold": 0.05, - "drift_score": 0.39530698914758006, - "drift_detected": false, - "current": { - "small_distribution": { - "x": [ - 1.28, - 2.452, - 3.6240000000000006, - 4.796, - 5.968000000000001, - 7.1400000000000015, - 8.312000000000001, - 9.484, - 10.656, - 11.828000000000001, - 13.0 - ], - "y": [ - 0.0766959389500326, - 0.1917398473750814, - 0.2013268397438356, - 0.1917398473750814, - 0.04793496184377035, - 0.05752195421252446, - 0.028760977106262253, - 0.03834796947501628, - 0.00958699236875407, - 0.009586992368754084 - ] - } - }, - "reference": { - "small_distribution": { - "x": [ - 1.74, - 2.646, - 3.552, - 4.458, - 5.364, - 6.2700000000000005, - 7.176, - 8.082, - 8.988, - 9.894, - 10.8 - ], - "y": [ - 0.14882059677059306, - 0.21082917875834012, - 0.13641888037304362, - 0.12401716397549424, - 0.16122231316814237, - 0.09921373118039539, - 0.08681201478284589, - 0.037205149192648314, - 0.062008581987747065, - 0.03720514919264824 - ] - } - } - }, - "flavanoids": { - "column_name": "flavanoids", - "column_type": "num", - "stattest_name": "K-S p_value", - "stattest_threshold": 0.05, - "drift_score": 0.29971358201044696, - "drift_detected": false, - "current": { - "small_distribution": { - "x": [ - 0.34, - 0.6990000000000001, - 1.058, - 1.4170000000000003, - 1.7760000000000002, - 2.1350000000000002, - 2.494, - 2.853, - 3.212, - 3.571, - 3.93 - ], - "y": [ - 0.4068730243184876, - 0.18778754968545586, - 0.2190854746330317, - 0.18778754968545586, - 0.2816813245281838, - 0.3442771744233358, - 0.46946887421363964, - 0.46946887421363964, - 0.1564896247378799, - 0.06259584989515195 - ] - } - }, - "reference": { - "small_distribution": { - "x": [ - 0.47, - 0.931, - 1.392, - 1.853, - 2.314, - 2.7750000000000004, - 3.2359999999999998, - 3.697, - 4.158, - 4.619, - 5.08 - ], - "y": [ - 0.511833093665456, - 0.24373004460259823, - 0.34122206244363734, - 0.1949840356820785, - 0.24373004460259803, - 0.3655950669038977, - 0.2193570401423382, - 0.024373004460259803, - 0.0, - 0.024373004460259803 - ] - } - } - }, - "hue": { - "column_name": "hue", - "column_type": "num", - "stattest_name": "K-S p_value", - "stattest_threshold": 0.05, - "drift_score": 0.6308040582226205, - "drift_detected": false, - "current": { - "small_distribution": { - "x": [ - 0.54, - 0.631, - 0.722, - 0.8130000000000001, - 0.904, - 0.995, - 1.086, - 1.177, - 1.268, - 1.359, - 1.45 - ], - "y": [ - 1.1112483022595385, - 1.2347203358439318, - 0.37041610075317905, - 0.9877762686751455, - 1.6051364365971115, - 1.7286084701815023, - 1.7286084701815045, - 1.6051364365971115, - 0.4938881343375727, - 0.12347203358439318 - ] - } - }, - "reference": { - "small_distribution": { - "x": [ - 0.48, - 0.603, - 0.726, - 0.849, - 0.972, - 1.095, - 1.218, - 1.341, - 1.464, - 1.587, - 1.71 - ], - "y": [ - 0.7307938247921806, - 0.5480953685941354, - 1.4615876495843612, - 1.644286105782406, - 1.8269845619804512, - 0.822143052891203, - 0.639444596693158, - 0.3653969123960903, - 0.0, - 0.09134922809902257 - ] - } - } - }, - "magnesium": { - "column_name": "magnesium", - "column_type": "num", - "stattest_name": "K-S p_value", - "stattest_threshold": 0.05, - "drift_score": 0.7560914167788522, - "drift_detected": false, - "current": { - "small_distribution": { - "x": [ - 78.0, - 86.4, - 94.8, - 103.2, - 111.6, - 120.0, - 128.4, - 136.8, - 145.2, - 153.60000000000002, - 162.0 - ], - "y": [ - 0.02006420545746387, - 0.026752273943285203, - 0.036115569823434966, - 0.014713750668806863, - 0.010700909577314064, - 0.005350454788657032, - 0.002675227394328516, - 0.0, - 0.0013376136971642535, - 0.0013376136971642626 - ] - } - }, - "reference": { - "small_distribution": { - "x": [ - 70.0, - 76.9, - 83.8, - 90.7, - 97.6, - 104.5, - 111.4, - 118.30000000000001, - 125.2, - 132.1, - 139.0 - ], - "y": [ - 0.001628399283504314, - 0.006513597134017269, - 0.03745318352059922, - 0.021169190685556127, - 0.030939586386581962, - 0.017912392118547452, - 0.014655593551538825, - 0.008141996417521587, - 0.004885197850512952, - 0.001628399283504314 - ] - } - } - }, - "malic_acid": { - "column_name": "malic_acid", - "column_type": "num", - "stattest_name": "K-S p_value", - "stattest_threshold": 0.05, - "drift_score": 0.5072371472538678, - "drift_detected": false, - "current": { - "small_distribution": { - "x": [ - 0.74, - 1.246, - 1.752, - 2.258, - 2.7640000000000002, - 3.2700000000000005, - 3.776, - 4.282, - 4.788, - 5.2940000000000005, - 5.8 - ], - "y": [ - 0.2664653373007061, - 0.6439578984767065, - 0.39969800595105914, - 0.15543811342541183, - 0.13323266865035302, - 0.13323266865035324, - 0.08882177910023534, - 0.06661633432517651, - 0.04441088955011767, - 0.044410889550117745 - ] - } - }, - "reference": { - "small_distribution": { - "x": [ - 0.89, - 1.366, - 1.842, - 2.3180000000000005, - 2.7940000000000005, - 3.2700000000000005, - 3.746000000000001, - 4.222, - 4.698, - 5.174, - 5.65 - ], - "y": [ - 0.25965442356717966, - 0.6845434803134738, - 0.25965442356717944, - 0.212444528373147, - 0.1888395807761307, - 0.11802473798508158, - 0.2124445283731472, - 0.09441979038806535, - 0.023604947597016337, - 0.047209895194032674 - ] - } - } - }, - "nonflavanoid_phenols": { - "column_name": "nonflavanoid_phenols", - "column_type": "num", - "stattest_name": "K-S p_value", - "stattest_threshold": 0.05, - "drift_score": 0.39530698914758006, - "drift_detected": false, - "current": { - "small_distribution": { - "x": [ - 0.14, - 0.189, - 0.23800000000000002, - 0.28700000000000003, - 0.336, - 0.385, - 0.43400000000000005, - 0.48300000000000004, - 0.532, - 0.581, - 0.63 - ], - "y": [ - 0.917220820912635, - 1.3758312313689516, - 4.815409309791331, - 3.439578078422381, - 2.2930520522815874, - 3.6688832836505356, - 1.1465260261407937, - 1.3758312313689525, - 0.687915615684477, - 0.6879156156844755 - ] - } - }, - "reference": { - "small_distribution": { - "x": [ - 0.13, - 0.183, - 0.23600000000000002, - 0.28900000000000003, - 0.342, - 0.395, - 0.44800000000000006, - 0.5010000000000001, - 0.554, - 0.607, - 0.66 - ], - "y": [ - 0.8479966080135681, - 2.1199915200339188, - 2.543989824040703, - 3.8159847360610564, - 1.271994912020352, - 2.5439898240407017, - 2.119991520033918, - 1.483994064023746, - 1.0599957600169612, - 1.059995760016959 - ] - } - } - }, - "od280/od315_of_diluted_wines": { - "column_name": "od280/od315_of_diluted_wines", - "column_type": "num", - "stattest_name": "K-S p_value", - "stattest_threshold": 0.05, - "drift_score": 0.29971358201044696, - "drift_detected": false, - "current": { - "small_distribution": { - "x": [ - 1.3, - 1.57, - 1.84, - 2.1100000000000003, - 2.38, - 2.6500000000000004, - 2.92, - 3.1900000000000004, - 3.46, - 3.7300000000000004, - 4.0 - ], - "y": [ - 0.24968789013732834, - 0.3745318352059925, - 0.2913025384935495, - 0.3745318352059931, - 0.2080732417811066, - 0.6658343736995432, - 0.6658343736995411, - 0.457761131918436, - 0.2913025384935492, - 0.12484394506866436 - ] - } - }, - "reference": { - "small_distribution": { - "x": [ - 1.27, - 1.514, - 1.758, - 2.002, - 2.246, - 2.49, - 2.734, - 2.9779999999999998, - 3.222, - 3.4659999999999997, - 3.71 - ], - "y": [ - 0.41444096518695894, - 0.6446859458463806, - 0.1841959845275375, - 0.18419598452753713, - 0.18419598452753713, - 0.3223429729231906, - 0.73678393811015, - 0.5986369497144957, - 0.4604899613188437, - 0.36839196905507426 - ] - } - } - }, - "proanthocyanins": { - "column_name": "proanthocyanins", - "column_type": "num", - "stattest_name": "K-S p_value", - "stattest_threshold": 0.05, - "drift_score": 0.22157082996584854, - "drift_detected": false, - "current": { - "small_distribution": { - "x": [ - 0.41, - 0.697, - 0.984, - 1.271, - 1.5579999999999998, - 1.8449999999999998, - 2.132, - 2.419, - 2.706, - 2.993, - 3.28 - ], - "y": [ - 0.23489801511177233, - 0.27404768429706766, - 0.46979603022354477, - 0.6263947069647263, - 0.6263947069647263, - 0.704694045335316, - 0.2740476842970678, - 0.15659867674118158, - 0.07829933837059079, - 0.039149669185295395 - ] - } - }, - "reference": { - "small_distribution": { - "x": [ - 0.42, - 0.736, - 1.052, - 1.3679999999999999, - 1.684, - 2.0, - 2.316, - 2.632, - 2.948, - 3.264, - 3.58 - ], - "y": [ - 0.10667045939411178, - 0.4622386573744844, - 0.7111363959607456, - 0.8889204949509315, - 0.4266818375764471, - 0.2844545583842983, - 0.07111363959607447, - 0.14222727919214914, - 0.035556819798037285, - 0.03555681979803724 - ] - } - } - }, - "proline": { - "column_name": "proline", - "column_type": "num", - "stattest_name": "K-S p_value", - "stattest_threshold": 0.05, - "drift_score": 0.6308040582226205, - "drift_detected": false, - "current": { - "small_distribution": { - "x": [ - 290.0, - 429.0, - 568.0, - 707.0, - 846.0, - 985.0, - 1124.0, - 1263.0, - 1402.0, - 1541.0, - 1680.0 - ], - "y": [ - 0.0012125131355589685, - 0.0011316789265217039, - 0.0013741815536334977, - 0.0010508447174844395, - 0.00048500525422358744, - 0.0008891762994099102, - 0.00016166841807452914, - 0.0006466736722981165, - 0.00016166841807452914, - 8.083420903726457e-05 - ] - } - }, - "reference": { - "small_distribution": { - "x": [ - 278.0, - 404.9, - 531.8, - 658.7, - 785.6, - 912.5, - 1039.4, - 1166.3000000000002, - 1293.2, - 1420.1000000000001, - 1547.0 - ], - "y": [ - 0.0004427090250661851, - 0.0023020869303441624, - 0.0014166688802117909, - 0.0012395852701853182, - 0.0004427090250661851, - 0.0002656254150397108, - 0.0008854180501323694, - 0.00044270902506618546, - 0.00017708361002647386, - 0.0002656254150397113 - ] - } - } - }, - "total_phenols": { - "column_name": "total_phenols", - "column_type": "num", - "stattest_name": "K-S p_value", - "stattest_threshold": 0.05, - "drift_score": 0.5072371472538678, - "drift_detected": false, - "current": { - "small_distribution": { - "x": [ - 0.98, - 1.234, - 1.488, - 1.742, - 1.996, - 2.25, - 2.504, - 2.758, - 3.012, - 3.266, - 3.52 - ], - "y": [ - 0.08847208705653367, - 0.3538883482261347, - 0.3981243917544015, - 0.3538883482261347, - 0.6193046093957356, - 0.530832522339202, - 0.6635406529240025, - 0.7077766964522694, - 0.1327081305848005, - 0.08847208705653367 - ] - } - }, - "reference": { - "small_distribution": { - "x": [ - 1.1, - 1.3780000000000001, - 1.6560000000000001, - 1.934, - 2.2119999999999997, - 2.49, - 2.768, - 3.046, - 3.324, - 3.602, - 3.88 - ], - "y": [ - 0.12125131355589684, - 0.6466736722981166, - 0.6062565677794847, - 0.44458814970495547, - 0.2829197316304255, - 0.40417104518632346, - 0.5658394632608519, - 0.3233368361490583, - 0.12125131355589684, - 0.08083420903726457 - ] - } - } - } - } - } - } - ] -} \ No newline at end of file +{"version": "0.6.2", "metrics": [{"metric": "DatasetDriftMetric", "result": {"drift_share": 0.5, "number_of_columns": 13, "number_of_drifted_columns": 7, "share_of_drifted_columns": 0.5384615384615384, "dataset_drift": true}}, {"metric": "DataDriftTable", "result": {"number_of_columns": 13, "number_of_drifted_columns": 7, "share_of_drifted_columns": 0.5384615384615384, "dataset_drift": true, "drift_by_columns": {"alcalinity_of_ash": {"column_name": "alcalinity_of_ash", "column_type": "num", "stattest_name": "K-S p_value", "stattest_threshold": 0.05, "drift_score": 0.15991121054164747, "drift_detected": false, "current": {"small_distribution": {"x": [16.060000000000002, 17.589000000000002, 19.118000000000002, 20.647000000000002, 22.176000000000002, 23.705000000000002, 25.234, 26.763, 28.292, 29.821, 31.35], "y": [0.05878851566346514, 0.154319853616596, 0.08083420903726457, 0.154319853616596, 0.08083420903726457, 0.036742822289665716, 0.036742822289665716, 0.036742822289665716, 0.007348564457933143, 0.007348564457933143]}}, "reference": {"small_distribution": {"x": [10.6, 12.54, 14.48, 16.42, 18.36, 20.299999999999997, 22.240000000000002, 24.18, 26.119999999999997, 28.060000000000002, 30.0], "y": [0.028958647052009737, 0.017375188231205825, 0.028958647052009713, 0.09266767056643124, 0.12162631761844102, 0.1274180470288425, 0.05212556469361758, 0.02895864705200976, 0.005791729410401932, 0.011583458820803905]}}}, "alcohol": {"column_name": "alcohol", "column_type": "num", "stattest_name": "K-S p_value", "stattest_threshold": 0.05, "drift_score": 2.7787503279352254e-13, "drift_detected": true, "current": {"small_distribution": {"x": [12.551000000000002, 12.878800000000002, 13.206600000000002, 13.534400000000002, 13.862200000000001, 14.190000000000001, 14.517800000000001, 14.845600000000003, 15.173400000000003, 15.501200000000003, 15.829000000000002], "y": [0.10283058318651415, 0.10283058318651415, 0.37704547168388525, 0.47987605487039936, 0.2742148884973711, 0.30849174955954245, 0.4113223327460544, 0.47987605487039936, 0.2056611663730283, 0.30849174955954245]}}, "reference": {"small_distribution": {"x": [11.03, 11.41, 11.79, 12.17, 12.549999999999999, 12.93, 13.309999999999999, 13.69, 14.07, 14.45, 14.83], "y": [0.029568302779420397, 0.20697811945594377, 0.3548196333530448, 0.32525133057362593, 0.3548196333530448, 0.41395623891188754, 0.2069781194559428, 0.443524541691306, 0.23654642223536432, 0.059136605558840795]}}}, "ash": {"column_name": "ash", "column_type": "num", "stattest_name": "K-S p_value", "stattest_threshold": 0.05, "drift_score": 3.534204585564835e-06, "drift_detected": true, "current": {"small_distribution": {"x": [1.87, 2.0372000000000003, 2.2044, 2.3716000000000004, 2.5388, 2.7060000000000004, 2.8732000000000006, 3.040400000000001, 3.2076000000000007, 3.3748000000000005, 3.5420000000000007], "y": [0.26880275254018565, 0.5376055050803727, 0.5376055050803713, 1.3440137627009316, 1.0752110101607426, 0.8736089457556033, 0.9408096338906496, 0.3360034406752329, 0.0, 0.06720068813504641]}}, "reference": {"small_distribution": {"x": [1.36, 1.5470000000000002, 1.734, 1.921, 2.108, 2.295, 2.482, 2.669, 2.856, 3.043, 3.23], "y": [0.06008532115604156, 0.0, 0.24034128462416623, 0.24034128462416623, 1.4420477077449991, 1.8025596346812447, 1.0214504596527079, 0.42059724809229143, 0.06008532115604149, 0.06008532115604163]}}}, "color_intensity": {"column_name": "color_intensity", "column_type": "num", "stattest_name": "K-S p_value", "stattest_threshold": 0.05, "drift_score": 0.7560914167788522, "drift_detected": false, "current": {"small_distribution": {"x": [1.4080000000000001, 2.6972000000000005, 3.9864000000000006, 5.275600000000001, 6.564800000000001, 7.854000000000001, 9.1432, 10.4324, 11.7216, 13.010800000000001, 14.3], "y": [0.06972358086366598, 0.17430895215916498, 0.1830243997671232, 0.17430895215916498, 0.043577238039791244, 0.05229268564774953, 0.026146342823874767, 0.03486179043183297, 0.008715447607958242, 0.008715447607958254]}}, "reference": {"small_distribution": {"x": [1.74, 2.646, 3.552, 4.458, 5.364, 6.2700000000000005, 7.176, 8.082, 8.988, 9.894, 10.8], "y": [0.14882059677059306, 0.21082917875834012, 0.13641888037304362, 0.12401716397549424, 0.16122231316814237, 0.09921373118039539, 0.08681201478284589, 0.037205149192648314, 0.062008581987747065, 0.03720514919264824]}}}, "flavanoids": {"column_name": "flavanoids", "column_type": "num", "stattest_name": "K-S p_value", "stattest_threshold": 0.05, "drift_score": 0.15991121054164747, "drift_detected": false, "current": {"small_distribution": {"x": [0.37400000000000005, 0.7689000000000001, 1.1638000000000002, 1.5587000000000002, 1.9536000000000002, 2.3485, 2.7434000000000003, 3.1383000000000005, 3.5332000000000003, 3.9281, 4.323], "y": [0.36988456756226146, 0.1707159542595053, 0.1991686133027562, 0.1707159542595053, 0.2560739313892581, 0.31297924947575956, 0.4267898856487631, 0.4267898856487636, 0.1422632952162545, 0.05690531808650173]}}, "reference": {"small_distribution": {"x": [0.47, 0.931, 1.392, 1.853, 2.314, 2.7750000000000004, 3.2359999999999998, 3.697, 4.158, 4.619, 5.08], "y": [0.511833093665456, 0.24373004460259823, 0.34122206244363734, 0.1949840356820785, 0.24373004460259803, 0.3655950669038977, 0.2193570401423382, 0.024373004460259803, 0.0, 0.024373004460259803]}}}, "hue": {"column_name": "hue", "column_type": "num", "stattest_name": "K-S p_value", "stattest_threshold": 0.05, "drift_score": 0.0002704756915904678, "drift_detected": true, "current": {"small_distribution": {"x": [0.5940000000000001, 0.6941, 0.7942, 0.8943000000000001, 0.9944000000000001, 1.0945, 1.1946, 1.2947000000000002, 1.3948, 1.4949, 1.595], "y": [1.0102257293268533, 1.1224730325853924, 0.3367419097756174, 0.8979784260683139, 1.4592149423610103, 1.5714622456195477, 1.5714622456195477, 1.459214942361012, 0.44898921303415756, 0.11224730325853913]}}, "reference": {"small_distribution": {"x": [0.48, 0.603, 0.726, 0.849, 0.972, 1.095, 1.218, 1.341, 1.464, 1.587, 1.71], "y": [0.7307938247921806, 0.5480953685941354, 1.4615876495843612, 1.644286105782406, 1.8269845619804512, 0.822143052891203, 0.639444596693158, 0.3653969123960903, 0.0, 0.09134922809902257]}}}, "magnesium": {"column_name": "magnesium", "column_type": "num", "stattest_name": "K-S p_value", "stattest_threshold": 0.05, "drift_score": 0.0005104138050969195, "drift_detected": true, "current": {"small_distribution": {"x": [85.80000000000001, 95.04, 104.28000000000002, 113.52000000000001, 122.76000000000002, 132.0, 141.24, 150.48000000000002, 159.72000000000003, 168.96, 178.20000000000002], "y": [0.018240186779512634, 0.024320249039350136, 0.03283233620312274, 0.013376136971642577, 0.009728099615740084, 0.0048640498078700274, 0.0024320249039350137, 0.0, 0.0012160124519675105, 0.0012160124519675069]}}, "reference": {"small_distribution": {"x": [70.0, 76.9, 83.8, 90.7, 97.6, 104.5, 111.4, 118.30000000000001, 125.2, 132.1, 139.0], "y": [0.001628399283504314, 0.006513597134017269, 0.03745318352059922, 0.021169190685556127, 0.030939586386581962, 0.017912392118547452, 0.014655593551538825, 0.008141996417521587, 0.004885197850512952, 0.001628399283504314]}}}, "malic_acid": {"column_name": "malic_acid", "column_type": "num", "stattest_name": "K-S p_value", "stattest_threshold": 0.05, "drift_score": 0.39530698914758006, "drift_detected": false, "current": {"small_distribution": {"x": [0.8140000000000001, 1.3706, 1.9272, 2.4838, 3.0404, 3.597, 4.1536, 4.7102, 5.2668, 5.8233999999999995, 6.38], "y": [0.24224121572791465, 0.5854162713424604, 0.36336182359187197, 0.14130737584128356, 0.12112060786395733, 0.12112060786395733, 0.08074707190930483, 0.06056030393197871, 0.04037353595465248, 0.040373535954652415]}}, "reference": {"small_distribution": {"x": [0.89, 1.366, 1.842, 2.3180000000000005, 2.7940000000000005, 3.2700000000000005, 3.746000000000001, 4.222, 4.698, 5.174, 5.65], "y": [0.25965442356717966, 0.6845434803134738, 0.25965442356717944, 0.212444528373147, 0.1888395807761307, 0.11802473798508158, 0.2124445283731472, 0.09441979038806535, 0.023604947597016337, 0.047209895194032674]}}}, "nonflavanoid_phenols": {"column_name": "nonflavanoid_phenols", "column_type": "num", "stattest_name": "K-S p_value", "stattest_threshold": 0.05, "drift_score": 0.22157082996584854, "drift_detected": false, "current": {"small_distribution": {"x": [0.15400000000000003, 0.20790000000000003, 0.26180000000000003, 0.31570000000000004, 0.36960000000000004, 0.42350000000000004, 0.47740000000000005, 0.5313000000000001, 0.5852, 0.6391, 0.6930000000000001], "y": [0.8338371099205769, 1.2507556648808653, 4.377644827083029, 3.1268891622021635, 2.0845927748014423, 3.3353484396823077, 1.04229638740072, 1.2507556648808666, 0.6253778324404333, 0.6253778324404321]}}, "reference": {"small_distribution": {"x": [0.13, 0.183, 0.23600000000000002, 0.28900000000000003, 0.342, 0.395, 0.44800000000000006, 0.5010000000000001, 0.554, 0.607, 0.66], "y": [0.8479966080135681, 2.1199915200339188, 2.543989824040703, 3.8159847360610564, 1.271994912020352, 2.5439898240407017, 2.119991520033918, 1.483994064023746, 1.0599957600169612, 1.059995760016959]}}}, "od280/od315_of_diluted_wines": {"column_name": "od280/od315_of_diluted_wines", "column_type": "num", "stattest_name": "K-S p_value", "stattest_threshold": 0.05, "drift_score": 0.008476702185588833, "drift_detected": true, "current": {"small_distribution": {"x": [1.4300000000000002, 1.7270000000000003, 2.024, 2.321, 2.6180000000000003, 2.9150000000000005, 3.2120000000000006, 3.5090000000000003, 3.8060000000000005, 4.103000000000001, 4.4], "y": [0.22698899103393472, 0.3404834865509026, 0.26482048953959053, 0.3404834865509021, 0.18915749252827896, 0.6053039760904927, 0.5674724775848377, 0.45397798206786943, 0.26482048953959053, 0.11349449551696754]}}, "reference": {"small_distribution": {"x": [1.27, 1.514, 1.758, 2.002, 2.246, 2.49, 2.734, 2.9779999999999998, 3.222, 3.4659999999999997, 3.71], "y": [0.41444096518695894, 0.6446859458463806, 0.1841959845275375, 0.18419598452753713, 0.18419598452753713, 0.3223429729231906, 0.73678393811015, 0.5986369497144957, 0.4604899613188437, 0.36839196905507426]}}}, "proanthocyanins": {"column_name": "proanthocyanins", "column_type": "num", "stattest_name": "K-S p_value", "stattest_threshold": 0.05, "drift_score": 0.02205892005845096, "drift_detected": true, "current": {"small_distribution": {"x": [0.451, 0.7666999999999999, 1.0824, 1.3981, 1.7138, 2.0295, 2.3451999999999997, 2.6609, 2.9766, 3.2923, 3.608], "y": [0.21354365010161122, 0.24913425845187961, 0.42708730020322255, 0.5694497336042964, 0.5694497336042964, 0.6406309503048343, 0.24913425845187961, 0.1423624334010741, 0.07118121670053705, 0.035590608350268525]}}, "reference": {"small_distribution": {"x": [0.42, 0.736, 1.052, 1.3679999999999999, 1.684, 2.0, 2.316, 2.632, 2.948, 3.264, 3.58], "y": [0.10667045939411178, 0.4622386573744844, 0.7111363959607456, 0.8889204949509315, 0.4266818375764471, 0.2844545583842983, 0.07111363959607447, 0.14222727919214914, 0.035556819798037285, 0.03555681979803724]}}}, "proline": {"column_name": "proline", "column_type": "num", "stattest_name": "K-S p_value", "stattest_threshold": 0.05, "drift_score": 0.02205892005845096, "drift_detected": true, "current": {"small_distribution": {"x": [319.0, 471.90000000000003, 624.8000000000001, 777.7, 930.6000000000001, 1083.5000000000002, 1236.4, 1389.3000000000002, 1542.2000000000003, 1695.1000000000004, 1848.0000000000002], "y": [0.001102284668689971, 0.0010287990241106396, 0.0012492559578486345, 0.000955313379531308, 0.0004409138674759883, 0.0008083420903726464, 0.00014697128915866278, 0.0005878851566346511, 0.00014697128915866278, 7.34856445793315e-05]}}, "reference": {"small_distribution": {"x": [278.0, 404.9, 531.8, 658.7, 785.6, 912.5, 1039.4, 1166.3000000000002, 1293.2, 1420.1000000000001, 1547.0], "y": [0.0004427090250661851, 0.0023020869303441624, 0.0014166688802117909, 0.0012395852701853182, 0.0004427090250661851, 0.0002656254150397108, 0.0008854180501323694, 0.00044270902506618546, 0.00017708361002647386, 0.0002656254150397113]}}}, "total_phenols": {"column_name": "total_phenols", "column_type": "num", "stattest_name": "K-S p_value", "stattest_threshold": 0.05, "drift_score": 0.07764437164528368, "drift_detected": false, "current": {"small_distribution": {"x": [1.078, 1.3574000000000002, 1.6368, 1.9162000000000001, 2.1956, 2.4750000000000005, 2.7544000000000004, 3.0338000000000003, 3.3132, 3.5926, 3.8720000000000003], "y": [0.0804291700513942, 0.3217166802055771, 0.36193126523127395, 0.3217166802055768, 0.563004190359759, 0.4825750203083657, 0.6032187753854571, 0.6434333604111542, 0.12064375507709142, 0.08042917005139415]}}, "reference": {"small_distribution": {"x": [1.1, 1.3780000000000001, 1.6560000000000001, 1.934, 2.2119999999999997, 2.49, 2.768, 3.046, 3.324, 3.602, 3.88], "y": [0.12125131355589684, 0.6466736722981166, 0.6062565677794847, 0.44458814970495547, 0.2829197316304255, 0.40417104518632346, 0.5658394632608519, 0.3233368361490583, 0.12125131355589684, 0.08083420903726457]}}}}, "current_fi": null, "reference_fi": null}}], "timestamp": "2025-02-10 21:24:02.369690"} \ No newline at end of file diff --git a/Chapter03/drift/evidently-drift-detection.ipynb b/Chapter03/drift/evidently-drift-detection.ipynb index 9b9836d..e7496b4 100644 --- a/Chapter03/drift/evidently-drift-detection.ipynb +++ b/Chapter03/drift/evidently-drift-detection.ipynb @@ -5,7 +5,30 @@ "execution_count": 1, "id": "82bff1c8", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Error importing optional module skimage\n", + "Traceback (most recent call last):\n", + " File \"/opt/homebrew/Caskroom/miniforge/base/envs/mlewp-chapter03-drift/lib/python3.10/site-packages/_plotly_utils/optional_imports.py\", line 28, in get_module\n", + " return import_module(name)\n", + " File \"/opt/homebrew/Caskroom/miniforge/base/envs/mlewp-chapter03-drift/lib/python3.10/importlib/__init__.py\", line 126, in import_module\n", + " return _bootstrap._gcd_import(name[level:], package, level)\n", + " File \"\", line 1050, in _gcd_import\n", + " File \"\", line 1027, in _find_and_load\n", + " File \"\", line 1006, in _find_and_load_unlocked\n", + " File \"\", line 688, in _load_unlocked\n", + " File \"\", line 883, in exec_module\n", + " File \"\", line 241, in _call_with_frames_removed\n", + " File \"/opt/homebrew/Caskroom/miniforge/base/envs/mlewp-chapter03-drift/lib/python3.10/site-packages/skimage/__init__.py\", line 122, in \n", + " from ._shared import geometry\n", + " File \"geometry.pyx\", line 1, in init skimage._shared.geometry\n", + "ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject\n" + ] + } + ], "source": [ "from sklearn.datasets import load_wine\n", "from sklearn.model_selection import train_test_split\n", @@ -17,16 +40,7 @@ "execution_count": 2, "id": "059884bf", "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/opt/homebrew/Caskroom/miniforge/base/envs/mlewp-chapter03/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" - ] - } - ], + "outputs": [], "source": [ "from evidently.report import Report\n", "from evidently.metric_preset import DataDriftPreset" @@ -52,7 +66,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 11, "id": "1af1f00c", "metadata": {}, "outputs": [], @@ -68,11 +82,9 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 9, "id": "3f2452c4", - "metadata": { - "scrolled": false - }, + "metadata": {}, "outputs": [], "source": [ "data_drift_report.save_json('data_drift_report.json')\n", @@ -81,61 +93,704 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 12, "id": "25c6b35d", - "metadata": {}, + "metadata": { + "scrolled": true + }, "outputs": [ { "data": { "text/html": [ "\n", - "\n", - "\n", - "\n", - "\n", - "
Loading...
\n", - "\n" + " \n", + " \n", + " \n", + "