Skip to content

Commit 2013c30

Browse files
Fix error to use numpy item() method in DDM_simple.ipynb
1 parent 8f47181 commit 2013c30

File tree

1 file changed

+27
-7
lines changed

1 file changed

+27
-7
lines changed

docs/source/examples/concept_drift/DDM_simple.ipynb

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
"cell_type": "code",
55
"execution_count": 1,
66
"metadata": {
7-
"collapsed": true
7+
"collapsed": true,
8+
"ExecuteTime": {
9+
"end_time": "2023-08-03T10:26:13.216424950Z",
10+
"start_time": "2023-08-03T10:26:12.464032816Z"
11+
}
812
},
913
"outputs": [],
1014
"source": [
@@ -43,7 +47,7 @@
4347
"name": "stderr",
4448
"output_type": "stream",
4549
"text": [
46-
"INFO:frouros:Trying to download data from https://nextcloud.ifca.es/index.php/s/2coqgBEpa82boLS/download to /tmp/tmpagpyvswq\n"
50+
"INFO:frouros:Trying to download data from https://nextcloud.ifca.es/index.php/s/2coqgBEpa82boLS/download to /tmp/tmpvrhnah8i\n"
4751
]
4852
}
4953
],
@@ -59,7 +63,11 @@
5963
"X_ref, y_ref, X_test, y_test = X[:split_idx], y[:split_idx].ravel(), X[split_idx:], y[split_idx:]"
6064
],
6165
"metadata": {
62-
"collapsed": false
66+
"collapsed": false,
67+
"ExecuteTime": {
68+
"end_time": "2023-08-03T10:26:14.629676415Z",
69+
"start_time": "2023-08-03T10:26:13.219694293Z"
70+
}
6371
}
6472
},
6573
{
@@ -90,7 +98,11 @@
9098
"pipeline.fit(X=X_ref, y=y_ref)"
9199
],
92100
"metadata": {
93-
"collapsed": false
101+
"collapsed": false,
102+
"ExecuteTime": {
103+
"end_time": "2023-08-03T10:26:14.746515595Z",
104+
"start_time": "2023-08-03T10:26:14.631972871Z"
105+
}
94106
}
95107
},
96108
{
@@ -105,7 +117,11 @@
105117
"detector = DDM(config=config)"
106118
],
107119
"metadata": {
108-
"collapsed": false
120+
"collapsed": false,
121+
"ExecuteTime": {
122+
"end_time": "2023-08-03T10:26:14.767517723Z",
123+
"start_time": "2023-08-03T10:26:14.717692323Z"
124+
}
109125
}
110126
},
111127
{
@@ -132,15 +148,19 @@
132148
"source": [
133149
"for i, (X, y) in enumerate(zip(X_test, y_test)):\n",
134150
" y_pred = pipeline.predict(X.reshape(1, -1))\n",
135-
" error = 1 - int(y_pred == y)\n",
151+
" error = 1 - (y_pred.item() == y.item())\n",
136152
" detector.update(value=error)\n",
137153
" status = detector.status\n",
138154
" if status[\"drift\"]:\n",
139155
" print(f\"Drift detected at index {i}\")\n",
140156
" break"
141157
],
142158
"metadata": {
143-
"collapsed": false
159+
"collapsed": false,
160+
"ExecuteTime": {
161+
"end_time": "2023-08-03T10:26:15.090283773Z",
162+
"start_time": "2023-08-03T10:26:14.762080041Z"
163+
}
144164
}
145165
},
146166
{

0 commit comments

Comments
 (0)