diff --git a/MyIA.AI.Notebooks/SymbolicAI/SymbolicLearning/SL-3-RelevanceLearning-Csharp.ipynb b/MyIA.AI.Notebooks/SymbolicAI/SymbolicLearning/SL-3-RelevanceLearning-Csharp.ipynb index 5352c40b99..959430cf5d 100644 --- a/MyIA.AI.Notebooks/SymbolicAI/SymbolicLearning/SL-3-RelevanceLearning-Csharp.ipynb +++ b/MyIA.AI.Notebooks/SymbolicAI/SymbolicLearning/SL-3-RelevanceLearning-Csharp.ipynb @@ -70,119 +70,18 @@ }, "outputs": [ { + "output_type": "display_data", "data": { - "text/html": [ - "\r\n", - "
\r\n", - " \r\n", - " \r\n", - "
" - ] + "text/html": "" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - "Apprentissage base sur la pertinence (RBL, AIMA 19.4) — moteur from-scratch." - ] + "text/plain": "Apprentissage base sur la pertinence (RBL, AIMA 19.4) — moteur from-scratch." }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} } ], "source": [ @@ -217,13 +116,11 @@ }, "outputs": [ { + "output_type": "display_data", "data": { - "text/plain": [ - "CheckDetermination pret : groupe par signature, detecte les violations de target constante." - ] + "text/plain": "CheckDetermination pret : groupe par signature, detecte les violations de target constante." }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} } ], "source": [ @@ -259,8 +156,22 @@ " var targetValues = kv.Value.Select(r => r[targetAttr]).Distinct().ToList();\n", " if (targetValues.Count > 1)\n", " {\n", - " // Violation : on garde la premiere paire en conflit pour le diagnostic.\n", - " res.Violations.Add((kv.Value[0], kv.Value[1]));\n", + " // Violation : on garde la PREMIERE paire en conflit reel pour le\n", + " // diagnostic (deux lignes qui different sur la cible), pas deux\n", + " // lignes qui s'accordent.\n", + " (Row A, Row B)? witness = null;\n", + " for (int i = 0; i < kv.Value.Count && !witness.HasValue; i++)\n", + " {\n", + " for (int j = i + 1; j < kv.Value.Count; j++)\n", + " {\n", + " if (kv.Value[i][targetAttr] != kv.Value[j][targetAttr])\n", + " {\n", + " witness = (kv.Value[i], kv.Value[j]);\n", + " break;\n", + " }\n", + " }\n", + " }\n", + " if (witness.HasValue) res.Violations.Add(witness.Value);\n", " }\n", " }\n", " res.Holds = res.Violations.Count == 0;\n", @@ -313,13 +224,11 @@ }, "outputs": [ { + "output_type": "display_data", "data": { - "text/plain": [ - "BuildDeterminationLattice pret : powerset complet evalue." - ] + "text/plain": "BuildDeterminationLattice pret : powerset complet evalue." }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} } ], "source": [ @@ -413,13 +322,11 @@ }, "outputs": [ { + "output_type": "display_data", "data": { - "text/plain": [ - "MinimalConsistentDet pret : BFS par taille, retourne le + petit sous-ensemble valide." - ] + "text/plain": "MinimalConsistentDet pret : BFS par taille, retourne le + petit sous-ensemble valide." }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} } ], "source": [ @@ -503,82 +410,53 @@ }, "outputs": [ { + "output_type": "display_data", "data": { - "text/plain": [ - "Donnees : proprietes moleculaires (10 molecules)" - ] + "text/plain": "Donnees : proprietes moleculaires (10 molecules)" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - " MW | LogP | HBD | HBA | Activite\r\n", - "--------------------------------------------------\r\n", - " low | low | low | low | inactive\r\n", - " low | low | low | high | inactive\r\n", - " medium | high | low | high | active\r\n", - " medium | high | high | high | active\r\n", - " high | high | low | high | active\r\n", - " high | high | high | high | active\r\n", - " high | low | high | low | inactive\r\n", - " medium | low | high | low | inactive\r\n", - " low | high | low | low | inactive\r\n", - " medium | high | low | low | active\r\n" - ] + "text/plain": " MW | LogP | HBD | HBA | Activite\r\n--------------------------------------------------\r\n low | low | low | low | inactive\r\n low | low | low | high | inactive\r\n medium | high | low | high | active\r\n medium | high | high | high | active\r\n high | high | low | high | active\r\n high | high | high | high | active\r\n high | low | high | low | inactive\r\n medium | low | high | low | inactive\r\n low | high | low | low | inactive\r\n medium | high | low | low | active\r\n" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - "\n", - "Recherche de determination minimale :" - ] + "text/plain": "\nRecherche de determination minimale :" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - " Niveau 1 : test de 4 combinaisons...\r\n", - " Niveau 2 : test de 6 combinaisons...\r\n", - " TROUVE : {mw, logp} apres 5 tests\r\n" - ] + "text/plain": " Niveau 1 : test de 4 combinaisons...\r\n Niveau 2 : test de 6 combinaisons...\r\n TROUVE : {mw, logp} apres 5 tests\r\n" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - "\n", - "Determination minimale : {mw, logp}" - ] + "text/plain": "\nDetermination minimale : {mw, logp}" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - "Sous-ensembles testes : 5 / 15" - ] + "text/plain": "Sous-ensembles testes : 5 / 15" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - "Reduction espace : O(2^4) -> O(2^2), facteur 4" - ] + "text/plain": "Reduction espace : O(2^4) -> O(2^2), facteur 4" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} } ], "source": [ @@ -679,104 +557,81 @@ }, "outputs": [ { + "output_type": "display_data", "data": { - "text/plain": [ - "Analyse de complexite : RBL vs selection aveugle\n" - ] + "text/plain": "Analyse de complexite : RBL vs selection aveugle\n" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - " n (total) | d (pertinent) | |H| sans RBL | |H| avec RBL | m sans | m avec" - ] + "text/plain": " n (total) | d (pertinent) | |H| sans RBL | |H| avec RBL | m sans | m avec" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - "------------------------------------------------------------------------------" - ] + "text/plain": "------------------------------------------------------------------------------" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - " 5 | 1 | 32 | 2 | 65 | 37" - ] + "text/plain": " 5 | 1 | 32 | 2 | 65 | 37" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - " 10 | 2 | 1024 | 4 | 100 | 44" - ] + "text/plain": " 10 | 2 | 1024 | 4 | 100 | 44" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - " 20 | 2 | 1048576 | 4 | 169 | 44" - ] + "text/plain": " 20 | 2 | 1048576 | 4 | 169 | 44" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - " 20 | 3 | 1048576 | 8 | 169 | 51" - ] + "text/plain": " 20 | 3 | 1048576 | 8 | 169 | 51" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - " 50 | 3 | 1125899906842624 | 8 | 377 | 51" - ] + "text/plain": " 50 | 3 | 1125899906842624 | 8 | 377 | 51" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - " 100 | 5 | 2^100 | 32 | 724 | 65" - ] + "text/plain": " 100 | 5 | 2^100 | 32 | 724 | 65" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - "\n", - "La reduction de l'espace est EXPONENTIELLE (2^n -> 2^d) ; m devient lineaire en d." - ] + "text/plain": "\nLa reduction de l'espace est EXPONENTIELLE (2^n -> 2^d) ; m devient lineaire en d." }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - "Pour n=100 et d=5 : 724 exemples sans RBL contre 65 avec la determination." - ] + "text/plain": "Pour n=100 et d=5 : 724 exemples sans RBL contre 65 avec la determination." }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} } ], "source": [ @@ -846,50 +701,39 @@ }, "outputs": [ { + "output_type": "display_data", "data": { - "text/plain": [ - "Parallele RBL <-> Web Semantique : la MEME contrainte, deux formalismes" - ] + "text/plain": "Parallele RBL <-> Web Semantique : la MEME contrainte, deux formalismes" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - "Propriete fonctionnelle :aConductivite — violations detectees :" - ] + "text/plain": "Propriete fonctionnelle :aConductivite — violations detectees :" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - " :Fe a 2 objets distincts : [high, medium]" - ] + "text/plain": " :Fe a 2 objets distincts : [high, medium]" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - "\n", - "Une determination RBL = exactement une owl:FunctionalProperty ; les deux formalismes" - ] + "text/plain": "\nUne determination RBL = exactement une owl:FunctionalProperty ; les deux formalismes" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - "expriment la meme contrainte fonctionnelle (un sujet -> au plus un objet)." - ] + "text/plain": "expriment la meme contrainte fonctionnelle (un sujet -> au plus un objet)." }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} } ], "source": [ @@ -982,59 +826,46 @@ }, "outputs": [ { + "output_type": "display_data", "data": { - "text/plain": [ - "Scores d'information mutuelle des proprietes moleculaires vs activite :" - ] + "text/plain": "Scores d'information mutuelle des proprietes moleculaires vs activite :" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - " I(logp ; activity) = 0,6100 bits" - ] + "text/plain": " I(logp ; activity) = 0,6100 bits" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - " I(mw ; activity) = 0,4000 bits" - ] + "text/plain": " I(mw ; activity) = 0,4000 bits" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - " I(hba ; activity) = 0,2781 bits" - ] + "text/plain": " I(hba ; activity) = 0,2781 bits" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - " I(hbd ; activity) = 0,0000 bits" - ] + "text/plain": " I(hbd ; activity) = 0,0000 bits" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - "\n", - "L'attribut avec la plus forte MI est le meilleur candidat pour demarrer la recherche de determination." - ] + "text/plain": "\nL'attribut avec la plus forte MI est le meilleur candidat pour demarrer la recherche de determination." }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} } ], "source": [ @@ -1114,22 +945,18 @@ }, "outputs": [ { + "output_type": "display_data", "data": { - "text/plain": [ - "Exercice 1 a completer" - ] + "text/plain": "Exercice 1 a completer" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - " (attendu pour high/high/low/high : 'active')" - ] + "text/plain": " (attendu pour high/high/low/high : 'active')" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} } ], "source": [ @@ -1191,22 +1018,18 @@ }, "outputs": [ { + "output_type": "display_data", "data": { - "text/plain": [ - "Exercice 2 a completer" - ] + "text/plain": "Exercice 2 a completer" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - " (attendu : mSans > mAvec, reduction ~ factorielle en n-d)" - ] + "text/plain": " (attendu : mSans > mAvec, reduction ~ factorielle en n-d)" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} } ], "source": [ @@ -1268,22 +1091,18 @@ }, "outputs": [ { + "output_type": "display_data", "data": { - "text/plain": [ - "Exercice 3 a completer" - ] + "text/plain": "Exercice 3 a completer" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - " (reflechir : anti-monotonie = si A determine, tout sur-ensemble de A determine aussi)" - ] + "text/plain": " (reflechir : anti-monotonie = si A determine, tout sur-ensemble de A determine aussi)" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} } ], "source": [ @@ -1348,176 +1167,135 @@ }, "outputs": [ { + "output_type": "display_data", "data": { - "text/html": [ - "
Installed Packages
" - ] + "text/html": "
Installing Packages
" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - "PFI ML.NET (FastTree) — top-2 par seed (stabilite du classement d'ensemble) :" - ] + "text/plain": "PFI ML.NET (FastTree) — top-2 par seed (stabilite du classement d'ensemble) :" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - " seed 1 : logp, mw" - ] + "text/plain": " seed 1 : logp, mw" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - " seed 2 : logp, mw" - ] + "text/plain": " seed 2 : logp, mw" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - " seed 3 : logp, mw" - ] + "text/plain": " seed 3 : logp, mw" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - " seed 4 : logp, mw" - ] + "text/plain": " seed 4 : logp, mw" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - " seed 5 : logp, mw" - ] + "text/plain": " seed 5 : logp, mw" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - "Rang PFI agrege (chute d'AUC moyenne sur 5 seeds) :" - ] + "text/plain": "Rang PFI agrege (chute d'AUC moyenne sur 5 seeds) :" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - " logp: 1,3000" - ] + "text/plain": " logp: 1,3000" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - " mw: 1,1867" - ] + "text/plain": " mw: 1,1867" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - " hbd: 1,0000" - ] + "text/plain": " hbd: 1,0000" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - " hba: 1,0000" - ] + "text/plain": " hba: 1,0000" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - "(Note : chute > 1.0 = artefact petit echantillon — AUC permutee negative ; seul le rang compte)" - ] + "text/plain": "(Note : chute > 1.0 = artefact petit echantillon — AUC permutee negative ; seul le rang compte)" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - "Top-2 ML.NET (PFI agrege) : logp, mw" - ] + "text/plain": "Top-2 ML.NET (PFI agrege) : logp, mw" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - "\n", - "Rang MI from-scratch (cellule 15) : logp > mw > hba > hbd" - ] + "text/plain": "\nRang MI from-scratch (cellule 15) : logp > mw > hba > hbd" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - "Determination minimale (cellule 9) : {mw, logp}" - ] + "text/plain": "Determination minimale (cellule 9) : {mw, logp}" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - "Concordance top-2 PFI == determination minimale : True" - ] + "text/plain": "Concordance top-2 PFI == determination minimale : True" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { + "output_type": "display_data", "data": { - "text/plain": [ - "Stabilite top-2 sur 5 seeds : 5 / 5" - ] + "text/plain": "Stabilite top-2 sur 5 seeds : 5 / 5" }, - "metadata": {}, - "output_type": "display_data" + "metadata": {} }, { - "name": "stderr", "output_type": "stream", - "text": [ - "\r\n", - "warning CS1701: En supposant que la référence d'assembly 'System.Collections.Immutable, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' utilisée par 'Microsoft.ML.Transforms' correspond à l'identité 'System.Collections.Immutable, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' de 'System.Collections.Immutable', il se peut que vous deviez fournir une stratégie runtime\r\n", - "\r\n" - ] + "name": "stderr", + "text": "\r\nwarning CS1701: En supposant que la référence d'assembly 'System.Collections.Immutable, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' utilisée par 'Microsoft.ML.Transforms' correspond à l'identité 'System.Collections.Immutable, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' de 'System.Collections.Immutable', il se peut que vous deviez fournir une stratégie runtime\r\n\r\n" } ], "source": [ @@ -1682,20 +1460,8 @@ "name": "C#", "pygments_lexer": "csharp", "version": "13.0" - }, - "papermill": { - "default_parameters": {}, - "duration": 11.710635, - "end_time": "2026-08-15T20:39:49.177037+00:00", - "environment_variables": {}, - "exception": null, - "input_path": "SL-3-RelevanceLearning-Csharp.ipynb", - "output_path": "sl3_out.ipynb", - "parameters": {}, - "start_time": "2026-08-15T20:39:37.466402+00:00", - "version": "2.7.0" } }, "nbformat": 4, "nbformat_minor": 5 -} +} \ No newline at end of file diff --git a/MyIA.AI.Notebooks/SymbolicAI/SymbolicLearning/SL-3-RelevanceLearning.ipynb b/MyIA.AI.Notebooks/SymbolicAI/SymbolicLearning/SL-3-RelevanceLearning.ipynb index b25e40a69c..7bebaf66d4 100644 --- a/MyIA.AI.Notebooks/SymbolicAI/SymbolicLearning/SL-3-RelevanceLearning.ipynb +++ b/MyIA.AI.Notebooks/SymbolicAI/SymbolicLearning/SL-3-RelevanceLearning.ipynb @@ -5,10 +5,10 @@ "id": "dbf96c32", "metadata": { "papermill": { - "duration": 0.004611, - "end_time": "2026-06-10T10:10:42.216138", + "duration": 0.005155, + "end_time": "2026-09-06T17:58:58.245660", "exception": false, - "start_time": "2026-06-10T10:10:42.211527", + "start_time": "2026-09-06T17:58:58.240505", "status": "completed" }, "tags": [] @@ -41,16 +41,16 @@ "id": "4eb99804", "metadata": { "execution": { - "iopub.execute_input": "2026-06-10T10:10:42.227868Z", - "iopub.status.busy": "2026-06-10T10:10:42.227868Z", - "iopub.status.idle": "2026-06-10T10:10:42.243061Z", - "shell.execute_reply": "2026-06-10T10:10:42.241997Z" + "iopub.execute_input": "2026-09-06T17:58:58.259812Z", + "iopub.status.busy": "2026-09-06T17:58:58.259812Z", + "iopub.status.idle": "2026-09-06T17:58:58.267828Z", + "shell.execute_reply": "2026-09-06T17:58:58.267324Z" }, "papermill": { - "duration": 0.02271, - "end_time": "2026-06-10T10:10:42.243578", + "duration": 0.015591, + "end_time": "2026-09-06T17:58:58.268833", "exception": false, - "start_time": "2026-06-10T10:10:42.220868", + "start_time": "2026-09-06T17:58:58.253242", "status": "completed" }, "tags": [] @@ -91,10 +91,10 @@ "id": "359e4cd2", "metadata": { "papermill": { - "duration": 0.003096, - "end_time": "2026-06-10T10:10:42.251302", + "duration": 0.004511, + "end_time": "2026-09-06T17:58:58.278344", "exception": false, - "start_time": "2026-06-10T10:10:42.248206", + "start_time": "2026-09-06T17:58:58.273833", "status": "completed" }, "tags": [] @@ -139,10 +139,10 @@ "id": "3a901336", "metadata": { "papermill": { - "duration": 0.004999, - "end_time": "2026-06-10T10:10:42.261307", + "duration": 0.005208, + "end_time": "2026-09-06T17:58:58.288552", "exception": false, - "start_time": "2026-06-10T10:10:42.256308", + "start_time": "2026-09-06T17:58:58.283344", "status": "completed" }, "tags": [] @@ -177,16 +177,16 @@ "id": "6b2244c7", "metadata": { "execution": { - "iopub.execute_input": "2026-06-10T10:10:42.274619Z", - "iopub.status.busy": "2026-06-10T10:10:42.274109Z", - "iopub.status.idle": "2026-06-10T10:10:42.289161Z", - "shell.execute_reply": "2026-06-10T10:10:42.288049Z" + "iopub.execute_input": "2026-09-06T17:58:58.301156Z", + "iopub.status.busy": "2026-09-06T17:58:58.300151Z", + "iopub.status.idle": "2026-09-06T17:58:58.312803Z", + "shell.execute_reply": "2026-09-06T17:58:58.311797Z" }, "papermill": { - "duration": 0.022873, - "end_time": "2026-06-10T10:10:42.290202", + "duration": 0.018677, + "end_time": "2026-09-06T17:58:58.312803", "exception": false, - "start_time": "2026-06-10T10:10:42.267329", + "start_time": "2026-09-06T17:58:58.294126", "status": "completed" }, "tags": [] @@ -213,10 +213,14 @@ "Verification des determinations :\n", " ('metal',) -> conductivity : OUI (6 groupes)\n", " ('density',) -> conductivity : NON (2 groupes)\n", + " temoin : Cu(high) vs Fe(medium)\n", " ('color',) -> conductivity : NON (4 groupes)\n", + " temoin : Al(medium) vs Hg(low)\n", " ('state',) -> conductivity : NON (2 groupes)\n", + " temoin : Cu(high) vs Fe(medium)\n", " ('metal', 'density') -> conductivity : OUI (6 groupes)\n", - " ('density', 'state') -> conductivity : NON (3 groupes)\n" + " ('density', 'state') -> conductivity : NON (3 groupes)\n", + " temoin : Cu(high) vs Fe(medium)\n" ] } ], @@ -250,7 +254,17 @@ " for key, rows in groups.items():\n", " target_values = set(row[target_attr] for row in rows)\n", " if len(target_values) > 1:\n", - " violations.append((rows[0], rows[1]))\n", + " # Témoin = premier couple de lignes qui DIFFERENT sur la cible\n", + " # (sinon le diagnostic exhibe deux lignes qui s'accordent).\n", + " witness = None\n", + " for i, row_a in enumerate(rows):\n", + " for row_b in rows[i+1:]:\n", + " if row_a[target_attr] != row_b[target_attr]:\n", + " witness = (row_a, row_b)\n", + " break\n", + " if witness:\n", + " break\n", + " violations.append(witness)\n", " \n", " return DeterminationResult(\n", " attrs=tuple(det_attrs),\n", @@ -289,7 +303,9 @@ "for attrs in [(\"metal\",), (\"density\",), (\"color\",), (\"state\",), (\"metal\", \"density\"), (\"density\", \"state\")]:\n", " result = check_determination(copper_data, list(attrs), \"conductivity\")\n", " status = \"OUI\" if result.holds else \"NON\"\n", - " print(f\" {str(attrs):30s} -> conductivity : {status} ({result.coverage} groupes)\")" + " print(f\" {str(attrs):30s} -> conductivity : {status} ({result.coverage} groupes)\")\n", + " for a, b in result.violations:\n", + " print(f\" temoin : {a['metal']}({a['conductivity']}) vs {b['metal']}({b['conductivity']})\")" ] }, { @@ -297,10 +313,10 @@ "id": "3fd9dbce", "metadata": { "papermill": { - "duration": 0.005683, - "end_time": "2026-06-10T10:10:42.301609", + "duration": 0.005517, + "end_time": "2026-09-06T17:58:58.324039", "exception": false, - "start_time": "2026-06-10T10:10:42.295926", + "start_time": "2026-09-06T17:58:58.318522", "status": "completed" }, "tags": [] @@ -324,10 +340,10 @@ "id": "29d1b9a6", "metadata": { "papermill": { - "duration": 0.00515, - "end_time": "2026-06-10T10:10:42.313057", + "duration": 0.005516, + "end_time": "2026-09-06T17:58:58.335556", "exception": false, - "start_time": "2026-06-10T10:10:42.307907", + "start_time": "2026-09-06T17:58:58.330040", "status": "completed" }, "tags": [] @@ -350,16 +366,16 @@ "id": "b19e64de", "metadata": { "execution": { - "iopub.execute_input": "2026-06-10T10:10:42.326110Z", - "iopub.status.busy": "2026-06-10T10:10:42.325600Z", - "iopub.status.idle": "2026-06-10T10:10:42.333904Z", - "shell.execute_reply": "2026-06-10T10:10:42.333330Z" + "iopub.execute_input": "2026-09-06T17:58:58.348094Z", + "iopub.status.busy": "2026-09-06T17:58:58.348094Z", + "iopub.status.idle": "2026-09-06T17:58:58.357631Z", + "shell.execute_reply": "2026-09-06T17:58:58.357631Z" }, "papermill": { - "duration": 0.016164, - "end_time": "2026-06-10T10:10:42.334941", + "duration": 0.017577, + "end_time": "2026-09-06T17:58:58.358646", "exception": false, - "start_time": "2026-06-10T10:10:42.318777", + "start_time": "2026-09-06T17:58:58.341069", "status": "completed" }, "tags": [] @@ -477,10 +493,10 @@ "id": "1bfe64c6", "metadata": { "papermill": { - "duration": 0.00591, - "end_time": "2026-06-10T10:10:42.346547", + "duration": 0.005685, + "end_time": "2026-09-06T17:58:58.370332", "exception": false, - "start_time": "2026-06-10T10:10:42.340637", + "start_time": "2026-09-06T17:58:58.364647", "status": "completed" }, "tags": [] @@ -505,16 +521,16 @@ "id": "0aecc697", "metadata": { "execution": { - "iopub.execute_input": "2026-06-10T10:10:42.358973Z", - "iopub.status.busy": "2026-06-10T10:10:42.358456Z", - "iopub.status.idle": "2026-06-10T10:10:42.364682Z", - "shell.execute_reply": "2026-06-10T10:10:42.364131Z" + "iopub.execute_input": "2026-09-06T17:58:58.382353Z", + "iopub.status.busy": "2026-09-06T17:58:58.382353Z", + "iopub.status.idle": "2026-09-06T17:58:58.388495Z", + "shell.execute_reply": "2026-09-06T17:58:58.388495Z" }, "papermill": { - "duration": 0.012935, - "end_time": "2026-06-10T10:10:42.365730", + "duration": 0.01366, + "end_time": "2026-09-06T17:58:58.389502", "exception": false, - "start_time": "2026-06-10T10:10:42.352795", + "start_time": "2026-09-06T17:58:58.375842", "status": "completed" }, "tags": [] @@ -589,10 +605,10 @@ "id": "5ea54d7e", "metadata": { "papermill": { - "duration": 0.005665, - "end_time": "2026-06-10T10:10:42.376536", + "duration": 0.006008, + "end_time": "2026-09-06T17:58:58.400527", "exception": false, - "start_time": "2026-06-10T10:10:42.370871", + "start_time": "2026-09-06T17:58:58.394519", "status": "completed" }, "tags": [] @@ -632,16 +648,16 @@ "id": "6319964e", "metadata": { "execution": { - "iopub.execute_input": "2026-06-10T10:10:42.390248Z", - "iopub.status.busy": "2026-06-10T10:10:42.389727Z", - "iopub.status.idle": "2026-06-10T10:10:42.411876Z", - "shell.execute_reply": "2026-06-10T10:10:42.410875Z" + "iopub.execute_input": "2026-09-06T17:58:58.413520Z", + "iopub.status.busy": "2026-09-06T17:58:58.413520Z", + "iopub.status.idle": "2026-09-06T17:58:58.423570Z", + "shell.execute_reply": "2026-09-06T17:58:58.423570Z" }, "papermill": { - "duration": 0.029858, - "end_time": "2026-06-10T10:10:42.412875", + "duration": 0.01878, + "end_time": "2026-09-06T17:58:58.424577", "exception": false, - "start_time": "2026-06-10T10:10:42.383017", + "start_time": "2026-09-06T17:58:58.405797", "status": "completed" }, "tags": [] @@ -775,10 +791,10 @@ "id": "1ed6994f", "metadata": { "papermill": { - "duration": 0.005507, - "end_time": "2026-06-10T10:10:42.422382", + "duration": 0.006341, + "end_time": "2026-09-06T17:58:58.436918", "exception": false, - "start_time": "2026-06-10T10:10:42.416875", + "start_time": "2026-09-06T17:58:58.430577", "status": "completed" }, "tags": [] @@ -802,10 +818,10 @@ "id": "88f1d020", "metadata": { "papermill": { - "duration": 0.005805, - "end_time": "2026-06-10T10:10:42.433188", + "duration": 0.006013, + "end_time": "2026-09-06T17:58:58.447938", "exception": false, - "start_time": "2026-06-10T10:10:42.427383", + "start_time": "2026-09-06T17:58:58.441925", "status": "completed" }, "tags": [] @@ -822,16 +838,16 @@ "id": "57161fdd", "metadata": { "execution": { - "iopub.execute_input": "2026-06-10T10:10:42.446156Z", - "iopub.status.busy": "2026-06-10T10:10:42.445638Z", - "iopub.status.idle": "2026-06-10T10:10:42.458569Z", - "shell.execute_reply": "2026-06-10T10:10:42.457479Z" + "iopub.execute_input": "2026-09-06T17:58:58.461399Z", + "iopub.status.busy": "2026-09-06T17:58:58.461399Z", + "iopub.status.idle": "2026-09-06T17:58:58.472822Z", + "shell.execute_reply": "2026-09-06T17:58:58.472822Z" }, "papermill": { - "duration": 0.020734, - "end_time": "2026-06-10T10:10:42.459616", + "duration": 0.020592, + "end_time": "2026-09-06T17:58:58.474827", "exception": false, - "start_time": "2026-06-10T10:10:42.438882", + "start_time": "2026-09-06T17:58:58.454235", "status": "completed" }, "tags": [] @@ -911,10 +927,10 @@ "id": "03c12410", "metadata": { "papermill": { - "duration": 0.005714, - "end_time": "2026-06-10T10:10:42.472081", + "duration": 0.005518, + "end_time": "2026-09-06T17:58:58.487105", "exception": false, - "start_time": "2026-06-10T10:10:42.466367", + "start_time": "2026-09-06T17:58:58.481587", "status": "completed" }, "tags": [] @@ -937,10 +953,10 @@ "id": "72861666", "metadata": { "papermill": { - "duration": 0.00515, - "end_time": "2026-06-10T10:10:42.483019", + "duration": 0.006002, + "end_time": "2026-09-06T17:58:58.499134", "exception": false, - "start_time": "2026-06-10T10:10:42.477869", + "start_time": "2026-09-06T17:58:58.493132", "status": "completed" }, "tags": [] @@ -965,16 +981,16 @@ "id": "8352f3b5", "metadata": { "execution": { - "iopub.execute_input": "2026-06-10T10:10:42.496359Z", - "iopub.status.busy": "2026-06-10T10:10:42.495836Z", - "iopub.status.idle": "2026-06-10T10:10:42.504583Z", - "shell.execute_reply": "2026-06-10T10:10:42.504583Z" + "iopub.execute_input": "2026-09-06T17:58:58.513742Z", + "iopub.status.busy": "2026-09-06T17:58:58.513742Z", + "iopub.status.idle": "2026-09-06T17:58:58.522073Z", + "shell.execute_reply": "2026-09-06T17:58:58.522073Z" }, "papermill": { - "duration": 0.017859, - "end_time": "2026-06-10T10:10:42.506584", + "duration": 0.01788, + "end_time": "2026-09-06T17:58:58.523090", "exception": false, - "start_time": "2026-06-10T10:10:42.488725", + "start_time": "2026-09-06T17:58:58.505210", "status": "completed" }, "tags": [] @@ -1055,10 +1071,10 @@ "id": "61cf237e", "metadata": { "papermill": { - "duration": 0.006243, - "end_time": "2026-06-10T10:10:42.520827", + "duration": 0.006025, + "end_time": "2026-09-06T17:58:58.535110", "exception": false, - "start_time": "2026-06-10T10:10:42.514584", + "start_time": "2026-09-06T17:58:58.529085", "status": "completed" }, "tags": [] @@ -1073,16 +1089,16 @@ "id": "bad47a00", "metadata": { "execution": { - "iopub.execute_input": "2026-06-10T10:10:42.535832Z", - "iopub.status.busy": "2026-06-10T10:10:42.534830Z", - "iopub.status.idle": "2026-06-10T10:10:42.551340Z", - "shell.execute_reply": "2026-06-10T10:10:42.551340Z" + "iopub.execute_input": "2026-09-06T17:58:58.547643Z", + "iopub.status.busy": "2026-09-06T17:58:58.547643Z", + "iopub.status.idle": "2026-09-06T17:58:58.553664Z", + "shell.execute_reply": "2026-09-06T17:58:58.553159Z" }, "papermill": { - "duration": 0.02451, - "end_time": "2026-06-10T10:10:42.552341", + "duration": 0.013561, + "end_time": "2026-09-06T17:58:58.554670", "exception": false, - "start_time": "2026-06-10T10:10:42.527831", + "start_time": "2026-09-06T17:58:58.541109", "status": "completed" }, "tags": [] @@ -1134,10 +1150,10 @@ "id": "3913ca3c", "metadata": { "papermill": { - "duration": 0.006013, - "end_time": "2026-06-10T10:10:42.564976", + "duration": 0.00551, + "end_time": "2026-09-06T17:58:58.566180", "exception": false, - "start_time": "2026-06-10T10:10:42.558963", + "start_time": "2026-09-06T17:58:58.560670", "status": "completed" }, "tags": [] @@ -1156,16 +1172,16 @@ "id": "7c8627eb", "metadata": { "execution": { - "iopub.execute_input": "2026-06-10T10:10:42.575279Z", - "iopub.status.busy": "2026-06-10T10:10:42.575279Z", - "iopub.status.idle": "2026-06-10T10:10:44.876560Z", - "shell.execute_reply": "2026-06-10T10:10:44.875560Z" + "iopub.execute_input": "2026-09-06T17:58:58.580974Z", + "iopub.status.busy": "2026-09-06T17:58:58.580974Z", + "iopub.status.idle": "2026-09-06T17:59:00.249758Z", + "shell.execute_reply": "2026-09-06T17:59:00.248754Z" }, "papermill": { - "duration": 2.307679, - "end_time": "2026-06-10T10:10:44.877207", + "duration": 1.677796, + "end_time": "2026-09-06T17:59:00.250761", "exception": false, - "start_time": "2026-06-10T10:10:42.569528", + "start_time": "2026-09-06T17:58:58.572965", "status": "completed" }, "tags": [] @@ -1180,12 +1196,12 @@ "\n", "Attribut | Info. Mutuelle | Rang\n", "----------------------------------------\n", - "R2 | 2.5861 | #1 (RELEVANT)\n", - "R1 | 2.3647 | #2 (RELEVANT)\n", - "N2 | 0.3651 | #3 (noise)\n", - "N3 | 0.3294 | #4 (noise)\n", - "N6 | 0.2749 | #5 (noise)\n", - "N1 | 0.2068 | #6 (noise)\n", + "R2 | 2.6943 | #1 (RELEVANT)\n", + "R1 | 2.5523 | #2 (RELEVANT)\n", + "N6 | 0.3245 | #3 (noise)\n", + "N1 | 0.2953 | #4 (noise)\n", + "N3 | 0.1785 | #5 (noise)\n", + "N2 | 0.0000 | #6 (noise)\n", "N4 | 0.0000 | #7 (noise)\n", "N5 | 0.0000 | #8 (noise)\n", "N7 | 0.0000 | #9 (noise)\n", @@ -1241,10 +1257,10 @@ "id": "cf88517c", "metadata": { "papermill": { - "duration": 0.003503, - "end_time": "2026-06-10T10:10:44.885713", + "duration": 0.006187, + "end_time": "2026-09-06T17:59:00.264724", "exception": false, - "start_time": "2026-06-10T10:10:44.882210", + "start_time": "2026-09-06T17:59:00.258537", "status": "completed" }, "tags": [] @@ -1276,16 +1292,16 @@ "id": "ffe3e3fe", "metadata": { "execution": { - "iopub.execute_input": "2026-06-10T10:10:44.896223Z", - "iopub.status.busy": "2026-06-10T10:10:44.896223Z", - "iopub.status.idle": "2026-06-10T10:10:44.906225Z", - "shell.execute_reply": "2026-06-10T10:10:44.906225Z" + "iopub.execute_input": "2026-09-06T17:59:00.281284Z", + "iopub.status.busy": "2026-09-06T17:59:00.280692Z", + "iopub.status.idle": "2026-09-06T17:59:00.292659Z", + "shell.execute_reply": "2026-09-06T17:59:00.291596Z" }, "papermill": { - "duration": 0.017012, - "end_time": "2026-06-10T10:10:44.907728", + "duration": 0.022591, + "end_time": "2026-09-06T17:59:00.293714", "exception": false, - "start_time": "2026-06-10T10:10:44.890716", + "start_time": "2026-09-06T17:59:00.271123", "status": "completed" }, "tags": [] @@ -1358,10 +1374,10 @@ "id": "79de4eaf", "metadata": { "papermill": { - "duration": 0.005508, - "end_time": "2026-06-10T10:10:44.917239", + "duration": 0.010348, + "end_time": "2026-09-06T17:59:00.310465", "exception": false, - "start_time": "2026-06-10T10:10:44.911731", + "start_time": "2026-09-06T17:59:00.300117", "status": "completed" }, "tags": [] @@ -1384,10 +1400,10 @@ "id": "6d1d952f", "metadata": { "papermill": { - "duration": 0.004574, - "end_time": "2026-06-10T10:10:44.926315", + "duration": 0.009516, + "end_time": "2026-09-06T17:59:00.331005", "exception": false, - "start_time": "2026-06-10T10:10:44.921741", + "start_time": "2026-09-06T17:59:00.321489", "status": "completed" }, "tags": [] @@ -1407,6 +1423,8 @@ "\n", "En OWL, declarer qu'une propriete est **fonctionnelle** equivaut a affirmer une détermination : pour un individu donne, il n'existe qu'une seule valeur. C'est la même intuition que RBL.\n", "\n", + "> **Précision** : l'analogie se joue sur la *multiplicité* (un sujet ne doit pas porter deux valeurs pour une propriété fonctionnelle), pas sur une parité stricte avec un reasoner OWL. Pour une propriete d'objet fonctionnelle, deux objets distincts ne sont pas une inconsistance en soi : l'axiome les rend egaux, et un reasoner ne s'alerte que si leur difference est par ailleurs affirmee (DifferentIndividuals).\n", + "\n", "> **Connexion inter-series** : Les notebooks SemanticWeb (SW-13) couvrent les reasoners OWL qui exploitent ces proprietes fonctionnelles pour inférer de nouveaux faits. Le RBL fournit le cadre théorique sous-jacent." ] }, @@ -1416,16 +1434,16 @@ "id": "7c4e0e96", "metadata": { "execution": { - "iopub.execute_input": "2026-06-10T10:10:44.936822Z", - "iopub.status.busy": "2026-06-10T10:10:44.935823Z", - "iopub.status.idle": "2026-06-10T10:10:44.954959Z", - "shell.execute_reply": "2026-06-10T10:10:44.954054Z" + "iopub.execute_input": "2026-09-06T17:59:00.351094Z", + "iopub.status.busy": "2026-09-06T17:59:00.350094Z", + "iopub.status.idle": "2026-09-06T17:59:00.363874Z", + "shell.execute_reply": "2026-09-06T17:59:00.362868Z" }, "papermill": { - "duration": 0.025136, - "end_time": "2026-06-10T10:10:44.955958", + "duration": 0.024344, + "end_time": "2026-09-06T17:59:00.364873", "exception": false, - "start_time": "2026-06-10T10:10:44.930822", + "start_time": "2026-09-06T17:59:00.340529", "status": "completed" }, "tags": [] @@ -1467,11 +1485,19 @@ "\n", "\n", "def functional_violations(triples, prop):\n", - " \"\"\"Detecte les violations de fonctionnalite d'une propriete OWL.\n", - "\n", - " Une propriete fonctionnelle associe a chaque sujet au plus un objet :\n", - " deux objets distincts pour le meme sujet = incoherence, exactement ce\n", - " que detecterait un reasoner OWL (HermiT, Pellet) sur l'ontologie.\n", + " \"\"\"Detecte les multiplicités d'une propriete declaree fonctionnelle.\n", + "\n", + " En RBL, une violation = deux lignes du meme groupe qui different sur la\n", + " cible. Cote OWL, declarer une propriete *fonctionnelle* impose la meme\n", + " contrainte : un sujet lie a deux objets distincts sur cette propriete.\n", + " Le minimum que cette fonction verifie est donc la multiplicité.\n", + "\n", + " NB : ce n'est pas une parité stricte avec un reasoner OWL (HermiT,\n", + " Pellet). Pour une propriete d'*objet* fonctionnelle, p(a,b) ^ p(a,c)\n", + " n'est pas une inconsistance : l'axiome entraine b = c, et un reasoner\n", + " n'en signale une que si DifferentIndividuals(b,c) est par ailleurs\n", + " asserte. La multiplicité detectee ici est l'antescente RBL de cette\n", + " contrainte, pas l'inference OWL elle-meme.\n", " \"\"\"\n", " objects = defaultdict(set)\n", " for s, p, o in triples:\n", @@ -1515,10 +1541,10 @@ "id": "b2ed3f33", "metadata": { "papermill": { - "duration": 0.006017, - "end_time": "2026-06-10T10:10:44.965974", + "duration": 0.006509, + "end_time": "2026-09-06T17:59:00.378890", "exception": false, - "start_time": "2026-06-10T10:10:44.959957", + "start_time": "2026-09-06T17:59:00.372381", "status": "completed" }, "tags": [] @@ -1544,16 +1570,16 @@ "id": "5f23755b", "metadata": { "execution": { - "iopub.execute_input": "2026-06-10T10:10:44.977541Z", - "iopub.status.busy": "2026-06-10T10:10:44.977541Z", - "iopub.status.idle": "2026-06-10T10:10:44.986291Z", - "shell.execute_reply": "2026-06-10T10:10:44.985162Z" + "iopub.execute_input": "2026-09-06T17:59:00.398913Z", + "iopub.status.busy": "2026-09-06T17:59:00.397913Z", + "iopub.status.idle": "2026-09-06T17:59:00.409359Z", + "shell.execute_reply": "2026-09-06T17:59:00.408354Z" }, "papermill": { - "duration": 0.016278, - "end_time": "2026-06-10T10:10:44.986816", + "duration": 0.020447, + "end_time": "2026-09-06T17:59:00.409359", "exception": false, - "start_time": "2026-06-10T10:10:44.970538", + "start_time": "2026-09-06T17:59:00.388912", "status": "completed" }, "tags": [] @@ -1659,7 +1685,16 @@ { "cell_type": "markdown", "id": "sl3-ex1-var-md", - "metadata": {}, + "metadata": { + "papermill": { + "duration": 0.010127, + "end_time": "2026-09-06T17:59:00.427523", + "exception": false, + "start_time": "2026-09-06T17:59:00.417396", + "status": "completed" + }, + "tags": [] + }, "source": [ "### Exercice 1 (variation) : Un attribut trompeur\n", "\n", @@ -1677,7 +1712,22 @@ "cell_type": "code", "execution_count": 13, "id": "sl3-ex1-var-code", - "metadata": {}, + "metadata": { + "execution": { + "iopub.execute_input": "2026-09-06T17:59:00.444536Z", + "iopub.status.busy": "2026-09-06T17:59:00.444536Z", + "iopub.status.idle": "2026-09-06T17:59:00.448772Z", + "shell.execute_reply": "2026-09-06T17:59:00.447767Z" + }, + "papermill": { + "duration": 0.014253, + "end_time": "2026-09-06T17:59:00.448772", + "exception": false, + "start_time": "2026-09-06T17:59:00.434519", + "status": "completed" + }, + "tags": [] + }, "outputs": [ { "name": "stdout", @@ -1714,10 +1764,10 @@ "id": "68e70655", "metadata": { "papermill": { - "duration": 0.003999, - "end_time": "2026-06-10T10:10:44.996958", + "duration": 0.00915, + "end_time": "2026-09-06T17:59:00.463430", "exception": false, - "start_time": "2026-06-10T10:10:44.992959", + "start_time": "2026-09-06T17:59:00.454280", "status": "completed" }, "tags": [] @@ -1732,16 +1782,16 @@ "id": "cc196778", "metadata": { "execution": { - "iopub.execute_input": "2026-06-10T10:10:45.005466Z", - "iopub.status.busy": "2026-06-10T10:10:45.005466Z", - "iopub.status.idle": "2026-06-10T10:10:45.017527Z", - "shell.execute_reply": "2026-06-10T10:10:45.016971Z" + "iopub.execute_input": "2026-09-06T17:59:00.480801Z", + "iopub.status.busy": "2026-09-06T17:59:00.480283Z", + "iopub.status.idle": "2026-09-06T17:59:00.783043Z", + "shell.execute_reply": "2026-09-06T17:59:00.782000Z" }, "papermill": { - "duration": 0.017572, - "end_time": "2026-06-10T10:10:45.018530", + "duration": 0.311838, + "end_time": "2026-09-06T17:59:00.784069", "exception": false, - "start_time": "2026-06-10T10:10:45.000958", + "start_time": "2026-09-06T17:59:00.472231", "status": "completed" }, "tags": [] @@ -1844,7 +1894,16 @@ { "cell_type": "markdown", "id": "sl3-ex2-var-md", - "metadata": {}, + "metadata": { + "papermill": { + "duration": 0.005754, + "end_time": "2026-09-06T17:59:00.796397", + "exception": false, + "start_time": "2026-09-06T17:59:00.790643", + "status": "completed" + }, + "tags": [] + }, "source": [ "### Exercice 2 (variation) : Robustesse quand le bruit est \"presque\" pertinent\n", "\n", @@ -1862,7 +1921,22 @@ "cell_type": "code", "execution_count": 15, "id": "sl3-ex2-var-code", - "metadata": {}, + "metadata": { + "execution": { + "iopub.execute_input": "2026-09-06T17:59:00.809576Z", + "iopub.status.busy": "2026-09-06T17:59:00.809576Z", + "iopub.status.idle": "2026-09-06T17:59:00.814917Z", + "shell.execute_reply": "2026-09-06T17:59:00.813814Z" + }, + "papermill": { + "duration": 0.013545, + "end_time": "2026-09-06T17:59:00.815947", + "exception": false, + "start_time": "2026-09-06T17:59:00.802402", + "status": "completed" + }, + "tags": [] + }, "outputs": [ { "name": "stdout", @@ -1899,10 +1973,10 @@ "id": "ba0bdbc2", "metadata": { "papermill": { - "duration": 0.003, - "end_time": "2026-06-10T10:10:45.025876", + "duration": 0.005525, + "end_time": "2026-09-06T17:59:00.827066", "exception": false, - "start_time": "2026-06-10T10:10:45.022876", + "start_time": "2026-09-06T17:59:00.821541", "status": "completed" }, "tags": [] @@ -1917,16 +1991,16 @@ "id": "8072ef89", "metadata": { "execution": { - "iopub.execute_input": "2026-06-10T10:10:45.035878Z", - "iopub.status.busy": "2026-06-10T10:10:45.034877Z", - "iopub.status.idle": "2026-06-10T10:10:45.048385Z", - "shell.execute_reply": "2026-06-10T10:10:45.047268Z" + "iopub.execute_input": "2026-09-06T17:59:00.840791Z", + "iopub.status.busy": "2026-09-06T17:59:00.839752Z", + "iopub.status.idle": "2026-09-06T17:59:01.227144Z", + "shell.execute_reply": "2026-09-06T17:59:01.226640Z" }, "papermill": { - "duration": 0.020015, - "end_time": "2026-06-10T10:10:45.048892", + "duration": 0.395572, + "end_time": "2026-09-06T17:59:01.228148", "exception": false, - "start_time": "2026-06-10T10:10:45.028877", + "start_time": "2026-09-06T17:59:00.832576", "status": "completed" }, "tags": [] @@ -2077,7 +2151,16 @@ { "cell_type": "markdown", "id": "sl3-ex3-var-md", - "metadata": {}, + "metadata": { + "papermill": { + "duration": 0.005, + "end_time": "2026-09-06T17:59:01.242157", + "exception": false, + "start_time": "2026-09-06T17:59:01.237157", + "status": "completed" + }, + "tags": [] + }, "source": [ "### Exercice 3 (variation) : Piège de la redondance\n", "\n", @@ -2095,7 +2178,22 @@ "cell_type": "code", "execution_count": 17, "id": "sl3-ex3-var-code", - "metadata": {}, + "metadata": { + "execution": { + "iopub.execute_input": "2026-09-06T17:59:01.255757Z", + "iopub.status.busy": "2026-09-06T17:59:01.255757Z", + "iopub.status.idle": "2026-09-06T17:59:01.260093Z", + "shell.execute_reply": "2026-09-06T17:59:01.259087Z" + }, + "papermill": { + "duration": 0.012846, + "end_time": "2026-09-06T17:59:01.260598", + "exception": false, + "start_time": "2026-09-06T17:59:01.247752", + "status": "completed" + }, + "tags": [] + }, "outputs": [ { "name": "stdout", @@ -2132,10 +2230,10 @@ "id": "5eba2e20", "metadata": { "papermill": { - "duration": 0.003506, - "end_time": "2026-06-10T10:10:45.056401", + "duration": 0.006063, + "end_time": "2026-09-06T17:59:01.273202", "exception": false, - "start_time": "2026-06-10T10:10:45.052895", + "start_time": "2026-09-06T17:59:01.267139", "status": "completed" }, "tags": [] @@ -2172,7 +2270,16 @@ { "cell_type": "markdown", "id": "b421cbe4", - "metadata": {}, + "metadata": { + "papermill": { + "duration": 0.00651, + "end_time": "2026-09-06T17:59:01.286696", + "exception": false, + "start_time": "2026-09-06T17:59:01.280186", + "status": "completed" + }, + "tags": [] + }, "source": [ "***\n", "\n", @@ -2195,10 +2302,10 @@ "id": "730925ce", "metadata": { "papermill": { - "duration": 0.003002, - "end_time": "2026-06-10T10:10:45.063403", + "duration": 0.007509, + "end_time": "2026-09-06T17:59:01.299719", "exception": false, - "start_time": "2026-06-10T10:10:45.060401", + "start_time": "2026-09-06T17:59:01.292210", "status": "completed" }, "tags": [] @@ -2220,6 +2327,19 @@ } ], "metadata": { + "cost": { + "api_provider": "none", + "api_usd_est": 0, + "cpu_min": 10, + "external_account": "none", + "free_alternative": null, + "gpu_required": false, + "metadata_written": "2026-08-02T20:30Z", + "network": false, + "reduced_pedagogical": null, + "reproducibility": "HIGH", + "validator": "manual" + }, "kernelspec": { "display_name": "Python 3", "language": "python", @@ -2235,34 +2355,21 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.11" + "version": "3.11.9" }, "papermill": { "default_parameters": {}, - "duration": 4.966385, - "end_time": "2026-06-10T10:10:45.391904", + "duration": 4.795467, + "end_time": "2026-09-06T17:59:01.646341", "environment_variables": {}, "exception": null, "input_path": "SL-3-RelevanceLearning.ipynb", "output_path": "SL-3-RelevanceLearning.ipynb", "parameters": {}, - "start_time": "2026-06-10T10:10:40.425519", + "start_time": "2026-09-06T17:58:56.850874", "version": "2.7.0" - }, - "cost": { - "api_usd_est": 0, - "api_provider": "none", - "cpu_min": 10, - "gpu_required": false, - "network": false, - "external_account": "none", - "free_alternative": null, - "reduced_pedagogical": null, - "reproducibility": "HIGH", - "metadata_written": "2026-08-02T20:30Z", - "validator": "manual" } }, "nbformat": 4, "nbformat_minor": 5 -} +} \ No newline at end of file diff --git a/scripts/notebook_tools/twin_pairs.d/sl-3-relevancelearning.yaml b/scripts/notebook_tools/twin_pairs.d/sl-3-relevancelearning.yaml index 7b51f90716..3368cfd3cd 100644 --- a/scripts/notebook_tools/twin_pairs.d/sl-3-relevancelearning.yaml +++ b/scripts/notebook_tools/twin_pairs.d/sl-3-relevancelearning.yaml @@ -32,6 +32,12 @@ csharp_sha: 5352c40b992e351dcc9f1eecff756b410169f472 content_python_sha: f286249f48e0857e4e103ba794b59e02a1dad06dbdfd4b913da306ae25f7b00e content_csharp_sha: c44f4d2e843714bd32906bac75895e44c0d5bac9621c37094bcc2b096687380e + - date: "2026-09-06" + by: myia-po-2026:CoursIA + python_sha: 7bebaf66d4fd857286b2eadcfa2bf8b29cdfcaf5 + csharp_sha: 959430cf5db677eb6a335c7c662714633745a934 + content_python_sha: 9530a212e8ddf916f40df18fe5f0df4f6727dc92d44490bcb26a520f92499140 + content_csharp_sha: 2e0bbf3dd99aaa8485239c498eea4c36ab30a5eeacc768368804692606fdeb66 bridge_verdict: SOTA-OK bridge_verdict_reason: "Python = BCL from-scratch pour determinations fonctionnelles + treillis des determinations + MINIMAL-CONSISTENT-DET + lien Web Semantique + defi presentation ; application phare = selection d'attributs guidee, faite avec **sklearn** (`mutual_info_classif`, cellule 21). C# = BCL .NET from-scratch (`HashSet` + `Dictionary` + powerset via combinatoire) pour determinations + treillis (powerset) + determination minimale + application activite biologique des molecules + borne PAC quantifiee + information mutuelle (section 7). Verdict initial RECOVERABLE-LOCAL (2026-08-04) : le coeur pedagogique (RBL) est paritable des deux cotes, l'asymetrie residait dans les enrichissements distincts (Web Semantique cote Python, borne PAC + MI cote C#). Verdict REVOQUE par la tranche 2 (epic #10382, 2026-08-15) : le twin Python selectionne les attributs avec sklearn (lib de reference) ; le twin C# branche le pendant .NET de production — **Microsoft.ML** (`PermutationFeatureImportance`, PFI, Breiman 2001) — sur le meme jeu `moleculeData` (section 9) : foret gradient-boostee FastTree, chute d'AUC par permutation d'attribut (PFI agrege sur 5 seeds MLContext, top-2 {logp, mw} stable 5/5), rang confronte a l'information mutuelle from-scratch et a la determination minimale `{mw, logp}` (concordance top-2, 5/5 seeds). Axes binding #10459 : NuGet .NET = le canal (Microsoft.ML 5.0.0 + Microsoft.ML.FastTree 5.0.0, pas de reimplementation), P/Invoke N/A, CLI N/A, IKVM N/A, PythonNet N/A. Le from-scratch est conserve (sections 4 et 7 gardent leur valeur pedagogique : comment la MI se calcule, pourquoi la determination minimale est une contrainte logique). `parity_level: native-both` (les deux jumeaux referencent un moteur d'apprentissage de production : sklearn cote Python, ML.NET cote C#)." known_differences: @@ -40,3 +46,4 @@ - "Application phare : Python sur selection d'attributs via sklearn (`mutual_info_classif` sur jeu synthetique R1..R2 + N1..N8) ; C# sur activite biologique des molecules (10 molecules, mw/logp/hbd/hba) via MI from-scratch + pont ML.NET PFI (FastTree). Les deux classent les attributs pertinents ; le C# confronte le rang ML.NET (top-2 {logp, mw} stable 5/5 seeds) a la determination minimale `{mw, logp}` (concordance)." - "Selection d'attributs : sklearn (Python, statistique MI) vs ML.NET (C#, PFI sur foret FastTree) — deux instruments differents (mesure statistique vs importance modele-basee par permutation) qui repondent a la meme question et convergent sur le meme top-2 {logp, mw} (epic #10382, tranche 2)." - "Normalisation de rendu markdown (2026-08-28, PR #13272, cibles #13266) : conversion des separateurs decoratifs ```---``` en ```***``` (anti setext-heading), cote(s) touche(s) : Python (10 cellules separateurs) / C# (2 cellules separateurs). Changement purement cosmetique : sources des cellules code byte-identiques, substance pedagogique inchangee (spot-audit main<->HEAD)." + - "Fix du choix du temoin de violation (2026-09-06, issue #14837) : le diagnostic de determination exhibait comme temoin deux lignes QUI S'ACCORDENT sur la cible (ex. Cu high vs Cu high), ce qui ne demontre pas une violation ; on conserve desormais la PREMIERE paire reellement en conflit (deux lignes qui different sur la cible). Fix symetrique Python (cellule 4, check_determination) et C# (cellule 3, CheckDetermination) pour la parite de contenu, plus recadrage du docstring functional_violations (Python cellule 26) et d'un encart metadonnees (cellule 25). Notebooks re-executes AVEC outputs ; sources des autres cellules inchangees."