Auto-update: 2025-10-23 15:04:00
This commit is contained in:
parent
7698240a79
commit
6170c48371
28 changed files with 19938 additions and 0 deletions
10793
activite2/carte_corse_knn_interactive.html
Normal file
10793
activite2/carte_corse_knn_interactive.html
Normal file
File diff suppressed because one or more lines are too long
688
activite2/classification_corse_knn_V2.ipynb
Normal file
688
activite2/classification_corse_knn_V2.ipynb
Normal file
|
|
@ -0,0 +1,688 @@
|
|||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Classification des Micro-régions de Corse par K-NN\n",
|
||||
"\n",
|
||||
"Ce notebook implémente un système de classification des micro-régions corses basé sur l'algorithme des k plus proches voisins (k-NN). Cliquez sur la carte pour identifier la micro-région correspondante.\n",
|
||||
"\n",
|
||||
"**Fichiers nécessaires :**\n",
|
||||
"- `communes-de-corse-en-corse-et-francais.csv` : Liste des communes avec coordonnées GPS\n",
|
||||
"- `communes-par-territoire-de-projet-de-la-collectivite-territoriale-de-corse0.csv` : Territoires de projet par commune"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Installation des bibliothèques nécessaires\n",
|
||||
"!pip install folium pandas numpy scikit-learn --quiet"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import pandas as pd\n",
|
||||
"import numpy as np\n",
|
||||
"import folium\n",
|
||||
"from sklearn.neighbors import KNeighborsClassifier\n",
|
||||
"from IPython.display import display, HTML\n",
|
||||
"import json\n",
|
||||
"import re"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 1. Chargement et préparation des données"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Chargement du fichier avec les coordonnées GPS\n",
|
||||
"df_coords = pd.read_csv('communes-de-corse-en-corse-et-francais.csv', \n",
|
||||
" sep=';', encoding='utf-8')\n",
|
||||
"\n",
|
||||
"print(f\"Fichier coordonnées: {len(df_coords)} communes\")\n",
|
||||
"print(\"\\nPremières lignes:\")\n",
|
||||
"display(df_coords.head())\n",
|
||||
"print(\"\\nColonnes disponibles:\")\n",
|
||||
"print(df_coords.columns.tolist())"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Chargement du fichier avec les territoires de projet\n",
|
||||
"df_territoires = pd.read_csv('communes-par-territoire-de-projet-de-la-collectivite-territoriale-de-corse0.csv',\n",
|
||||
" sep=';', encoding='utf-8')\n",
|
||||
"\n",
|
||||
"print(f\"Fichier territoires: {len(df_territoires)} communes\")\n",
|
||||
"print(\"\\nPremières lignes:\")\n",
|
||||
"display(df_territoires.head())\n",
|
||||
"print(\"\\nTerritoires de projet (micro-régions):\")\n",
|
||||
"print(sorted(df_territoires['Territoire de projet'].unique()))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 2. Extraction des coordonnées GPS"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"def extract_coordinates(point_geo_str):\n",
|
||||
" \"\"\"\n",
|
||||
" Extrait latitude et longitude de la colonne Point_Geo\n",
|
||||
" Format attendu: \"41.984099158, 8.798384636\"\n",
|
||||
" \"\"\"\n",
|
||||
" if pd.isna(point_geo_str):\n",
|
||||
" return None, None\n",
|
||||
" \n",
|
||||
" try:\n",
|
||||
" # Supprimer les espaces et split par virgule\n",
|
||||
" coords = str(point_geo_str).strip().split(',')\n",
|
||||
" if len(coords) == 2:\n",
|
||||
" lat = float(coords[0].strip())\n",
|
||||
" lon = float(coords[1].strip())\n",
|
||||
" return lat, lon\n",
|
||||
" except:\n",
|
||||
" pass\n",
|
||||
" \n",
|
||||
" return None, None\n",
|
||||
"\n",
|
||||
"# Extraction des coordonnées\n",
|
||||
"df_coords[['Latitude', 'Longitude']] = df_coords['Point_Geo'].apply(\n",
|
||||
" lambda x: pd.Series(extract_coordinates(x))\n",
|
||||
")\n",
|
||||
"\n",
|
||||
"# Vérification\n",
|
||||
"print(\"Extraction des coordonnées:\")\n",
|
||||
"print(f\"Communes avec coordonnées: {df_coords['Latitude'].notna().sum()}/{len(df_coords)}\")\n",
|
||||
"print(\"\\nExemple:\")\n",
|
||||
"display(df_coords[['Nom français', 'Latitude', 'Longitude']].head())"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 3. Fusion des deux fichiers"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Normalisation des noms de communes pour la jointure\n",
|
||||
"def normalize_commune_name(name):\n",
|
||||
" \"\"\"\n",
|
||||
" Normalise le nom d'une commune pour faciliter la jointure\n",
|
||||
" \"\"\"\n",
|
||||
" if pd.isna(name):\n",
|
||||
" return ''\n",
|
||||
" # Convertir en majuscules et supprimer les espaces multiples\n",
|
||||
" return str(name).upper().strip()\n",
|
||||
"\n",
|
||||
"df_coords['Commune_norm'] = df_coords['Nom français'].apply(normalize_commune_name)\n",
|
||||
"df_territoires['Commune_norm'] = df_territoires['Commune'].apply(normalize_commune_name)\n",
|
||||
"\n",
|
||||
"# Fusion des deux dataframes\n",
|
||||
"df = pd.merge(\n",
|
||||
" df_coords,\n",
|
||||
" df_territoires[['Commune_norm', 'Territoire de projet']],\n",
|
||||
" on='Commune_norm',\n",
|
||||
" how='inner'\n",
|
||||
")\n",
|
||||
"\n",
|
||||
"# Renommer pour cohérence\n",
|
||||
"df['Commune'] = df['Nom français']\n",
|
||||
"\n",
|
||||
"print(f\"Fusion réussie: {len(df)} communes avec coordonnées ET territoire de projet\")\n",
|
||||
"print(\"\\nAperçu des données fusionnées:\")\n",
|
||||
"display(df[['Commune', 'Latitude', 'Longitude', 'Territoire de projet']].head(10))"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Nettoyage: supprimer les lignes sans coordonnées\n",
|
||||
"df_clean = df.dropna(subset=['Latitude', 'Longitude', 'Territoire de projet']).copy()\n",
|
||||
"\n",
|
||||
"print(f\"\\n✅ Données finales: {len(df_clean)} communes prêtes pour la classification\")\n",
|
||||
"print(f\"\\nRépartition par micro-région:\")\n",
|
||||
"print(df_clean['Territoire de projet'].value_counts().sort_index())"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 4. Entraînement du modèle k-NN"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Préparation des données pour k-NN\n",
|
||||
"X = df_clean[['Latitude', 'Longitude']].values\n",
|
||||
"y = df_clean['Territoire de projet'].values\n",
|
||||
"\n",
|
||||
"# Création du modèle k-NN avec k=5 (ajustable)\n",
|
||||
"k = 5\n",
|
||||
"knn = KNeighborsClassifier(n_neighbors=k, weights='distance', metric='haversine')\n",
|
||||
"\n",
|
||||
"# Conversion des coordonnées en radians pour la distance haversine\n",
|
||||
"X_rad = np.radians(X)\n",
|
||||
"\n",
|
||||
"# Entraînement du modèle\n",
|
||||
"knn.fit(X_rad, y)\n",
|
||||
"\n",
|
||||
"print(f\"✅ Modèle k-NN entraîné avec k={k} voisins\")\n",
|
||||
"print(f\"📊 Nombre de micro-régions: {len(np.unique(y))}\")\n",
|
||||
"print(f\"\\n🗺️ Micro-régions identifiées:\")\n",
|
||||
"for i, region in enumerate(sorted(np.unique(y)), 1):\n",
|
||||
" count = (y == region).sum()\n",
|
||||
" print(f\" {i:2d}. {region} ({count} communes)\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 5. Création de la carte interactive avec Folium"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Couleurs pour chaque micro-région\n",
|
||||
"microregions = sorted(df_clean['Territoire de projet'].unique())\n",
|
||||
"colors = ['red', 'blue', 'green', 'purple', 'orange', 'darkred', \n",
|
||||
" 'lightred', 'beige', 'darkblue', 'darkgreen', 'cadetblue', \n",
|
||||
" 'darkpurple', 'pink', 'lightblue', 'lightgreen', 'gray', 'black', 'lightgray']\n",
|
||||
"\n",
|
||||
"color_map = {region: colors[i % len(colors)] for i, region in enumerate(microregions)}\n",
|
||||
"\n",
|
||||
"print(\"🎨 Carte des couleurs par micro-région:\")\n",
|
||||
"for region, color in sorted(color_map.items()):\n",
|
||||
" print(f\" • {region}: {color}\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Coordonnées du centre de la Corse\n",
|
||||
"center_lat = df_clean['Latitude'].mean()\n",
|
||||
"center_lon = df_clean['Longitude'].mean()\n",
|
||||
"\n",
|
||||
"print(f\"Centre de la carte: {center_lat:.4f}°N, {center_lon:.4f}°E\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 6. Carte interactive avec prédiction au clic"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Création de la carte interactive\n",
|
||||
"m_interactive = folium.Map(\n",
|
||||
" location=[center_lat, center_lon],\n",
|
||||
" zoom_start=9,\n",
|
||||
" tiles='OpenStreetMap'\n",
|
||||
")\n",
|
||||
"\n",
|
||||
"# Ajout des marqueurs pour chaque commune\n",
|
||||
"for idx, row in df_clean.iterrows():\n",
|
||||
" folium.CircleMarker(\n",
|
||||
" location=[row['Latitude'], row['Longitude']],\n",
|
||||
" radius=3,\n",
|
||||
" popup=f\"<b>{row['Commune']}</b><br>{row['Territoire de projet']}<br><small>({row['Latitude']:.4f}, {row['Longitude']:.4f})</small>\",\n",
|
||||
" tooltip=row['Commune'],\n",
|
||||
" color=color_map[row['Territoire de projet']],\n",
|
||||
" fill=True,\n",
|
||||
" fillColor=color_map[row['Territoire de projet']],\n",
|
||||
" fillOpacity=0.7\n",
|
||||
" ).add_to(m_interactive)\n",
|
||||
"\n",
|
||||
"# Préparer les données des communes pour JavaScript\n",
|
||||
"communes_data = df_clean[['Latitude', 'Longitude', 'Commune', 'Territoire de projet']].to_dict('records')\n",
|
||||
"\n",
|
||||
"# JavaScript pour la prédiction k-NN au clic\n",
|
||||
"click_js = f\"\"\"\n",
|
||||
"<script>\n",
|
||||
"// Données des communes\n",
|
||||
"var communesData = {json.dumps(communes_data)};\n",
|
||||
"\n",
|
||||
"// Carte des couleurs\n",
|
||||
"var colorMap = {json.dumps(color_map)};\n",
|
||||
"\n",
|
||||
"// Fonction pour calculer la distance haversine\n",
|
||||
"function haversineDistance(lat1, lon1, lat2, lon2) {{\n",
|
||||
" const R = 6371; // Rayon de la Terre en km\n",
|
||||
" const dLat = (lat2 - lat1) * Math.PI / 180;\n",
|
||||
" const dLon = (lon2 - lon1) * Math.PI / 180;\n",
|
||||
" const a = Math.sin(dLat/2) * Math.sin(dLat/2) +\n",
|
||||
" Math.cos(lat1 * Math.PI / 180) * Math.cos(lat2 * Math.PI / 180) *\n",
|
||||
" Math.sin(dLon/2) * Math.sin(dLon/2);\n",
|
||||
" const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));\n",
|
||||
" return R * c;\n",
|
||||
"}}\n",
|
||||
"\n",
|
||||
"// Fonction k-NN\n",
|
||||
"function predictRegion(lat, lon, k) {{\n",
|
||||
" // Calculer les distances\n",
|
||||
" var distances = communesData.map(function(commune) {{\n",
|
||||
" return {{\n",
|
||||
" distance: haversineDistance(lat, lon, commune.Latitude, commune.Longitude),\n",
|
||||
" region: commune['Territoire de projet'],\n",
|
||||
" commune: commune.Commune\n",
|
||||
" }};\n",
|
||||
" }});\n",
|
||||
" \n",
|
||||
" // Trier par distance\n",
|
||||
" distances.sort((a, b) => a.distance - b.distance);\n",
|
||||
" \n",
|
||||
" // Prendre les k plus proches\n",
|
||||
" var kNearest = distances.slice(0, k);\n",
|
||||
" \n",
|
||||
" // Vote pondéré par l'inverse de la distance\n",
|
||||
" var votes = {{}};\n",
|
||||
" kNearest.forEach(function(neighbor) {{\n",
|
||||
" var weight = 1 / (neighbor.distance + 0.001); // +0.001 pour éviter division par 0\n",
|
||||
" if (votes[neighbor.region]) {{\n",
|
||||
" votes[neighbor.region] += weight;\n",
|
||||
" }} else {{\n",
|
||||
" votes[neighbor.region] = weight;\n",
|
||||
" }}\n",
|
||||
" }});\n",
|
||||
" \n",
|
||||
" // Trouver la région gagnante\n",
|
||||
" var maxVote = 0;\n",
|
||||
" var predictedRegion = '';\n",
|
||||
" for (var region in votes) {{\n",
|
||||
" if (votes[region] > maxVote) {{\n",
|
||||
" maxVote = votes[region];\n",
|
||||
" predictedRegion = region;\n",
|
||||
" }}\n",
|
||||
" }}\n",
|
||||
" \n",
|
||||
" return {{\n",
|
||||
" region: predictedRegion,\n",
|
||||
" neighbors: kNearest\n",
|
||||
" }};\n",
|
||||
"}}\n",
|
||||
"\n",
|
||||
"// Variable pour stocker le marqueur de prédiction\n",
|
||||
"var predictionMarker = null;\n",
|
||||
"var neighborLines = [];\n",
|
||||
"\n",
|
||||
"// Attendre que la carte soit chargée\n",
|
||||
"setTimeout(function() {{\n",
|
||||
" var maps = document.querySelectorAll('.folium-map');\n",
|
||||
" if (maps.length > 0) {{\n",
|
||||
" var mapElement = maps[maps.length - 1];\n",
|
||||
" var leafletMap = mapElement._leaflet_map;\n",
|
||||
" \n",
|
||||
" if (leafletMap) {{\n",
|
||||
" leafletMap.on('click', function(e) {{\n",
|
||||
" var lat = e.latlng.lat;\n",
|
||||
" var lon = e.latlng.lng;\n",
|
||||
" \n",
|
||||
" // Prédiction avec k={k}\n",
|
||||
" var result = predictRegion(lat, lon, {k});\n",
|
||||
" \n",
|
||||
" // Supprimer l'ancien marqueur et lignes\n",
|
||||
" if (predictionMarker) {{\n",
|
||||
" leafletMap.removeLayer(predictionMarker);\n",
|
||||
" }}\n",
|
||||
" neighborLines.forEach(function(line) {{\n",
|
||||
" leafletMap.removeLayer(line);\n",
|
||||
" }});\n",
|
||||
" neighborLines = [];\n",
|
||||
" \n",
|
||||
" // Créer le popup avec informations détaillées\n",
|
||||
" var popupContent = '<div style=\"min-width: 200px;\">' +\n",
|
||||
" '<h4 style=\"margin: 5px 0; color: ' + colorMap[result.region] + ';\">🎯 ' + result.region + '</h4>' +\n",
|
||||
" '<p style=\"margin: 5px 0; font-size: 11px;\"><b>Coordonnées cliquées:</b><br>' + \n",
|
||||
" 'Lat: ' + lat.toFixed(5) + '°<br>Lon: ' + lon.toFixed(5) + '°</p>' +\n",
|
||||
" '<hr style=\"margin: 5px 0;\">' +\n",
|
||||
" '<p style=\"margin: 5px 0; font-size: 11px;\"><b>{k} plus proches communes:</b></p>' +\n",
|
||||
" '<ul style=\"margin: 5px 0; padding-left: 20px; font-size: 10px;\">';\n",
|
||||
" \n",
|
||||
" result.neighbors.forEach(function(neighbor, i) {{\n",
|
||||
" popupContent += '<li><b>' + neighbor.commune + '</b> (' + neighbor.distance.toFixed(2) + ' km)</li>';\n",
|
||||
" }});\n",
|
||||
" \n",
|
||||
" popupContent += '</ul></div>';\n",
|
||||
" \n",
|
||||
" // Ajouter le nouveau marqueur\n",
|
||||
" predictionMarker = L.marker([lat, lon], {{\n",
|
||||
" icon: L.divIcon({{\n",
|
||||
" className: 'prediction-marker',\n",
|
||||
" html: '<div style=\"background-color: ' + colorMap[result.region] + \n",
|
||||
" '; width: 20px; height: 20px; border-radius: 50%; ' +\n",
|
||||
" 'border: 3px solid white; box-shadow: 0 0 10px rgba(0,0,0,0.5);\"></div>',\n",
|
||||
" iconSize: [20, 20]\n",
|
||||
" }})\n",
|
||||
" }}).addTo(leafletMap);\n",
|
||||
" \n",
|
||||
" predictionMarker.bindPopup(popupContent, {{maxWidth: 300}}).openPopup();\n",
|
||||
" \n",
|
||||
" // Ajouter des lignes vers les k plus proches voisins\n",
|
||||
" result.neighbors.forEach(function(neighbor) {{\n",
|
||||
" var commune = communesData.find(c => c.Commune === neighbor.commune);\n",
|
||||
" if (commune) {{\n",
|
||||
" var line = L.polyline(\n",
|
||||
" [[lat, lon], [commune.Latitude, commune.Longitude]],\n",
|
||||
" {{\n",
|
||||
" color: 'gray',\n",
|
||||
" weight: 1,\n",
|
||||
" opacity: 0.5,\n",
|
||||
" dashArray: '5, 5'\n",
|
||||
" }}\n",
|
||||
" ).addTo(leafletMap);\n",
|
||||
" neighborLines.push(line);\n",
|
||||
" }}\n",
|
||||
" }});\n",
|
||||
" }});\n",
|
||||
" \n",
|
||||
" console.log('✅ Gestionnaire de clic k-NN activé');\n",
|
||||
" console.log('📊 ' + communesData.length + ' communes chargées');\n",
|
||||
" }}\n",
|
||||
" }}\n",
|
||||
"}}, 1000);\n",
|
||||
"</script>\n",
|
||||
"\"\"\"\n",
|
||||
"\n",
|
||||
"m_interactive.get_root().html.add_child(folium.Element(click_js))\n",
|
||||
"\n",
|
||||
"# Ajout de la légende\n",
|
||||
"legend_html = '''\n",
|
||||
"<div style=\"position: fixed; \n",
|
||||
" top: 10px; right: 10px; width: 250px; max-height: 85vh; overflow-y: auto;\n",
|
||||
" background-color: white; border:2px solid grey; z-index:9999; border-radius: 5px;\n",
|
||||
" font-size:12px; padding: 10px; box-shadow: 0 0 15px rgba(0,0,0,0.2);\">\n",
|
||||
"<p style=\"margin-bottom: 8px; font-weight: bold; font-size: 14px;\">🗺️ Micro-régions de Corse</p>\n",
|
||||
"'''\n",
|
||||
"\n",
|
||||
"for region, color in sorted(color_map.items()):\n",
|
||||
" legend_html += f'<p style=\"margin: 3px 0;\"><i class=\"fa fa-circle\" style=\"color:{color}\"></i> {region}</p>'\n",
|
||||
"\n",
|
||||
"legend_html += f'<hr style=\"margin: 8px 0;\"><p style=\"margin: 3px 0; font-size: 11px; color: #666;\">k = {k} voisins<br>Distance: Haversine</p></div>'\n",
|
||||
"\n",
|
||||
"m_interactive.get_root().html.add_child(folium.Element(legend_html))\n",
|
||||
"\n",
|
||||
"# Ajout d'instructions\n",
|
||||
"instructions_html = '''\n",
|
||||
"<div style=\"position: fixed; \n",
|
||||
" bottom: 10px; left: 10px; width: 320px; \n",
|
||||
" background-color: white; border:2px solid grey; z-index:9999; border-radius: 5px;\n",
|
||||
" font-size:13px; padding: 12px; box-shadow: 0 0 15px rgba(0,0,0,0.2);\">\n",
|
||||
"<p style=\"margin: 0 0 8px 0; font-weight: bold;\">🖱️ Mode d'emploi</p>\n",
|
||||
"<p style=\"margin: 5px 0; line-height: 1.4;\"><b>Cliquez</b> n'importe où sur la carte pour prédire la micro-région.</p>\n",
|
||||
"<p style=\"margin: 5px 0; line-height: 1.4; font-size: 11px;\">• Un marqueur coloré apparaît au point cliqué<br>\n",
|
||||
"• Les lignes pointillées montrent les k communes les plus proches<br>\n",
|
||||
"• Le popup affiche la prédiction détaillée</p>\n",
|
||||
"</div>\n",
|
||||
"'''\n",
|
||||
"\n",
|
||||
"m_interactive.get_root().html.add_child(folium.Element(instructions_html))\n",
|
||||
"\n",
|
||||
"print(\"\\n✅ Carte interactive créée avec succès!\")\n",
|
||||
"print(f\"\\n🖱️ Cliquez sur n'importe quel point de la carte pour prédire sa micro-région avec k={k} voisins.\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Affichage de la carte interactive\n",
|
||||
"m_interactive"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 7. Sauvegarde de la carte"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Sauvegarder la carte interactive\n",
|
||||
"m_interactive.save('carte_corse_knn_interactive.html')\n",
|
||||
"print(\"✅ Carte sauvegardée dans 'carte_corse_knn_interactive.html'\")\n",
|
||||
"print(\"📁 Vous pouvez ouvrir ce fichier dans un navigateur pour une utilisation autonome.\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 8. Test de la prédiction (optionnel)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Fonction pour tester la prédiction sur des coordonnées spécifiques\n",
|
||||
"def predict_region(lat, lon, k_value=5):\n",
|
||||
" \"\"\"\n",
|
||||
" Prédit la micro-région pour des coordonnées données\n",
|
||||
" \"\"\"\n",
|
||||
" # Conversion en radians\n",
|
||||
" coords_rad = np.radians([[lat, lon]])\n",
|
||||
" \n",
|
||||
" # Prédiction\n",
|
||||
" prediction = knn.predict(coords_rad)[0]\n",
|
||||
" \n",
|
||||
" # Trouver les k plus proches voisins\n",
|
||||
" distances, indices = knn.kneighbors(coords_rad)\n",
|
||||
" \n",
|
||||
" # Convertir les distances de radians en km\n",
|
||||
" distances_km = distances[0] * 6371 # Rayon de la Terre en km\n",
|
||||
" \n",
|
||||
" print(f\"\\n📍 Coordonnées: {lat:.5f}°N, {lon:.5f}°E\")\n",
|
||||
" print(f\"🎯 Micro-région prédite: {prediction}\")\n",
|
||||
" print(f\"\\n{k_value} plus proches communes:\")\n",
|
||||
" \n",
|
||||
" for i, idx in enumerate(indices[0]):\n",
|
||||
" commune_info = df_clean.iloc[idx]\n",
|
||||
" print(f\" {i+1}. {commune_info['Commune']:30s} ({commune_info['Territoire de projet']:30s}) - {distances_km[i]:6.2f} km\")\n",
|
||||
" \n",
|
||||
" return prediction\n",
|
||||
"\n",
|
||||
"# Exemples de test\n",
|
||||
"print(\"=\" * 100)\n",
|
||||
"print(\"TESTS DE PRÉDICTION k-NN\")\n",
|
||||
"print(\"=\" * 100)\n",
|
||||
"\n",
|
||||
"# Test 1: Centre approximatif de la Corse (vers Corte)\n",
|
||||
"print(\"\\n🔍 Test 1: Centre de la Corse\")\n",
|
||||
"predict_region(42.15, 9.15, k)\n",
|
||||
"\n",
|
||||
"# Test 2: Nord de la Corse (Balagne/Bastia)\n",
|
||||
"print(\"\\n🔍 Test 2: Nord de la Corse\")\n",
|
||||
"predict_region(42.55, 8.85, k)\n",
|
||||
"\n",
|
||||
"# Test 3: Sud de la Corse (vers Porto-Vecchio)\n",
|
||||
"print(\"\\n🔍 Test 3: Sud de la Corse\")\n",
|
||||
"predict_region(41.65, 9.15, k)\n",
|
||||
"\n",
|
||||
"# Test 4: Ouest (vers Ajaccio)\n",
|
||||
"print(\"\\n🔍 Test 4: Ouest de la Corse (Ajaccio)\")\n",
|
||||
"predict_region(41.93, 8.74, k)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 9. Analyse de performance (optionnel)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Évaluation de la cohérence du modèle (cross-validation)\n",
|
||||
"from sklearn.model_selection import cross_val_score\n",
|
||||
"\n",
|
||||
"# Test avec différentes valeurs de k\n",
|
||||
"k_values = [3, 5, 7, 9, 11, 15]\n",
|
||||
"scores = []\n",
|
||||
"\n",
|
||||
"print(\"📊 Évaluation de la précision pour différentes valeurs de k:\\n\")\n",
|
||||
"print(f\"{'k':<5} {'Précision moyenne':<20} {'Écart-type':<15}\")\n",
|
||||
"print(\"-\" * 50)\n",
|
||||
"\n",
|
||||
"for k_val in k_values:\n",
|
||||
" knn_temp = KNeighborsClassifier(n_neighbors=k_val, weights='distance', metric='haversine')\n",
|
||||
" cv_scores = cross_val_score(knn_temp, X_rad, y, cv=5)\n",
|
||||
" mean_score = cv_scores.mean()\n",
|
||||
" std_score = cv_scores.std()\n",
|
||||
" scores.append(mean_score)\n",
|
||||
" print(f\"{k_val:<5} {mean_score:.4f} ({mean_score*100:5.2f}%) ± {std_score:.4f}\")\n",
|
||||
"\n",
|
||||
"best_k = k_values[scores.index(max(scores))]\n",
|
||||
"best_score = max(scores)\n",
|
||||
"print(\"\\n\" + \"=\" * 50)\n",
|
||||
"print(f\"✨ Meilleure valeur de k: {best_k} (précision: {best_score:.4f} / {best_score*100:.2f}%)\")\n",
|
||||
"print(\"=\" * 50)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 10. Statistiques par micro-région"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Statistiques descriptives par micro-région\n",
|
||||
"print(\"📈 STATISTIQUES PAR MICRO-RÉGION\\n\")\n",
|
||||
"print(f\"{'Micro-région':<35} {'Nb communes':<15} {'% du total'}\")\n",
|
||||
"print(\"=\" * 65)\n",
|
||||
"\n",
|
||||
"total_communes = len(df_clean)\n",
|
||||
"stats = df_clean['Territoire de projet'].value_counts().sort_index()\n",
|
||||
"\n",
|
||||
"for region, count in stats.items():\n",
|
||||
" pct = (count / total_communes) * 100\n",
|
||||
" print(f\"{region:<35} {count:<15} {pct:>5.1f}%\")\n",
|
||||
"\n",
|
||||
"print(\"=\" * 65)\n",
|
||||
"print(f\"{'TOTAL':<35} {total_communes:<15} 100.0%\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Conclusion\n",
|
||||
"\n",
|
||||
"✅ **Notebook k-NN Corse - Résumé**\n",
|
||||
"\n",
|
||||
"Ce notebook implémente un classificateur k-NN pour les micro-régions de Corse avec:\n",
|
||||
"1. ✅ Chargement des données depuis 2 fichiers CSV (coordonnées + territoires)\n",
|
||||
"2. ✅ Extraction automatique des coordonnées GPS depuis la colonne Point_Geo\n",
|
||||
"3. ✅ Fusion intelligente des deux sources de données\n",
|
||||
"4. ✅ Entraînement d'un modèle k-NN avec distance haversine\n",
|
||||
"5. ✅ Carte interactive Folium avec prédiction au clic\n",
|
||||
"6. ✅ Visualisation des k plus proches voisins\n",
|
||||
"7. ✅ Tests de performance et validation\n",
|
||||
"8. ✅ Export HTML pour utilisation autonome\n",
|
||||
"\n",
|
||||
"**🖱️ Utilisation:**\n",
|
||||
"- Cliquez n'importe où sur la carte\n",
|
||||
"- Un marqueur coloré apparaît avec la micro-région prédite\n",
|
||||
"- Des lignes pointillées montrent les k communes les plus proches\n",
|
||||
"- Un popup détaille la prédiction et les voisins\n",
|
||||
"\n",
|
||||
"**📁 Fichier exporté:** `carte_corse_knn_interactive.html`\n",
|
||||
"\n",
|
||||
"La carte HTML peut être ouverte dans n'importe quel navigateur pour une utilisation autonome!"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.8.0"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 4
|
||||
}
|
||||
620
activite2/classification_microregions_corse.ipynb
Normal file
620
activite2/classification_microregions_corse.ipynb
Normal file
|
|
@ -0,0 +1,620 @@
|
|||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Classification des Micro-régions de Corse par K-NN\n",
|
||||
"\n",
|
||||
"Ce notebook implémente un système de classification des micro-régions corses basé sur l'algorithme des k plus proches voisins (k-NN). Cliquez sur la carte pour identifier la micro-région correspondante."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Installation des bibliothèques nécessaires\n",
|
||||
"!pip install folium pandas numpy scikit-learn geopy --quiet"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import pandas as pd\n",
|
||||
"import numpy as np\n",
|
||||
"import folium\n",
|
||||
"from folium import plugins\n",
|
||||
"from sklearn.neighbors import KNeighborsClassifier\n",
|
||||
"from geopy.geocoders import Nominatim\n",
|
||||
"from geopy.extra.rate_limiter import RateLimiter\n",
|
||||
"import time\n",
|
||||
"from IPython.display import display, HTML\n",
|
||||
"import json"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 1. Chargement et préparation des données"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Chargement du fichier CSV\n",
|
||||
"df = pd.read_csv('communes-par-territoire-de-projet-de-la-collectivite-territoriale-de-corse0.csv', \n",
|
||||
" sep=';', encoding='utf-8')\n",
|
||||
"\n",
|
||||
"print(f\"Nombre de communes: {len(df)}\")\n",
|
||||
"print(\"\\nPremières lignes:\")\n",
|
||||
"display(df.head())\n",
|
||||
"print(\"\\nTerritoires de projet (micro-régions):\")\n",
|
||||
"print(df['Territoire de projet'].unique())"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 2. Géocodage des communes\n",
|
||||
"\n",
|
||||
"Si le fichier ne contient pas déjà les coordonnées GPS, nous les récupérons via géocodage."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Fonction pour obtenir les coordonnées GPS d'une commune\n",
|
||||
"def geocode_commune(commune, departement, code_postal):\n",
|
||||
" \"\"\"\n",
|
||||
" Géocode une commune corse pour obtenir ses coordonnées GPS\n",
|
||||
" \"\"\"\n",
|
||||
" geolocator = Nominatim(user_agent=\"corse_knn_classifier\")\n",
|
||||
" \n",
|
||||
" try:\n",
|
||||
" # Essai avec le nom de la commune et Corse\n",
|
||||
" query = f\"{commune}, Corse, France\"\n",
|
||||
" location = geolocator.geocode(query, timeout=10)\n",
|
||||
" \n",
|
||||
" if location:\n",
|
||||
" return location.latitude, location.longitude\n",
|
||||
" \n",
|
||||
" # Essai avec le code postal\n",
|
||||
" query = f\"{commune}, {code_postal}, France\"\n",
|
||||
" location = geolocator.geocode(query, timeout=10)\n",
|
||||
" \n",
|
||||
" if location:\n",
|
||||
" return location.latitude, location.longitude\n",
|
||||
" \n",
|
||||
" except Exception as e:\n",
|
||||
" print(f\"Erreur pour {commune}: {e}\")\n",
|
||||
" \n",
|
||||
" return None, None\n",
|
||||
"\n",
|
||||
"# Vérifier si les colonnes GPS existent déjà\n",
|
||||
"if 'Latitude' not in df.columns or 'Longitude' not in df.columns:\n",
|
||||
" print(\"Géocodage des communes en cours... (cela peut prendre quelques minutes)\")\n",
|
||||
" \n",
|
||||
" # Géocodage avec rate limiting pour respecter les limites de l'API\n",
|
||||
" latitudes = []\n",
|
||||
" longitudes = []\n",
|
||||
" \n",
|
||||
" for idx, row in df.iterrows():\n",
|
||||
" lat, lon = geocode_commune(row['Commune'], row['Département'], row['Code Postal'])\n",
|
||||
" latitudes.append(lat)\n",
|
||||
" longitudes.append(lon)\n",
|
||||
" \n",
|
||||
" # Affichage de la progression\n",
|
||||
" if (idx + 1) % 10 == 0:\n",
|
||||
" print(f\"Progression: {idx + 1}/{len(df)} communes géocodées\")\n",
|
||||
" \n",
|
||||
" # Pause pour respecter les limites de l'API\n",
|
||||
" time.sleep(1.5)\n",
|
||||
" \n",
|
||||
" df['Latitude'] = latitudes\n",
|
||||
" df['Longitude'] = longitudes\n",
|
||||
" \n",
|
||||
" # Sauvegarde du dataframe avec coordonnées\n",
|
||||
" df.to_csv('communes_corse_avec_gps.csv', sep=';', index=False, encoding='utf-8')\n",
|
||||
" print(\"\\nGéocodage terminé et sauvegardé dans 'communes_corse_avec_gps.csv'\")\n",
|
||||
"else:\n",
|
||||
" print(\"Les coordonnées GPS sont déjà présentes dans le fichier.\")\n",
|
||||
"\n",
|
||||
"# Supprimer les lignes sans coordonnées\n",
|
||||
"df_clean = df.dropna(subset=['Latitude', 'Longitude']).copy()\n",
|
||||
"print(f\"\\nCommunes avec coordonnées GPS: {len(df_clean)}/{len(df)}\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 3. Entraînement du modèle k-NN"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Préparation des données pour k-NN\n",
|
||||
"X = df_clean[['Latitude', 'Longitude']].values\n",
|
||||
"y = df_clean['Territoire de projet'].values\n",
|
||||
"\n",
|
||||
"# Création du modèle k-NN avec k=5 (ajustable)\n",
|
||||
"k = 5\n",
|
||||
"knn = KNeighborsClassifier(n_neighbors=k, weights='distance', metric='haversine')\n",
|
||||
"\n",
|
||||
"# Conversion des coordonnées en radians pour la distance haversine\n",
|
||||
"X_rad = np.radians(X)\n",
|
||||
"\n",
|
||||
"# Entraînement du modèle\n",
|
||||
"knn.fit(X_rad, y)\n",
|
||||
"\n",
|
||||
"print(f\"Modèle k-NN entraîné avec k={k} voisins\")\n",
|
||||
"print(f\"Nombre de micro-régions: {len(np.unique(y))}\")\n",
|
||||
"print(f\"Micro-régions: {sorted(np.unique(y))}\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 4. Création de la carte interactive avec Folium"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Couleurs pour chaque micro-région\n",
|
||||
"microregions = sorted(df_clean['Territoire de projet'].unique())\n",
|
||||
"colors = ['red', 'blue', 'green', 'purple', 'orange', 'darkred', \n",
|
||||
" 'lightred', 'beige', 'darkblue', 'darkgreen', 'cadetblue', \n",
|
||||
" 'darkpurple', 'pink', 'lightblue', 'lightgreen', 'gray', 'black', 'lightgray']\n",
|
||||
"\n",
|
||||
"color_map = {region: colors[i % len(colors)] for i, region in enumerate(microregions)}\n",
|
||||
"\n",
|
||||
"print(\"Carte des couleurs par micro-région:\")\n",
|
||||
"for region, color in color_map.items():\n",
|
||||
" print(f\" {region}: {color}\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Coordonnées du centre de la Corse\n",
|
||||
"center_lat = df_clean['Latitude'].mean()\n",
|
||||
"center_lon = df_clean['Longitude'].mean()\n",
|
||||
"\n",
|
||||
"# Création de la carte\n",
|
||||
"m = folium.Map(\n",
|
||||
" location=[center_lat, center_lon],\n",
|
||||
" zoom_start=9,\n",
|
||||
" tiles='OpenStreetMap'\n",
|
||||
")\n",
|
||||
"\n",
|
||||
"# Ajout des marqueurs pour chaque commune\n",
|
||||
"for idx, row in df_clean.iterrows():\n",
|
||||
" folium.CircleMarker(\n",
|
||||
" location=[row['Latitude'], row['Longitude']],\n",
|
||||
" radius=3,\n",
|
||||
" popup=f\"<b>{row['Commune']}</b><br>{row['Territoire de projet']}\",\n",
|
||||
" tooltip=row['Commune'],\n",
|
||||
" color=color_map[row['Territoire de projet']],\n",
|
||||
" fill=True,\n",
|
||||
" fillColor=color_map[row['Territoire de projet']],\n",
|
||||
" fillOpacity=0.7\n",
|
||||
" ).add_to(m)\n",
|
||||
"\n",
|
||||
"# Ajout d'une légende\n",
|
||||
"legend_html = '''\n",
|
||||
"<div style=\"position: fixed; \n",
|
||||
" top: 10px; right: 10px; width: 250px; height: auto; \n",
|
||||
" background-color: white; border:2px solid grey; z-index:9999; \n",
|
||||
" font-size:12px; padding: 10px\">\n",
|
||||
"<p style=\"margin-bottom: 5px;\"><b>Micro-régions de Corse</b></p>\n",
|
||||
"'''\n",
|
||||
"\n",
|
||||
"for region, color in sorted(color_map.items()):\n",
|
||||
" legend_html += f'<p style=\"margin: 3px 0;\"><i class=\"fa fa-circle\" style=\"color:{color}\"></i> {region}</p>'\n",
|
||||
"\n",
|
||||
"legend_html += '</div>'\n",
|
||||
"\n",
|
||||
"m.get_root().html.add_child(folium.Element(legend_html))\n",
|
||||
"\n",
|
||||
"# Ajout du plugin de clic\n",
|
||||
"# Note: Folium ne supporte pas nativement l'interactivité côté Python en temps réel\n",
|
||||
"# Nous allons créer une version avec JavaScript pour la prédiction\n",
|
||||
"\n",
|
||||
"print(\"Carte de base créée avec les communes colorées par micro-région\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 5. Carte interactive avec prédiction au clic\n",
|
||||
"\n",
|
||||
"Cette version utilise JavaScript pour permettre de cliquer sur la carte et afficher la micro-région prédite."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Création d'une nouvelle carte avec interaction JavaScript\n",
|
||||
"m_interactive = folium.Map(\n",
|
||||
" location=[center_lat, center_lon],\n",
|
||||
" zoom_start=9,\n",
|
||||
" tiles='OpenStreetMap'\n",
|
||||
")\n",
|
||||
"\n",
|
||||
"# Ajout des communes\n",
|
||||
"for idx, row in df_clean.iterrows():\n",
|
||||
" folium.CircleMarker(\n",
|
||||
" location=[row['Latitude'], row['Longitude']],\n",
|
||||
" radius=3,\n",
|
||||
" popup=f\"<b>{row['Commune']}</b><br>{row['Territoire de projet']}\",\n",
|
||||
" tooltip=row['Commune'],\n",
|
||||
" color=color_map[row['Territoire de projet']],\n",
|
||||
" fill=True,\n",
|
||||
" fillColor=color_map[row['Territoire de projet']],\n",
|
||||
" fillOpacity=0.7\n",
|
||||
" ).add_to(m_interactive)\n",
|
||||
"\n",
|
||||
"# Préparer les données des communes pour JavaScript\n",
|
||||
"communes_data = df_clean[['Latitude', 'Longitude', 'Commune', 'Territoire de projet']].to_dict('records')\n",
|
||||
"\n",
|
||||
"# JavaScript pour la prédiction k-NN au clic\n",
|
||||
"click_js = f\"\"\"\n",
|
||||
"<script>\n",
|
||||
"// Données des communes\n",
|
||||
"var communesData = {json.dumps(communes_data)};\n",
|
||||
"\n",
|
||||
"// Carte des couleurs\n",
|
||||
"var colorMap = {json.dumps(color_map)};\n",
|
||||
"\n",
|
||||
"// Fonction pour calculer la distance haversine\n",
|
||||
"function haversineDistance(lat1, lon1, lat2, lon2) {{\n",
|
||||
" const R = 6371; // Rayon de la Terre en km\n",
|
||||
" const dLat = (lat2 - lat1) * Math.PI / 180;\n",
|
||||
" const dLon = (lon2 - lon1) * Math.PI / 180;\n",
|
||||
" const a = Math.sin(dLat/2) * Math.sin(dLat/2) +\n",
|
||||
" Math.cos(lat1 * Math.PI / 180) * Math.cos(lat2 * Math.PI / 180) *\n",
|
||||
" Math.sin(dLon/2) * Math.sin(dLon/2);\n",
|
||||
" const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));\n",
|
||||
" return R * c;\n",
|
||||
"}}\n",
|
||||
"\n",
|
||||
"// Fonction k-NN\n",
|
||||
"function predictRegion(lat, lon, k) {{\n",
|
||||
" // Calculer les distances\n",
|
||||
" var distances = communesData.map(function(commune) {{\n",
|
||||
" return {{\n",
|
||||
" distance: haversineDistance(lat, lon, commune.Latitude, commune.Longitude),\n",
|
||||
" region: commune['Territoire de projet'],\n",
|
||||
" commune: commune.Commune\n",
|
||||
" }};\n",
|
||||
" }});\n",
|
||||
" \n",
|
||||
" // Trier par distance\n",
|
||||
" distances.sort((a, b) => a.distance - b.distance);\n",
|
||||
" \n",
|
||||
" // Prendre les k plus proches\n",
|
||||
" var kNearest = distances.slice(0, k);\n",
|
||||
" \n",
|
||||
" // Vote pondéré par l'inverse de la distance\n",
|
||||
" var votes = {{}};\n",
|
||||
" kNearest.forEach(function(neighbor) {{\n",
|
||||
" var weight = 1 / (neighbor.distance + 0.001); // +0.001 pour éviter division par 0\n",
|
||||
" if (votes[neighbor.region]) {{\n",
|
||||
" votes[neighbor.region] += weight;\n",
|
||||
" }} else {{\n",
|
||||
" votes[neighbor.region] = weight;\n",
|
||||
" }}\n",
|
||||
" }});\n",
|
||||
" \n",
|
||||
" // Trouver la région gagnante\n",
|
||||
" var maxVote = 0;\n",
|
||||
" var predictedRegion = '';\n",
|
||||
" for (var region in votes) {{\n",
|
||||
" if (votes[region] > maxVote) {{\n",
|
||||
" maxVote = votes[region];\n",
|
||||
" predictedRegion = region;\n",
|
||||
" }}\n",
|
||||
" }}\n",
|
||||
" \n",
|
||||
" return {{\n",
|
||||
" region: predictedRegion,\n",
|
||||
" neighbors: kNearest\n",
|
||||
" }};\n",
|
||||
"}}\n",
|
||||
"\n",
|
||||
"// Variable pour stocker le marqueur de prédiction\n",
|
||||
"var predictionMarker = null;\n",
|
||||
"var neighborLines = [];\n",
|
||||
"\n",
|
||||
"// Attendre que la carte soit chargée\n",
|
||||
"setTimeout(function() {{\n",
|
||||
" var maps = document.querySelectorAll('.folium-map');\n",
|
||||
" if (maps.length > 0) {{\n",
|
||||
" var mapElement = maps[maps.length - 1];\n",
|
||||
" var leafletMap = mapElement._leaflet_map;\n",
|
||||
" \n",
|
||||
" if (leafletMap) {{\n",
|
||||
" leafletMap.on('click', function(e) {{\n",
|
||||
" var lat = e.latlng.lat;\n",
|
||||
" var lon = e.latlng.lng;\n",
|
||||
" \n",
|
||||
" // Prédiction avec k={k}\n",
|
||||
" var result = predictRegion(lat, lon, {k});\n",
|
||||
" \n",
|
||||
" // Supprimer l'ancien marqueur et lignes\n",
|
||||
" if (predictionMarker) {{\n",
|
||||
" leafletMap.removeLayer(predictionMarker);\n",
|
||||
" }}\n",
|
||||
" neighborLines.forEach(function(line) {{\n",
|
||||
" leafletMap.removeLayer(line);\n",
|
||||
" }});\n",
|
||||
" neighborLines = [];\n",
|
||||
" \n",
|
||||
" // Créer le popup avec informations détaillées\n",
|
||||
" var popupContent = '<div style=\"min-width: 200px;\">' +\n",
|
||||
" '<h4 style=\"margin: 5px 0;\">Prédiction k-NN</h4>' +\n",
|
||||
" '<p style=\"margin: 5px 0;\"><b>Micro-région:</b> ' + result.region + '</p>' +\n",
|
||||
" '<p style=\"margin: 5px 0;\"><b>Coordonnées:</b><br>' + \n",
|
||||
" 'Lat: ' + lat.toFixed(5) + '<br>Lon: ' + lon.toFixed(5) + '</p>' +\n",
|
||||
" '<p style=\"margin: 5px 0;\"><b>{k} plus proches communes:</b></p>' +\n",
|
||||
" '<ul style=\"margin: 5px 0; padding-left: 20px; font-size: 11px;\">';\n",
|
||||
" \n",
|
||||
" result.neighbors.forEach(function(neighbor) {{\n",
|
||||
" popupContent += '<li>' + neighbor.commune + \n",
|
||||
" ' (' + neighbor.distance.toFixed(2) + ' km)</li>';\n",
|
||||
" }});\n",
|
||||
" \n",
|
||||
" popupContent += '</ul></div>';\n",
|
||||
" \n",
|
||||
" // Ajouter le nouveau marqueur\n",
|
||||
" predictionMarker = L.marker([lat, lon], {{\n",
|
||||
" icon: L.divIcon({{\n",
|
||||
" className: 'prediction-marker',\n",
|
||||
" html: '<div style=\"background-color: ' + colorMap[result.region] + \n",
|
||||
" '; width: 20px; height: 20px; border-radius: 50%; ' +\n",
|
||||
" 'border: 3px solid white; box-shadow: 0 0 10px rgba(0,0,0,0.5);\"></div>',\n",
|
||||
" iconSize: [20, 20]\n",
|
||||
" }})\n",
|
||||
" }}).addTo(leafletMap);\n",
|
||||
" \n",
|
||||
" predictionMarker.bindPopup(popupContent).openPopup();\n",
|
||||
" \n",
|
||||
" // Ajouter des lignes vers les k plus proches voisins\n",
|
||||
" result.neighbors.forEach(function(neighbor) {{\n",
|
||||
" var commune = communesData.find(c => c.Commune === neighbor.commune);\n",
|
||||
" if (commune) {{\n",
|
||||
" var line = L.polyline(\n",
|
||||
" [[lat, lon], [commune.Latitude, commune.Longitude]],\n",
|
||||
" {{\n",
|
||||
" color: 'gray',\n",
|
||||
" weight: 1,\n",
|
||||
" opacity: 0.5,\n",
|
||||
" dashArray: '5, 5'\n",
|
||||
" }}\n",
|
||||
" ).addTo(leafletMap);\n",
|
||||
" neighborLines.push(line);\n",
|
||||
" }}\n",
|
||||
" }});\n",
|
||||
" }});\n",
|
||||
" \n",
|
||||
" console.log('Gestionnaire de clic k-NN activé');\n",
|
||||
" }}\n",
|
||||
" }}\n",
|
||||
"}}, 1000);\n",
|
||||
"</script>\n",
|
||||
"\"\"\"\n",
|
||||
"\n",
|
||||
"m_interactive.get_root().html.add_child(folium.Element(click_js))\n",
|
||||
"\n",
|
||||
"# Ajout de la légende\n",
|
||||
"m_interactive.get_root().html.add_child(folium.Element(legend_html))\n",
|
||||
"\n",
|
||||
"# Ajout d'instructions\n",
|
||||
"instructions_html = '''\n",
|
||||
"<div style=\"position: fixed; \n",
|
||||
" bottom: 10px; left: 10px; width: 300px; \n",
|
||||
" background-color: white; border:2px solid grey; z-index:9999; \n",
|
||||
" font-size:13px; padding: 10px\">\n",
|
||||
"<p style=\"margin: 0;\"><b>🖱️ Instructions:</b></p>\n",
|
||||
"<p style=\"margin: 5px 0;\">Cliquez n'importe où sur la carte pour prédire la micro-région à partir de l'algorithme k-NN.</p>\n",
|
||||
"<p style=\"margin: 5px 0;\">Les lignes pointillées montrent les k plus proches communes utilisées pour la prédiction.</p>\n",
|
||||
"</div>\n",
|
||||
"'''\n",
|
||||
"\n",
|
||||
"m_interactive.get_root().html.add_child(folium.Element(instructions_html))\n",
|
||||
"\n",
|
||||
"print(\"Carte interactive créée avec succès!\")\n",
|
||||
"print(f\"\\nCliquez sur n'importe quel point de la carte pour prédire sa micro-région avec k={k} voisins.\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Affichage de la carte interactive\n",
|
||||
"m_interactive"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 6. Sauvegarde de la carte"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Sauvegarder la carte interactive\n",
|
||||
"m_interactive.save('carte_corse_knn_interactive.html')\n",
|
||||
"print(\"Carte sauvegardée dans 'carte_corse_knn_interactive.html'\")\n",
|
||||
"print(\"Vous pouvez ouvrir ce fichier dans un navigateur pour une utilisation autonome.\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 7. Test de la prédiction (optionnel)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Fonction pour tester la prédiction sur des coordonnées spécifiques\n",
|
||||
"def predict_region(lat, lon, k_value=5):\n",
|
||||
" \"\"\"\n",
|
||||
" Prédit la micro-région pour des coordonnées données\n",
|
||||
" \"\"\"\n",
|
||||
" # Conversion en radians\n",
|
||||
" coords_rad = np.radians([[lat, lon]])\n",
|
||||
" \n",
|
||||
" # Prédiction\n",
|
||||
" prediction = knn.predict(coords_rad)[0]\n",
|
||||
" \n",
|
||||
" # Trouver les k plus proches voisins\n",
|
||||
" distances, indices = knn.kneighbors(coords_rad)\n",
|
||||
" \n",
|
||||
" # Convertir les distances de radians en km\n",
|
||||
" distances_km = distances[0] * 6371 # Rayon de la Terre en km\n",
|
||||
" \n",
|
||||
" print(f\"\\n📍 Coordonnées: {lat:.5f}, {lon:.5f}\")\n",
|
||||
" print(f\"🎯 Micro-région prédite: {prediction}\")\n",
|
||||
" print(f\"\\n{k_value} plus proches communes:\")\n",
|
||||
" \n",
|
||||
" for i, idx in enumerate(indices[0]):\n",
|
||||
" commune_info = df_clean.iloc[idx]\n",
|
||||
" print(f\" {i+1}. {commune_info['Commune']} ({commune_info['Territoire de projet']}) - {distances_km[i]:.2f} km\")\n",
|
||||
" \n",
|
||||
" return prediction\n",
|
||||
"\n",
|
||||
"# Exemples de test\n",
|
||||
"print(\"=\" * 60)\n",
|
||||
"print(\"TESTS DE PRÉDICTION\")\n",
|
||||
"print(\"=\" * 60)\n",
|
||||
"\n",
|
||||
"# Test 1: Centre approximatif de la Corse\n",
|
||||
"predict_region(42.15, 9.15, k)\n",
|
||||
"\n",
|
||||
"# Test 2: Nord de la Corse (Balagne)\n",
|
||||
"predict_region(42.55, 8.85, k)\n",
|
||||
"\n",
|
||||
"# Test 3: Sud de la Corse\n",
|
||||
"predict_region(41.65, 9.15, k)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 8. Analyse de performance (optionnel)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Évaluation de la cohérence du modèle (cross-validation)\n",
|
||||
"from sklearn.model_selection import cross_val_score\n",
|
||||
"\n",
|
||||
"# Test avec différentes valeurs de k\n",
|
||||
"k_values = [3, 5, 7, 9, 11]\n",
|
||||
"scores = []\n",
|
||||
"\n",
|
||||
"print(\"Évaluation de la précision pour différentes valeurs de k:\\n\")\n",
|
||||
"\n",
|
||||
"for k_val in k_values:\n",
|
||||
" knn_temp = KNeighborsClassifier(n_neighbors=k_val, weights='distance', metric='haversine')\n",
|
||||
" cv_scores = cross_val_score(knn_temp, X_rad, y, cv=5)\n",
|
||||
" mean_score = cv_scores.mean()\n",
|
||||
" scores.append(mean_score)\n",
|
||||
" print(f\"k={k_val:2d}: Précision moyenne = {mean_score:.3f} (+/- {cv_scores.std():.3f})\")\n",
|
||||
"\n",
|
||||
"# Visualisation simple\n",
|
||||
"print(f\"\\n✨ Meilleure valeur de k: {k_values[scores.index(max(scores))]} (précision: {max(scores):.3f})\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Conclusion\n",
|
||||
"\n",
|
||||
"Ce notebook implémente un classificateur k-NN pour les micro-régions de Corse avec:\n",
|
||||
"- ✅ Chargement et géocodage des communes corses\n",
|
||||
"- ✅ Entraînement d'un modèle k-NN avec distance haversine\n",
|
||||
"- ✅ Carte interactive Folium avec prédiction au clic\n",
|
||||
"- ✅ Visualisation des k plus proches voisins\n",
|
||||
"- ✅ Légende et instructions pour l'utilisateur\n",
|
||||
"\n",
|
||||
"**Utilisation:**\n",
|
||||
"1. Cliquez n'importe où sur la carte\n",
|
||||
"2. Un marqueur coloré apparaît avec la micro-région prédite\n",
|
||||
"3. Des lignes pointillées montrent les k communes les plus proches\n",
|
||||
"4. Un popup détaille la prédiction et les voisins\n",
|
||||
"\n",
|
||||
"La carte HTML peut être ouverte dans n'importe quel navigateur pour une utilisation autonome!"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.8.0"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 4
|
||||
}
|
||||
388
activite2/communes-de-corse-en-corse-et-francais.csv
Normal file
388
activite2/communes-de-corse-en-corse-et-francais.csv
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,361 @@
|
|||
Code Postal;Commune;Canton;Département;Territoire de projet;CODE_REG;INSEE_COM
|
||||
20224;ALBERTACCE;NIOLU-OMESSA;HAUTE-CORSE;CENTRE CORSE;94;2B007
|
||||
20212;ALZI;BUSTANICO;HAUTE-CORSE;CENTRE CORSE;94;2B013
|
||||
20225;AVAPESSA;BELGODERE;HAUTE-CORSE;PAYS DE BALAGNE;94;2B025
|
||||
20228;BARRETTALI;CAPOBIANCO;HAUTE-CORSE;PAYS BASTIAIS;94;2B030
|
||||
20119;BASTELICA;BASTELICA;CORSE-DU-SUD;PAYS AJACCIEN;94;2A031
|
||||
20200;BASTIA;BASTIA;HAUTE-CORSE;PAYS BASTIAIS;94;2B033
|
||||
20226;BELGODERE;BELGODERE;HAUTE-CORSE;PAYS DE BALAGNE;94;2B034
|
||||
20620;BIGUGLIA;BORGO;HAUTE-CORSE;PAYS BASTIAIS;94;2B037
|
||||
20229;CAMPANA;OREZZA-ALESANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;94;2B052
|
||||
20290;CAMPILE;ALTO-DI-CASACONI;HAUTE-CORSE;PAYS BASTIAIS;94;2B054
|
||||
20130;CARGESE;LES DEUX-SEVI;CORSE-DU-SUD;OUEST CORSE;94;2A065
|
||||
20244;CARTICASI;BUSTANICO;HAUTE-CORSE;CENTRE CORSE;94;2B068
|
||||
20250;CASANOVA;VENACO;HAUTE-CORSE;CENTRE CORSE;94;2B074
|
||||
20236;CASTIRLA;NIOLU-OMESSA;HAUTE-CORSE;CENTRE CORSE;94;2B083
|
||||
20221;CERVIONE;CAMPOLORO-DI-MORIANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;94;2B087
|
||||
20256;CORBARA;L'ILE-ROUSSE;HAUTE-CORSE;PAYS DE BALAGNE;94;2B093
|
||||
20167;CUTTOLI-CORTICCHIATO;CELAVO-MEZZANA;CORSE-DU-SUD;PAYS AJACCIEN;94;2A103
|
||||
20212;ERBAJOLO;BUSTANICO;HAUTE-CORSE;CENTRE CORSE;94;2B105
|
||||
20244;ERONE;BUSTANICO;HAUTE-CORSE;CENTRE CORSE;94;2B106
|
||||
20253;FARINOLE;LA CONCA-D'ORO;HAUTE-CORSE;PAYS BASTIAIS;94;2B109
|
||||
20245;GALERIA;CALENZANA;HAUTE-CORSE;PAYS DE BALAGNE;94;2B121
|
||||
20243;ISOLACCIO-DI-FIUMORBO;PRUNELLI-DI-FIUMORBO;HAUTE-CORSE;PLAINE ORIENTALE;;2B135
|
||||
20244;LAVATOGGIO;BELGODERE;HAUTE-CORSE;PAYS DE BALAGNE;;2B138
|
||||
20224;LOZZI;NIOLU-OMESSA;HAUTE-CORSE;CENTRE CORSE;;2B147
|
||||
20260;LUMIO;CALVI;HAUTE-CORSE;PAYS DE BALAGNE;;2B150
|
||||
20112;MELA;TALLANO-SCOPAMENE;CORSE-DU-SUD;EXTREME SUD / ALTA ROCCA;94;2A158
|
||||
20270;MOITA;MOITA-VERDE;HAUTE-CORSE;PLAINE ORIENTALE;;2B161
|
||||
20218;MOLTIFAO;CASTIFAO-MOROSAGLIA;HAUTE-CORSE;CENTRE CORSE;;2B162
|
||||
20239;MURATO;LE HAUT-NEBBIO;HAUTE-CORSE;PAYS BASTIAIS;;2B172
|
||||
20225;NESSA;BELGODERE;HAUTE-CORSE;PAYS DE BALAGNE;;2B175
|
||||
20219;NOCETA;VEZZANI;HAUTE-CORSE;CENTRE CORSE;;2B177
|
||||
20234;NOVALE;OREZZA-ALESANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B179
|
||||
20234;ORTALE;OREZZA-ALESANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B194
|
||||
20125;ORTO;LES DEUX-SORRU;CORSE-DU-SUD;OUEST CORSE;94;2A196
|
||||
20150;OTA;LES DEUX-SEVI;CORSE-DU-SUD;OUEST CORSE;94;2A198
|
||||
20167;PERI;CELAVO-MEZZANA;CORSE-DU-SUD;PAYS AJACCIEN;94;2A209
|
||||
20230;PIETRA-DI-VERDE;MOITA-VERDE;HAUTE-CORSE;PLAINE ORIENTALE;;2B225
|
||||
20234;PIETRICAGGIO;OREZZA-ALESANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B227
|
||||
20250;POGGIO-DI-VENACO;VENACO;HAUTE-CORSE;CENTRE CORSE;;2B238
|
||||
20237;POGGIO-MARINACCIO;FIUMALTO-D'AMPUGNANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B241
|
||||
20137;PORTO-VECCHIO;PORTO-VECCHIO;CORSE-DU-SUD;EXTREME SUD / ALTA ROCCA;94;2A247
|
||||
20218;PRATO-DI-GIOVELLINA;NIOLU-OMESSA;HAUTE-CORSE;CENTRE CORSE;;2B248
|
||||
20110;PROPRIANO;OLMETO;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A249
|
||||
20290;PRUNELLI-DI-CASACCONI;ALTO-DI-CASACONI;HAUTE-CORSE;PAYS BASTIAIS;;2B250
|
||||
20229;RAPAGGIO;OREZZA-ALESANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B256
|
||||
20217;SAINT-FLORENT;LA CONCA-D'ORO;HAUTE-CORSE;PAYS BASTIAIS;;2B298
|
||||
20121;SALICE;CRUZINI-CINARCA;CORSE-DU-SUD;OUEST CORSE;94;2A266
|
||||
20243;SAN-GAVINO-DI-FIUMORBO;PRUNELLI-DI-FIUMORBO;HAUTE-CORSE;PLAINE ORIENTALE;;2B365
|
||||
20230;SAN-GIOVANNI-DI-MORIANI;CAMPOLORO-DI-MORIANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B302
|
||||
20244;SAN-LORENZO;BUSTANICO;HAUTE-CORSE;CENTRE CORSE;;2B304
|
||||
20230;SANTA-LUCIA-DI-MORIANI;CAMPOLORO-DI-MORIANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B307
|
||||
20221;SANTA-MARIA-POGGIO;CAMPOLORO-DI-MORIANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B311
|
||||
20190;SANTA-MARIA-SICHE;SANTA-MARIA-SICHE;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A312
|
||||
20230;TALASANI;FIUMALTO-D'AMPUGNANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B319
|
||||
20250;TRALONCA;BUSTANICO;HAUTE-CORSE;CENTRE CORSE;;2B329
|
||||
20229;VALLE-D'OREZZA;OREZZA-ALESANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B338
|
||||
20240;VENTISERI;PRUNELLI-DI-FIUMORBO;HAUTE-CORSE;PLAINE ORIENTALE;;2B342
|
||||
20110;VIGGIANELLO;OLMETO;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A349
|
||||
20200;VILLE-DI-PIETRABUGNO;SAN-MARTINO-DI-LOTA;HAUTE-CORSE;PAYS BASTIAIS;;2B353
|
||||
20116;ZERUBIA;TALLANO-SCOPAMENE;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A357
|
||||
20173;ZEVACO;ZICAVO;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A358
|
||||
20124;ZONZA;LEVIE;CORSE-DU-SUD;EXTREME SUD / ALTA ROCCA;94;2A362
|
||||
20244;AITI;BUSTANICO;HAUTE-CORSE;CENTRE CORSE;94;2B003
|
||||
20212;ALANDO;BUSTANICO;HAUTE-CORSE;CENTRE CORSE;94;2B005
|
||||
20167;ALATA;AJACCIO 7E CANTON;CORSE-DU-SUD;PAYS AJACCIEN;94;2A006
|
||||
20251;ALTIANI;BUSTANICO;HAUTE-CORSE;CENTRE CORSE;94;2B012
|
||||
20270;ANTISANTI;VEZZANI;HAUTE-CORSE;PLAINE ORIENTALE;94;2B016
|
||||
20167;APPIETTO;AJACCIO 7E CANTON;CORSE-DU-SUD;PAYS AJACCIEN;94;2A017
|
||||
20140;ARGIUSTA-MORICCIO;PETRETO-BICCHISANO;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A021
|
||||
20151;ARRO;CRUZINI-CINARCA;CORSE-DU-SUD;OUEST CORSE;94;2A022
|
||||
20276;ASCO;CASTIFAO-MOROSAGLIA;HAUTE-CORSE;CENTRE CORSE;94;2B023
|
||||
20121;AZZANA;CRUZINI-CINARCA;CORSE-DU-SUD;OUEST CORSE;94;2A027
|
||||
20169;BONIFACIO;BONIFACIO;CORSE-DU-SUD;EXTREME SUD / ALTA ROCCA;94;2A041
|
||||
20290;BORGO;BORGO;HAUTE-CORSE;PAYS BASTIAIS;94;2B042
|
||||
20222;BRANDO;SAGRO-DI-SANTA-GIULIA;HAUTE-CORSE;PAYS BASTIAIS;94;2B043
|
||||
20212;BUSTANICO;BUSTANICO;HAUTE-CORSE;CENTRE CORSE;94;2B045
|
||||
20224;CALACUCCIA;NIOLU-OMESSA;HAUTE-CORSE;CENTRE CORSE;94;2B047
|
||||
20111;CALCATOGGIO;CRUZINI-CINARCA;CORSE-DU-SUD;OUEST CORSE;94;2A048
|
||||
20142;CAMPO;SANTA-MARIA-SICHE;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A056
|
||||
20230;CANALE-DI-VERDE;MOITA-VERDE;HAUTE-CORSE;PLAINE ORIENTALE;94;2B057
|
||||
20217;CANARI;SAGRO-DI-SANTA-GIULIA;HAUTE-CORSE;PAYS BASTIAIS;94;2B058
|
||||
20229;CARPINETO;OREZZA-ALESANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;94;2B067
|
||||
20111;CASAGLIONE;CRUZINI-CINARCA;CORSE-DU-SUD;OUEST CORSE;94;2A070
|
||||
20225;CATERI;BELGODERE;HAUTE-CORSE;PAYS DE BALAGNE;94;2B084
|
||||
20160;COGGIA;LES DEUX-SORRU;CORSE-DU-SUD;OUEST CORSE;94;2A090
|
||||
20123;COGNOCOLI-MONTICCHI;SANTA-MARIA-SICHE;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A091
|
||||
20138;COTI-CHIAVARI;SANTA-MARIA-SICHE;CORSE-DU-SUD;PAYS AJACCIEN;94;2A098
|
||||
20148;COZZANO;ZICAVO;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A099
|
||||
20237;CROCE;FIUMALTO-D'AMPUGNANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;94;2B101
|
||||
20117;ECCICA-SUARELLA;BASTELICA;CORSE-DU-SUD;PAYS AJACCIEN;94;2A104
|
||||
20143;FOZZANO;OLMETO;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A118
|
||||
20600;FURIANI;BASTIA (FURIANI-MONTESORO);HAUTE-CORSE;PAYS BASTIAIS;94;2B120
|
||||
20218;GAVIGNANO;CASTIFAO-MOROSAGLIA;HAUTE-CORSE;CENTRE CORSE;94;2B122
|
||||
20227;GHISONI;GHISONI;HAUTE-CORSE;PLAINE ORIENTALE;94;2B124
|
||||
20100;GRANACE;SARTENE;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A128
|
||||
20153;GUITERA-LES-BAINS;ZICAVO;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A133
|
||||
20220;LA PORTA;FIUMALTO-D'AMPUGNANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B246
|
||||
20237;LAMA;LE HAUT-NEBBIO;HAUTE-CORSE;PAYS DE BALAGNE;;2B136
|
||||
20252;LETIA;LES DEUX-SORRU;CORSE-DU-SUD;OUEST CORSE;94;2A141
|
||||
20165;LORETO-DI-TALLANO;TALLANO-SCOPAMENE;CORSE-DU-SUD;EXTREME SUD / ALTA ROCCA;94;2A146
|
||||
20290;LUCCIANA;BORGO;HAUTE-CORSE;PAYS BASTIAIS;;2B148
|
||||
20228;LURI;CAPOBIANCO;HAUTE-CORSE;PAYS BASTIAIS;;2B152
|
||||
20287;MERIA;CAPOBIANCO;HAUTE-CORSE;PAYS BASTIAIS;;2B159
|
||||
20140;MOCA-CROCE;PETRETO-BICCHISANO;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A160
|
||||
20218;MOROSAGLIA;CASTIFAO-MOROSAGLIA;HAUTE-CORSE;CENTRE CORSE;;2B169
|
||||
20225;MURO;BELGODERE;HAUTE-CORSE;PAYS DE BALAGNE;;2B173
|
||||
20117;OCANA;BASTELICA;CORSE-DU-SUD;PAYS AJACCIEN;94;2A181
|
||||
20217;OLCANI;SAGRO-DI-SANTA-GIULIA;HAUTE-CORSE;PAYS BASTIAIS;;2B184
|
||||
20140;OLIVESE;PETRETO-BICCHISANO;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A186
|
||||
20113;OLMETO;OLMETO;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A189
|
||||
20112;OLMICCIA;TALLANO-SCOPAMENE;CORSE-DU-SUD;EXTREME SUD / ALTA ROCCA;94;2A191
|
||||
20236;OMESSA;NIOLU-OMESSA;HAUTE-CORSE;CENTRE CORSE;;2B193
|
||||
20147;OSANI;LES DEUX-SEVI;CORSE-DU-SUD;OUEST CORSE;94;2A197
|
||||
20226;PALASCA;BELGODERE;HAUTE-CORSE;PAYS DE BALAGNE;;2B199
|
||||
20134;PALNECA;ZICAVO;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A200
|
||||
20251;PANCHERACCIA;BUSTANICO;HAUTE-CORSE;PLAINE ORIENTALE;;2B201
|
||||
20251;PIEDICORTE-DI-GAGGIO;BUSTANICO;HAUTE-CORSE;CENTRE CORSE;;2B218
|
||||
20229;PIEDICROCE;OREZZA-ALESANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B219
|
||||
20218;PIEDIGRIGGIO;NIOLU-OMESSA;HAUTE-CORSE;CENTRE CORSE;;2B220
|
||||
20251;PIETRASERENA;BUSTANICO;HAUTE-CORSE;CENTRE CORSE;;2B226
|
||||
20166;PIETROSELLA;SANTA-MARIA-SICHE;CORSE-DU-SUD;PAYS AJACCIEN;94;2A228
|
||||
20242;PIETROSO;VEZZANI;HAUTE-CORSE;PLAINE ORIENTALE;;2B229
|
||||
20220;PIGNA;L'ILE-ROUSSE;HAUTE-CORSE;PAYS DE BALAGNE;;2B231
|
||||
20234;PIOBETTA;OREZZA-ALESANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B234
|
||||
20125;POGGIOLO;LES DEUX-SORRU;CORSE-DU-SUD;OUEST CORSE;94;2A240
|
||||
20246;RAPALE;LE HAUT-NEBBIO;HAUTE-CORSE;PAYS BASTIAIS;;2B257
|
||||
20247;ROGLIANO;CAPOBIANCO;HAUTE-CORSE;PAYS BASTIAIS;;2B261
|
||||
20218;SALICETO;CASTIFAO-MOROSAGLIA;HAUTE-CORSE;CENTRE CORSE;;2B267
|
||||
20213;SAN-GAVINO-D'AMPUGNANI;FIUMALTO-D'AMPUGNANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B299
|
||||
20230;SAN-GIULIANO;CAMPOLORO-DI-MORIANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B303
|
||||
20200;SANTA-MARIA-DI-LOTA;SAN-MARTINO-DI-LOTA;HAUTE-CORSE;PAYS BASTIAIS;;2B309
|
||||
20212;SANT'ANDREA-DI-BOZIO;BUSTANICO;HAUTE-CORSE;CENTRE CORSE;;2B292
|
||||
20151;SANT'ANDREA-D'ORCINO;CRUZINI-CINARCA;CORSE-DU-SUD;OUEST CORSE;94;2A295
|
||||
20230;SANTA-REPARATA-DI-MORIANI;CAMPOLORO-DI-MORIANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B317
|
||||
20246;SANTO-PIETRO-DI-TENDA;LE HAUT-NEBBIO;HAUTE-CORSE;PAYS BASTIAIS;;2B314
|
||||
20145;SARI-SOLENZARA;PORTO-VECCHIO;CORSE-DU-SUD;PLAINE ORIENTALE;94;2A269
|
||||
20140;SERRA-DI-FERRO;SANTA-MARIA-SICHE;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A276
|
||||
20240;SOLARO;PRUNELLI-DI-FIUMORBO;HAUTE-CORSE;PLAINE ORIENTALE;;2B283
|
||||
20152;SORBOLLANO;TALLANO-SCOPAMENE;CORSE-DU-SUD;EXTREME SUD / ALTA ROCCA;94;2A285
|
||||
20146;SOTTA;FIGARI;CORSE-DU-SUD;EXTREME SUD / ALTA ROCCA;94;2A288
|
||||
20226;SPELONCATO;BELGODERE;HAUTE-CORSE;PAYS DE BALAGNE;;2B290
|
||||
20270;TOX;MOITA-VERDE;HAUTE-CORSE;PLAINE ORIENTALE;;2B328
|
||||
20234;VALLE-D'ALESANI;OREZZA-ALESANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B334
|
||||
20167;VALLE-DI-MEZZANA;CELAVO-MEZZANA;CORSE-DU-SUD;PAYS AJACCIEN;94;2A336
|
||||
20215;VENZOLASCA;VESCOVATO;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B343
|
||||
20172;VERO;CELAVO-MEZZANA;CORSE-DU-SUD;PAYS AJACCIEN;94;2A345
|
||||
20167;VILLANOVA;AJACCIO 7E CANTON;CORSE-DU-SUD;PAYS AJACCIEN;94;2A351
|
||||
20272;ZALANA;MOITA-VERDE;HAUTE-CORSE;PLAINE ORIENTALE;;2B356
|
||||
20132;ZICAVO;ZICAVO;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A359
|
||||
20214;ZILIA;CALENZANA;HAUTE-CORSE;PAYS DE BALAGNE;;2B361
|
||||
20167;AFA;AJACCIO 7E CANTON;CORSE-DU-SUD;PAYS AJACCIEN;94;2A001
|
||||
20270;ALERIA;MOITA-VERDE;HAUTE-CORSE;PLAINE ORIENTALE;94;2B009
|
||||
20220;ALGAJOLA;BELGODERE;HAUTE-CORSE;PAYS DE BALAGNE;94;2B010
|
||||
20160;ARBORI;LES DEUX-SORRU;CORSE-DU-SUD;OUEST CORSE;94;2A019
|
||||
20116;AULLENE;TALLANO-SCOPAMENE;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A024
|
||||
20190;AZILONE-AMPAZA;SANTA-MARIA-SICHE;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A026
|
||||
20160;BALOGNA;LES DEUX-SORRU;CORSE-DU-SUD;OUEST CORSE;94;2A028
|
||||
20252;BIGORNO;ALTO-DI-CASACONI;HAUTE-CORSE;PAYS BASTIAIS;94;2B036
|
||||
20270;CAMPI;MOITA-VERDE;HAUTE-CORSE;PLAINE ORIENTALE;94;2B053
|
||||
20252;CAMPITELLO;ALTO-DI-CASACONI;HAUTE-CORSE;PAYS BASTIAIS;94;2B055
|
||||
20170;CARBINI;LEVIE;CORSE-DU-SUD;EXTREME SUD / ALTA ROCCA;94;2A061
|
||||
20133;CARBUCCIA;CELAVO-MEZZANA;CORSE-DU-SUD;PAYS AJACCIEN;94;2A062
|
||||
20164;CARGIACA;TALLANO-SCOPAMENE;CORSE-DU-SUD;EXTREME SUD / ALTA ROCCA;94;2A066
|
||||
20237;CASABIANCA;FIUMALTO-D'AMPUGNANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;94;2B069
|
||||
20140;CASALABRIVA;PETRETO-BICCHISANO;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A071
|
||||
20270;CASEVECCHIE;VEZZANI;HAUTE-CORSE;PLAINE ORIENTALE;94;2B075
|
||||
20218;CASTIFAO;CASTIFAO-MOROSAGLIA;HAUTE-CORSE;CENTRE CORSE;94;2B080
|
||||
20238;CENTURI;CAPOBIANCO;HAUTE-CORSE;PAYS BASTIAIS;94;2B086
|
||||
20240;CHISA;PRUNELLI-DI-FIUMORBO;HAUTE-CORSE;PLAINE ORIENTALE;94;2B366
|
||||
20134;CIAMANNACCE;ZICAVO;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A089
|
||||
20226;COSTA;BELGODERE;HAUTE-CORSE;PAYS DE BALAGNE;94;2B097
|
||||
20126;CRISTINACCE;LES DEUX-SEVI;CORSE-DU-SUD;OUEST CORSE;94;2A100
|
||||
20275;ERSA;CAPOBIANCO;HAUTE-CORSE;PAYS BASTIAIS;94;2B107
|
||||
20126;EVISA;LES DEUX-SEVI;CORSE-DU-SUD;OUEST CORSE;94;2A108
|
||||
20212;FAVALELLO;BUSTANICO;HAUTE-CORSE;CENTRE CORSE;94;2B110
|
||||
20225;FELICETO;BELGODERE;HAUTE-CORSE;PAYS DE BALAGNE;94;2B112
|
||||
20100;FOCE;SARTENE;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A115
|
||||
20190;FORCIOLO;SANTA-MARIA-SICHE;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A117
|
||||
20240;GHISONACCIA;GHISONI;HAUTE-CORSE;PLAINE ORIENTALE;94;2B123
|
||||
20160;GUAGNO;LES DEUX-SORRU;CORSE-DU-SUD;OUEST CORSE;94;2A131
|
||||
20137;LENTO;ALTO-DI-CASACONI;HAUTE-CORSE;CENTRE CORSE;;2B140
|
||||
20170;L'ILE-ROUSSE;L'ILE-ROUSSE;HAUTE-CORSE;PAYS DE BALAGNE;;2B134
|
||||
20215;LORETO-DI-CASINCA;VESCOVATO;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B145
|
||||
20245;MANSO;CALENZANA;HAUTE-CORSE;PAYS DE BALAGNE;;2B153
|
||||
20141;MARIGNANA;LES DEUX-SEVI;CORSE-DU-SUD;OUEST CORSE;94;2A154
|
||||
20270;MATRA;MOITA-VERDE;HAUTE-CORSE;PLAINE ORIENTALE;;2B155
|
||||
20259;MAUSOLEO;BELGODERE;HAUTE-CORSE;PAYS DE BALAGNE;;2B156
|
||||
20171;MONACIA-D'AULLENE;FIGARI;CORSE-DU-SUD;EXTREME SUD / ALTA ROCCA;94;2A163
|
||||
20229;MONACIA-D'OREZZA;OREZZA-ALESANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B164
|
||||
20229;NOCARIO;OREZZA-ALESANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B176
|
||||
20226;OCCHIATANA;BELGODERE;HAUTE-CORSE;PAYS DE BALAGNE;;2B182
|
||||
20217;OGLIASTRO;SAGRO-DI-SANTA-GIULIA;HAUTE-CORSE;PAYS BASTIAIS;;2B183
|
||||
20290;ORTIPORIO;ALTO-DI-CASACONI;HAUTE-CORSE;PAYS BASTIAIS;;2B195
|
||||
20229;PARATA;OREZZA-ALESANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B202
|
||||
20121;PASTRICCIOLA;CRUZINI-CINARCA;CORSE-DU-SUD;OUEST CORSE;94;2A204
|
||||
20272;PIANELLO;MOITA-VERDE;HAUTE-CORSE;PLAINE ORIENTALE;;2B213
|
||||
20215;PIANO;FIUMALTO-D'AMPUGNANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B214
|
||||
20229;PIE-D'OREZZA;OREZZA-ALESANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B222
|
||||
20246;PIEVE;LE HAUT-NEBBIO;HAUTE-CORSE;PAYS BASTIAIS;;2B230
|
||||
20123;PILA-CANALE;SANTA-MARIA-SICHE;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A232
|
||||
20229;POLVEROSO;FIUMALTO-D'AMPUGNANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B243
|
||||
20218;POPOLASCA;NIOLU-OMESSA;HAUTE-CORSE;CENTRE CORSE;;2B244
|
||||
20215;PORRI;VESCOVATO;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B245
|
||||
20243;PRUNELLI-DI-FIUMORBO;PRUNELLI-DI-FIUMORBO;HAUTE-CORSE;PLAINE ORIENTALE;;2B251
|
||||
20122;QUENZA;TALLANO-SCOPAMENE;CORSE-DU-SUD;EXTREME SUD / ALTA ROCCA;94;2A254
|
||||
20237;QUERCITELLO;FIUMALTO-D'AMPUGNANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B255
|
||||
20121;REZZA;CRUZINI-CINARCA;CORSE-DU-SUD;OUEST CORSE;94;2A259
|
||||
20244;RUSIO;BUSTANICO;HAUTE-CORSE;CENTRE CORSE;;2B264
|
||||
20239;RUTALI;LE HAUT-NEBBIO;HAUTE-CORSE;PAYS BASTIAIS;;2B265
|
||||
20213;SAN-DAMIANO;FIUMALTO-D'AMPUGNANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B297
|
||||
20170;SAN-GAVINO-DI-CARBINI;LEVIE;CORSE-DU-SUD;EXTREME SUD / ALTA ROCCA;94;2A300
|
||||
20230;SAN-NICOLAO;CAMPOLORO-DI-MORIANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B313
|
||||
20250;SANTA-LUCIA-DI-MERCURIO;BUSTANICO;HAUTE-CORSE;CENTRE CORSE;;2B306
|
||||
20167;SARROLA-CARCOPINO;CELAVO-MEZZANA;CORSE-DU-SUD;PAYS AJACCIEN;94;2A271
|
||||
20243;SERRA-DI-FIUMORBO;PRUNELLI-DI-FIUMORBO;HAUTE-CORSE;PLAINE ORIENTALE;;2B277
|
||||
20147;SERRIERA;LES DEUX-SEVI;CORSE-DU-SUD;OUEST CORSE;94;2A279
|
||||
20125;SOCCIA;LES DEUX-SORRU;CORSE-DU-SUD;OUEST CORSE;94;2A282
|
||||
20229;STAZZONA;OREZZA-ALESANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B291
|
||||
20270;TALLONE;MOITA-VERDE;HAUTE-CORSE;PLAINE ORIENTALE;;2B320
|
||||
20234;TARRANO;OREZZA-ALESANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B321
|
||||
20134;TASSO;ZICAVO;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A322
|
||||
20259;VALLICA;BELGODERE;HAUTE-CORSE;PAYS DE BALAGNE;;2B339
|
||||
20231;VENACO;VENACO;HAUTE-CORSE;CENTRE CORSE;;2B341
|
||||
20229;VERDESE;OREZZA-ALESANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B344
|
||||
20290;VOLPAJOLA;ALTO-DI-CASACONI;HAUTE-CORSE;PAYS BASTIAIS;;2B355
|
||||
20190;ZIGLIARA;SANTA-MARIA-SICHE;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A360
|
||||
20112;ZOZA;TALLANO-SCOPAMENE;CORSE-DU-SUD;EXTREME SUD / ALTA ROCCA;94;2A363
|
||||
20270;AGHIONE;VEZZANI;HAUTE-CORSE;PLAINE ORIENTALE;94;2B002
|
||||
20112;ALTAGENE;TALLANO-SCOPAMENE;CORSE-DU-SUD;EXTREME SUD / ALTA ROCCA;94;2A011
|
||||
20272;AMPRIANI;MOITA-VERDE;HAUTE-CORSE;PLAINE ORIENTALE;94;2B015
|
||||
20110;ARBELLARA;OLMETO;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A018
|
||||
20129;BASTELICACCIA;AJACCIO 7E CANTON;CORSE-DU-SUD;PAYS AJACCIEN;94;2A032
|
||||
20110;BELVEDERE-CAMPOMORO;SARTENE;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A035
|
||||
20100;BILIA;SARTENE;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A038
|
||||
20228;CAGNANO;CAPOBIANCO;HAUTE-CORSE;PAYS BASTIAIS;94;2B046
|
||||
20235;CASTELLO-DI-ROSTINO;CASTIFAO-MOROSAGLIA;HAUTE-CORSE;CENTRE CORSE;94;2B079
|
||||
20218;CASTIGLIONE;NIOLU-OMESSA;HAUTE-CORSE;CENTRE CORSE;94;2B081
|
||||
20117;CAURO;BASTELICA;CORSE-DU-SUD;PAYS AJACCIEN;94;2A085
|
||||
20230;CHIATRA;MOITA-VERDE;HAUTE-CORSE;PLAINE ORIENTALE;94;2B088
|
||||
20168;CORRANO;ZICAVO;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A094
|
||||
20250;CORTE;CORTE;HAUTE-CORSE;CENTRE CORSE;94;2B096
|
||||
20290;CROCICCHIA;ALTO-DI-CASACONI;HAUTE-CORSE;PAYS BASTIAIS;94;2B102
|
||||
20234;FELCE;OREZZA-ALESANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;94;2B111
|
||||
20114;FIGARI;FIGARI;CORSE-DU-SUD;EXTREME SUD / ALTA ROCCA;94;2A114
|
||||
20212;FOCICCHIA;BUSTANICO;HAUTE-CORSE;CENTRE CORSE;94;2B116
|
||||
20230;LINGUIZZETTA;MOITA-VERDE;HAUTE-CORSE;PLAINE ORIENTALE;;2B143
|
||||
20139;LOPIGNA;CRUZINI-CINARCA;CORSE-DU-SUD;OUEST CORSE;94;2A144
|
||||
20212;MAZZOLA;BUSTANICO;HAUTE-CORSE;CENTRE CORSE;;2B157
|
||||
20214;MONCALE;CALENZANA;HAUTE-CORSE;PAYS DE BALAGNE;;2B165
|
||||
20290;MONTE;ALTO-DI-CASACONI;HAUTE-CORSE;PAYS BASTIAIS;;2B166
|
||||
20214;MONTEGROSSO;CALENZANA;HAUTE-CORSE;PAYS DE BALAGNE;;2B167
|
||||
20238;MORSIGLIA;CAPOBIANCO;HAUTE-CORSE;PAYS BASTIAIS;;2B170
|
||||
20219;MURACCIOLE;VENACO;HAUTE-CORSE;CENTRE CORSE;;2B171
|
||||
20217;NONZA;SAGRO-DI-SANTA-GIULIA;HAUTE-CORSE;PAYS BASTIAIS;;2B178
|
||||
20226;NOVELLA;BELGODERE;HAUTE-CORSE;PAYS DE BALAGNE;;2B180
|
||||
20232;OLETTA;LA CONCA-D'ORO;HAUTE-CORSE;PAYS BASTIAIS;;2B185
|
||||
20232;OLMETA-DI-TUDA;LA CONCA-D'ORO;HAUTE-CORSE;PAYS BASTIAIS;;2B188
|
||||
20259;OLMI-CAPPELLA;BELGODERE;HAUTE-CORSE;PAYS DE BALAGNE;;2B190
|
||||
20290;OLMO;ALTO-DI-CASACONI;HAUTE-CORSE;PAYS BASTIAIS;;2B192
|
||||
20147;PARTINELLO;LES DEUX-SEVI;CORSE-DU-SUD;OUEST CORSE;94;2A203
|
||||
20290;PENTA-ACQUATELLA;ALTO-DI-CASACONI;HAUTE-CORSE;PAYS BASTIAIS;;2B206
|
||||
20230;PERO-CASEVECCHIE;FIUMALTO-D'AMPUGNANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B210
|
||||
20140;PETRETO-BICCHISANO;PETRETO-BICCHISANO;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A211
|
||||
20131;PIANOTTOLI-CALDARELLO;FIGARI;CORSE-DU-SUD;EXTREME SUD / ALTA ROCCA;94;2A215
|
||||
20234;PIAZZALI;OREZZA-ALESANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B216
|
||||
20229;PIEDIPARTINO;OREZZA-ALESANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B221
|
||||
20218;PIETRALBA;LE HAUT-NEBBIO;HAUTE-CORSE;PAYS DE BALAGNE;;2B223
|
||||
20240;POGGIO-DI-NAZZA;GHISONI;HAUTE-CORSE;PLAINE ORIENTALE;;2B236
|
||||
20213;PRUNO;FIUMALTO-D'AMPUGNANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B252
|
||||
20142;QUASQUARA;SANTA-MARIA-SICHE;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A253
|
||||
20160;RENNO;LES DEUX-SORRU;CORSE-DU-SUD;OUEST CORSE;94;2A258
|
||||
20121;ROSAZIA;CRUZINI-CINARCA;CORSE-DU-SUD;OUEST CORSE;94;2A262
|
||||
20112;SAINTE-LUCIE-DE-TALLANO;TALLANO-SCOPAMENE;CORSE-DU-SUD;EXTREME SUD / ALTA ROCCA;94;2A308
|
||||
20134;SAMPOLO;ZICAVO;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A268
|
||||
20246;SAN-GAVINO-DI-TENDA;LE HAUT-NEBBIO;HAUTE-CORSE;PAYS BASTIAIS;;2B301
|
||||
20143;SANTA-MARIA-FIGANIELLA;OLMETO;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A310
|
||||
20221;SANT'ANDREA-DI-COTONE;CAMPOLORO-DI-MORIANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B293
|
||||
20220;SANT'ANTONINO;L'ILE-ROUSSE;HAUTE-CORSE;PAYS DE BALAGNE;;2B296
|
||||
20220;SANTA-REPARATA-DI-BALAGNA;L'ILE-ROUSSE;HAUTE-CORSE;PAYS DE BALAGNE;;2B316
|
||||
20250;SANTO-PIETRO-DI-VENACO;VENACO;HAUTE-CORSE;CENTRE CORSE;;2B315
|
||||
20100;SARTENE;SARTENE;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A272
|
||||
20290;SCOLCA;ALTO-DI-CASACONI;HAUTE-CORSE;PAYS BASTIAIS;;2B274
|
||||
20215;SILVARECCIO;FIUMALTO-D'AMPUGNANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B280
|
||||
20140;SOLLACARO;PETRETO-BICCHISANO;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A284
|
||||
20117;TOLLA;BASTELICA;CORSE-DU-SUD;PAYS AJACCIEN;94;2A326
|
||||
20248;TOMINO;CAPOBIANCO;HAUTE-CORSE;PAYS BASTIAIS;;2B327
|
||||
20232;VALLECALLE;LA CONCA-D'ORO;HAUTE-CORSE;PAYS BASTIAIS;;2B333
|
||||
20221;VALLE-DI-CAMPOLORO;CAMPOLORO-DI-MORIANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B335
|
||||
20230;VELONE-ORNETO;FIUMALTO-D'AMPUGNANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B340
|
||||
20215;VESCOVATO;VESCOVATO;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B346
|
||||
20242;VEZZANI;VEZZANI;HAUTE-CORSE;PLAINE ORIENTALE;;2B347
|
||||
20160;VICO;LES DEUX-SORRU;CORSE-DU-SUD;OUEST CORSE;94;2A348
|
||||
20290;VIGNALE;BORGO;HAUTE-CORSE;PAYS BASTIAIS;;2B350
|
||||
20279;VILLE-DI-PARASO;BELGODERE;HAUTE-CORSE;PAYS DE BALAGNE;;2B352
|
||||
20272;ZUANI;MOITA-VERDE;HAUTE-CORSE;PLAINE ORIENTALE;;2B364
|
||||
20000;AJACCIO;AJACCIO;CORSE-DU-SUD;PAYS AJACCIEN;94;2A004
|
||||
20128;ALBITRECCIA;SANTA-MARIA-SICHE;CORSE-DU-SUD;PAYS AJACCIEN;94;2A008
|
||||
20151;AMBIEGNA;CRUZINI-CINARCA;CORSE-DU-SUD;OUEST CORSE;94;2A014
|
||||
20220;AREGNO;BELGODERE;HAUTE-CORSE;PAYS DE BALAGNE;94;2B020
|
||||
20253;BARBAGGIO;LA CONCA-D'ORO;HAUTE-CORSE;PAYS BASTIAIS;94;2B029
|
||||
20235;BISINCHI;CASTIFAO-MOROSAGLIA;HAUTE-CORSE;CENTRE CORSE;94;2B039
|
||||
20136;BOCOGNANO;CELAVO-MEZZANA;CORSE-DU-SUD;PAYS AJACCIEN;94;2A040
|
||||
20214;CALENZANA;CALENZANA;HAUTE-CORSE;PAYS DE BALAGNE;94;2B049
|
||||
20260;CALVI;CALVI;HAUTE-CORSE;PAYS DE BALAGNE;94;2B050
|
||||
20244;CAMBIA;BUSTANICO;HAUTE-CORSE;CENTRE CORSE;94;2B051
|
||||
20235;CANAVAGGIA;ALTO-DI-CASACONI;HAUTE-CORSE;CENTRE CORSE;94;2B059
|
||||
20151;CANNELLE;CRUZINI-CINARCA;CORSE-DU-SUD;OUEST CORSE;94;2A060
|
||||
20229;CARCHETO-BRUSTICO;OREZZA-ALESANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;94;2B063
|
||||
20190;CARDO-TORGIA;SANTA-MARIA-SICHE;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A064
|
||||
20215;CASALTA;FIUMALTO-D'AMPUGNANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;94;2B072
|
||||
20224;CASAMACCIOLI;NIOLU-OMESSA;HAUTE-CORSE;CENTRE CORSE;94;2B073
|
||||
20213;CASTELLARE-DI-CASINCA;VESCOVATO;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;94;2B077
|
||||
20212;CASTELLARE-DI-MERCURIO;BUSTANICO;HAUTE-CORSE;CENTRE CORSE;94;2B078
|
||||
20218;CASTINETA;CASTIFAO-MOROSAGLIA;HAUTE-CORSE;CENTRE CORSE;94;2B082
|
||||
20135;CONCA;PORTO-VECCHIO;CORSE-DU-SUD;PLAINE ORIENTALE;94;2A092
|
||||
20224;CORSCIA;NIOLU-OMESSA;HAUTE-CORSE;CENTRE CORSE;94;2B095
|
||||
20237;FICAJA;FIUMALTO-D'AMPUGNANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;94;2B113
|
||||
20157;FRASSETO;SANTA-MARIA-SICHE;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A119
|
||||
20237;GIOCATOJO;FIUMALTO-D'AMPUGNANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;94;2B125
|
||||
20251;GIUNCAGGIO;BUSTANICO;HAUTE-CORSE;PLAINE ORIENTALE;;2B126
|
||||
20100;GIUNCHETO;SARTENE;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A127
|
||||
20100;GROSSA;SARTENE;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A129
|
||||
20128;GROSSETO-PRUGNA;SANTA-MARIA-SICHE;CORSE-DU-SUD;PAYS AJACCIEN;94;2A130
|
||||
20128;GUARGUALE;SANTA-MARIA-SICHE;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A132
|
||||
20218;LANO;BUSTANICO;HAUTE-CORSE;CENTRE CORSE;;2B137
|
||||
20225;LECCI;PORTO-VECCHIO;CORSE-DU-SUD;EXTREME SUD / ALTA ROCCA;94;2A139
|
||||
20160;LEVIE;LEVIE;CORSE-DU-SUD;EXTREME SUD / ALTA ROCCA;94;2A142
|
||||
20240;LUGO-DI-NAZZA;GHISONI;HAUTE-CORSE;PLAINE ORIENTALE;;2B149
|
||||
20220;MONTICELLO;L'ILE-ROUSSE;HAUTE-CORSE;PAYS DE BALAGNE;;2B168
|
||||
20160;MURZO;LES DEUX-SORRU;CORSE-DU-SUD;OUEST CORSE;94;2A174
|
||||
20217;OLMETA-DI-CAPOCORSO;SAGRO-DI-SANTA-GIULIA;HAUTE-CORSE;PAYS BASTIAIS;;2B187
|
||||
20253;PATRIMONIO;LA CONCA-D'ORO;HAUTE-CORSE;PAYS BASTIAIS;;2B205
|
||||
20213;PENTA-DI-CASINCA;VESCOVATO;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B207
|
||||
20234;PERELLI;OREZZA-ALESANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B208
|
||||
20115;PIANA;LES DEUX-SEVI;CORSE-DU-SUD;OUEST CORSE;94;2A212
|
||||
20229;PIAZZOLE;OREZZA-ALESANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B217
|
||||
20233;PIETRACORBARA;SAGRO-DI-SANTA-GIULIA;HAUTE-CORSE;PAYS BASTIAIS;;2B224
|
||||
20228;PINO;CAPOBIANCO;HAUTE-CORSE;PAYS BASTIAIS;;2B233
|
||||
20259;PIOGGIOLA;BELGODERE;HAUTE-CORSE;PAYS DE BALAGNE;;2B235
|
||||
20232;POGGIO-D'OLETTA;LA CONCA-D'ORO;HAUTE-CORSE;PAYS BASTIAIS;;2B239
|
||||
20230;POGGIO-MEZZANA;FIUMALTO-D'AMPUGNANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B242
|
||||
20250;RIVENTOSA;VENACO;HAUTE-CORSE;CENTRE CORSE;;2B260
|
||||
20219;ROSPIGLIANI;VEZZANI;HAUTE-CORSE;CENTRE CORSE;;2B263
|
||||
20200;SAN-MARTINO-DI-LOTA;SAN-MARTINO-DI-LOTA;HAUTE-CORSE;PAYS BASTIAIS;;2B305
|
||||
20151;SARI-D'ORCINO;CRUZINI-CINARCA;CORSE-DU-SUD;OUEST CORSE;94;2A270
|
||||
20213;SCATA;FIUMALTO-D'AMPUGNANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B273
|
||||
20212;SERMANO;BUSTANICO;HAUTE-CORSE;CENTRE CORSE;;2B275
|
||||
20127;SERRA-DI-SCOPAMENE;TALLANO-SCOPAMENE;CORSE-DU-SUD;EXTREME SUD / ALTA ROCCA;94;2A278
|
||||
20233;SISCO;SAGRO-DI-SANTA-GIULIA;HAUTE-CORSE;PAYS BASTIAIS;;2B281
|
||||
20213;SORBO-OCAGNANO;VESCOVATO;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B286
|
||||
20246;SORIO;LE HAUT-NEBBIO;HAUTE-CORSE;PAYS BASTIAIS;;2B287
|
||||
20250;SOVERIA;NIOLU-OMESSA;HAUTE-CORSE;CENTRE CORSE;;2B289
|
||||
20230;TAGLIO-ISOLACCIO;FIUMALTO-D'AMPUGNANI;HAUTE-CORSE;CASTAGNICCIA / MARE E MONTI;;2B318
|
||||
20167;TAVACO;CELAVO-MEZZANA;CORSE-DU-SUD;PAYS AJACCIEN;94;2A323
|
||||
20163;TAVERA;CELAVO-MEZZANA;CORSE-DU-SUD;PAYS AJACCIEN;94;2A324
|
||||
20133;UCCIANI;CELAVO-MEZZANA;CORSE-DU-SUD;PAYS AJACCIEN;94;2A330
|
||||
20128;URBALACONE;SANTA-MARIA-SICHE;CORSE-DU-SUD;TARAVO / VALINCO / SARTENAIS;94;2A331
|
||||
20218;URTACA;LE HAUT-NEBBIO;HAUTE-CORSE;PAYS DE BALAGNE;;2B332
|
||||
20235;VALLE-DI-ROSTINO;CASTIFAO-MOROSAGLIA;HAUTE-CORSE;CENTRE CORSE;;2B337
|
||||
20219;VIVARIO;VENACO;HAUTE-CORSE;CENTRE CORSE;;2B354
|
||||
|
9
activite2/knn_microregions_activite.aux
Normal file
9
activite2/knn_microregions_activite.aux
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
\relax
|
||||
\providecommand \babel@aux [2]{\global \let \babel@toc \@gobbletwo }
|
||||
\@nameuse{bbl@beforestart}
|
||||
\catcode `:\active
|
||||
\catcode `;\active
|
||||
\catcode `!\active
|
||||
\catcode `?\active
|
||||
\babel@aux{french}{}
|
||||
\gdef \@abspage@last{6}
|
||||
752
activite2/knn_microregions_activite.log
Normal file
752
activite2/knn_microregions_activite.log
Normal file
|
|
@ -0,0 +1,752 @@
|
|||
This is pdfTeX, Version 3.141592653-2.6-1.40.27 (TeX Live 2026/dev/Arch Linux) (preloaded format=pdflatex 2025.8.2) 23 OCT 2025 13:49
|
||||
entering extended mode
|
||||
restricted \write18 enabled.
|
||||
%&-line parsing enabled.
|
||||
**knn_microregions_activite.tex
|
||||
(./knn_microregions_activite.tex
|
||||
LaTeX2e <2024-11-01> patch level 2
|
||||
L3 programming layer <2025-01-18>
|
||||
(/usr/share/texmf-dist/tex/latex/base/article.cls
|
||||
Document Class: article 2024/06/29 v1.4n Standard LaTeX document class
|
||||
(/usr/share/texmf-dist/tex/latex/base/size11.clo
|
||||
File: size11.clo 2024/06/29 v1.4n Standard LaTeX file (size option)
|
||||
)
|
||||
\c@part=\count196
|
||||
\c@section=\count197
|
||||
\c@subsection=\count198
|
||||
\c@subsubsection=\count199
|
||||
\c@paragraph=\count266
|
||||
\c@subparagraph=\count267
|
||||
\c@figure=\count268
|
||||
\c@table=\count269
|
||||
\abovecaptionskip=\skip49
|
||||
\belowcaptionskip=\skip50
|
||||
\bibindent=\dimen141
|
||||
)
|
||||
(/usr/share/texmf-dist/tex/latex/base/inputenc.sty
|
||||
Package: inputenc 2024/02/08 v1.3d Input encoding file
|
||||
\inpenc@prehook=\toks17
|
||||
\inpenc@posthook=\toks18
|
||||
)
|
||||
(/usr/share/texmf-dist/tex/latex/base/fontenc.sty
|
||||
Package: fontenc 2021/04/29 v2.0v Standard LaTeX package
|
||||
)
|
||||
(/usr/share/texmf-dist/tex/generic/babel/babel.sty
|
||||
Package: babel 2025/02/14 v25.4 The multilingual framework for pdfLaTeX, LuaLaT
|
||||
eX and XeLaTeX
|
||||
\babel@savecnt=\count270
|
||||
\U@D=\dimen142
|
||||
\l@unhyphenated=\language5
|
||||
|
||||
(/usr/share/texmf-dist/tex/generic/babel/txtbabel.def)
|
||||
\bbl@readstream=\read2
|
||||
\bbl@dirlevel=\count271
|
||||
|
||||
(/usr/share/texmf-dist/tex/generic/babel-french/francais.ldf
|
||||
Language: francais 2024-07-25 v3.6c French support from the babel system
|
||||
|
||||
|
||||
Package francais.ldf Warning: Option `francais' for Babel is *deprecated*,
|
||||
(francais.ldf) it might be removed sooner or later. Please
|
||||
(francais.ldf) use `french' instead; reported on input line 31.
|
||||
|
||||
(/usr/share/texmf-dist/tex/generic/babel-french/french.ldf
|
||||
Language: french 2024-07-25 v3.6c French support from the babel system
|
||||
Package babel Info: Hyphen rules for 'acadian' set to \l@french
|
||||
(babel) (\language4). Reported on input line 91.
|
||||
Package babel Info: Hyphen rules for 'canadien' set to \l@french
|
||||
(babel) (\language4). Reported on input line 92.
|
||||
\FB@stdchar=\count272
|
||||
Package babel Info: Making : an active character on input line 421.
|
||||
Package babel Info: Making ; an active character on input line 422.
|
||||
Package babel Info: Making ! an active character on input line 423.
|
||||
Package babel Info: Making ? an active character on input line 424.
|
||||
\FBguill@level=\count273
|
||||
\FBold@everypar=\toks19
|
||||
\FB@Mht=\dimen143
|
||||
\mc@charclass=\count274
|
||||
\mc@charfam=\count275
|
||||
\mc@charslot=\count276
|
||||
\std@mcc=\count277
|
||||
\dec@mcc=\count278
|
||||
\FB@parskip=\dimen144
|
||||
\listindentFB=\dimen145
|
||||
\descindentFB=\dimen146
|
||||
\labelindentFB=\dimen147
|
||||
\labelwidthFB=\dimen148
|
||||
\leftmarginFB=\dimen149
|
||||
\parindentFFN=\dimen150
|
||||
\FBfnindent=\dimen151
|
||||
)))
|
||||
(/usr/share/texmf-dist/tex/latex/carlisle/scalefnt.sty)
|
||||
(/usr/share/texmf-dist/tex/latex/geometry/geometry.sty
|
||||
Package: geometry 2020/01/02 v5.9 Page Geometry
|
||||
|
||||
(/usr/share/texmf-dist/tex/latex/graphics/keyval.sty
|
||||
Package: keyval 2022/05/29 v1.15 key=value parser (DPC)
|
||||
\KV@toks@=\toks20
|
||||
)
|
||||
(/usr/share/texmf-dist/tex/generic/iftex/ifvtex.sty
|
||||
Package: ifvtex 2019/10/25 v1.7 ifvtex legacy package. Use iftex instead.
|
||||
|
||||
(/usr/share/texmf-dist/tex/generic/iftex/iftex.sty
|
||||
Package: iftex 2024/12/12 v1.0g TeX engine tests
|
||||
))
|
||||
\Gm@cnth=\count279
|
||||
\Gm@cntv=\count280
|
||||
\c@Gm@tempcnt=\count281
|
||||
\Gm@bindingoffset=\dimen152
|
||||
\Gm@wd@mp=\dimen153
|
||||
\Gm@odd@mp=\dimen154
|
||||
\Gm@even@mp=\dimen155
|
||||
\Gm@layoutwidth=\dimen156
|
||||
\Gm@layoutheight=\dimen157
|
||||
\Gm@layouthoffset=\dimen158
|
||||
\Gm@layoutvoffset=\dimen159
|
||||
\Gm@dimlist=\toks21
|
||||
)
|
||||
(/usr/share/texmf-dist/tex/latex/pgf/frontendlayer/tikz.sty
|
||||
(/usr/share/texmf-dist/tex/latex/pgf/basiclayer/pgf.sty
|
||||
(/usr/share/texmf-dist/tex/latex/pgf/utilities/pgfrcs.sty
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex
|
||||
\pgfutil@everybye=\toks22
|
||||
\pgfutil@tempdima=\dimen160
|
||||
\pgfutil@tempdimb=\dimen161
|
||||
)
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def
|
||||
\pgfutil@abb=\box52
|
||||
)
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/pgf.revision.tex)
|
||||
Package: pgfrcs 2023-01-15 v3.1.10 (3.1.10)
|
||||
))
|
||||
Package: pgf 2023-01-15 v3.1.10 (3.1.10)
|
||||
|
||||
(/usr/share/texmf-dist/tex/latex/pgf/basiclayer/pgfcore.sty
|
||||
(/usr/share/texmf-dist/tex/latex/graphics/graphicx.sty
|
||||
Package: graphicx 2021/09/16 v1.2d Enhanced LaTeX Graphics (DPC,SPQR)
|
||||
|
||||
(/usr/share/texmf-dist/tex/latex/graphics/graphics.sty
|
||||
Package: graphics 2024/08/06 v1.4g Standard LaTeX Graphics (DPC,SPQR)
|
||||
|
||||
(/usr/share/texmf-dist/tex/latex/graphics/trig.sty
|
||||
Package: trig 2023/12/02 v1.11 sin cos tan (DPC)
|
||||
)
|
||||
(/usr/share/texmf-dist/tex/latex/graphics-cfg/graphics.cfg
|
||||
File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration
|
||||
)
|
||||
Package graphics Info: Driver file: pdftex.def on input line 106.
|
||||
|
||||
(/usr/share/texmf-dist/tex/latex/graphics-def/pdftex.def
|
||||
File: pdftex.def 2024/04/13 v1.2c Graphics/color driver for pdftex
|
||||
))
|
||||
\Gin@req@height=\dimen162
|
||||
\Gin@req@width=\dimen163
|
||||
)
|
||||
(/usr/share/texmf-dist/tex/latex/pgf/systemlayer/pgfsys.sty
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex
|
||||
Package: pgfsys 2023-01-15 v3.1.10 (3.1.10)
|
||||
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex
|
||||
\pgfkeys@pathtoks=\toks23
|
||||
\pgfkeys@temptoks=\toks24
|
||||
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/utilities/pgfkeyslibraryfiltered.code.te
|
||||
x
|
||||
\pgfkeys@tmptoks=\toks25
|
||||
))
|
||||
\pgf@x=\dimen164
|
||||
\pgf@y=\dimen165
|
||||
\pgf@xa=\dimen166
|
||||
\pgf@ya=\dimen167
|
||||
\pgf@xb=\dimen168
|
||||
\pgf@yb=\dimen169
|
||||
\pgf@xc=\dimen170
|
||||
\pgf@yc=\dimen171
|
||||
\pgf@xd=\dimen172
|
||||
\pgf@yd=\dimen173
|
||||
\w@pgf@writea=\write3
|
||||
\r@pgf@reada=\read3
|
||||
\c@pgf@counta=\count282
|
||||
\c@pgf@countb=\count283
|
||||
\c@pgf@countc=\count284
|
||||
\c@pgf@countd=\count285
|
||||
\t@pgf@toka=\toks26
|
||||
\t@pgf@tokb=\toks27
|
||||
\t@pgf@tokc=\toks28
|
||||
\pgf@sys@id@count=\count286
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg
|
||||
File: pgf.cfg 2023-01-15 v3.1.10 (3.1.10)
|
||||
)
|
||||
Driver file for pgf: pgfsys-pdftex.def
|
||||
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def
|
||||
File: pgfsys-pdftex.def 2023-01-15 v3.1.10 (3.1.10)
|
||||
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf.def
|
||||
File: pgfsys-common-pdf.def 2023-01-15 v3.1.10 (3.1.10)
|
||||
)))
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.code.tex
|
||||
File: pgfsyssoftpath.code.tex 2023-01-15 v3.1.10 (3.1.10)
|
||||
\pgfsyssoftpath@smallbuffer@items=\count287
|
||||
\pgfsyssoftpath@bigbuffer@items=\count288
|
||||
)
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex
|
||||
File: pgfsysprotocol.code.tex 2023-01-15 v3.1.10 (3.1.10)
|
||||
))
|
||||
(/usr/share/texmf-dist/tex/latex/xcolor/xcolor.sty
|
||||
Package: xcolor 2024/09/29 v3.02 LaTeX color extensions (UK)
|
||||
|
||||
(/usr/share/texmf-dist/tex/latex/graphics-cfg/color.cfg
|
||||
File: color.cfg 2016/01/02 v1.6 sample color configuration
|
||||
)
|
||||
Package xcolor Info: Driver file: pdftex.def on input line 274.
|
||||
|
||||
(/usr/share/texmf-dist/tex/latex/graphics/mathcolor.ltx)
|
||||
Package xcolor Info: Model `cmy' substituted by `cmy0' on input line 1349.
|
||||
Package xcolor Info: Model `hsb' substituted by `rgb' on input line 1353.
|
||||
Package xcolor Info: Model `RGB' extended on input line 1365.
|
||||
Package xcolor Info: Model `HTML' substituted by `rgb' on input line 1367.
|
||||
Package xcolor Info: Model `Hsb' substituted by `hsb' on input line 1368.
|
||||
Package xcolor Info: Model `tHsb' substituted by `hsb' on input line 1369.
|
||||
Package xcolor Info: Model `HSB' substituted by `hsb' on input line 1370.
|
||||
Package xcolor Info: Model `Gray' substituted by `gray' on input line 1371.
|
||||
Package xcolor Info: Model `wave' substituted by `hsb' on input line 1372.
|
||||
)
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex
|
||||
Package: pgfcore 2023-01-15 v3.1.10 (3.1.10)
|
||||
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex)
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex
|
||||
\pgfmath@dimen=\dimen174
|
||||
\pgfmath@count=\count289
|
||||
\pgfmath@box=\box53
|
||||
\pgfmath@toks=\toks29
|
||||
\pgfmath@stack@operand=\toks30
|
||||
\pgfmath@stack@operation=\toks31
|
||||
)
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.tex)
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.basic.code.tex)
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.trigonometric.code
|
||||
.tex)
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.random.code.tex)
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.comparison.code.te
|
||||
x) (/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.code.tex)
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code.tex)
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.misc.code.tex)
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.integerarithmetics
|
||||
.code.tex) (/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex)
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex
|
||||
\c@pgfmathroundto@lastzeros=\count290
|
||||
))
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/math/pgfint.code.tex)
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex
|
||||
File: pgfcorepoints.code.tex 2023-01-15 v3.1.10 (3.1.10)
|
||||
\pgf@picminx=\dimen175
|
||||
\pgf@picmaxx=\dimen176
|
||||
\pgf@picminy=\dimen177
|
||||
\pgf@picmaxy=\dimen178
|
||||
\pgf@pathminx=\dimen179
|
||||
\pgf@pathmaxx=\dimen180
|
||||
\pgf@pathminy=\dimen181
|
||||
\pgf@pathmaxy=\dimen182
|
||||
\pgf@xx=\dimen183
|
||||
\pgf@xy=\dimen184
|
||||
\pgf@yx=\dimen185
|
||||
\pgf@yy=\dimen186
|
||||
\pgf@zx=\dimen187
|
||||
\pgf@zy=\dimen188
|
||||
)
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex
|
||||
File: pgfcorepathconstruct.code.tex 2023-01-15 v3.1.10 (3.1.10)
|
||||
\pgf@path@lastx=\dimen189
|
||||
\pgf@path@lasty=\dimen190
|
||||
) (/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex
|
||||
File: pgfcorepathusage.code.tex 2023-01-15 v3.1.10 (3.1.10)
|
||||
\pgf@shorten@end@additional=\dimen191
|
||||
\pgf@shorten@start@additional=\dimen192
|
||||
)
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex
|
||||
File: pgfcorescopes.code.tex 2023-01-15 v3.1.10 (3.1.10)
|
||||
\pgfpic=\box54
|
||||
\pgf@hbox=\box55
|
||||
\pgf@layerbox@main=\box56
|
||||
\pgf@picture@serial@count=\count291
|
||||
)
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex
|
||||
File: pgfcoregraphicstate.code.tex 2023-01-15 v3.1.10 (3.1.10)
|
||||
\pgflinewidth=\dimen193
|
||||
)
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformations.code.t
|
||||
ex
|
||||
File: pgfcoretransformations.code.tex 2023-01-15 v3.1.10 (3.1.10)
|
||||
\pgf@pt@x=\dimen194
|
||||
\pgf@pt@y=\dimen195
|
||||
\pgf@pt@temp=\dimen196
|
||||
) (/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.code.tex
|
||||
File: pgfcorequick.code.tex 2023-01-15 v3.1.10 (3.1.10)
|
||||
)
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.code.tex
|
||||
File: pgfcoreobjects.code.tex 2023-01-15 v3.1.10 (3.1.10)
|
||||
)
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.te
|
||||
x
|
||||
File: pgfcorepathprocessing.code.tex 2023-01-15 v3.1.10 (3.1.10)
|
||||
) (/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex
|
||||
File: pgfcorearrows.code.tex 2023-01-15 v3.1.10 (3.1.10)
|
||||
\pgfarrowsep=\dimen197
|
||||
)
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex
|
||||
File: pgfcoreshade.code.tex 2023-01-15 v3.1.10 (3.1.10)
|
||||
\pgf@max=\dimen198
|
||||
\pgf@sys@shading@range@num=\count292
|
||||
\pgf@shadingcount=\count293
|
||||
)
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex
|
||||
File: pgfcoreimage.code.tex 2023-01-15 v3.1.10 (3.1.10)
|
||||
)
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code.tex
|
||||
File: pgfcoreexternal.code.tex 2023-01-15 v3.1.10 (3.1.10)
|
||||
\pgfexternal@startupbox=\box57
|
||||
)
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.code.tex
|
||||
File: pgfcorelayers.code.tex 2023-01-15 v3.1.10 (3.1.10)
|
||||
)
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransparency.code.tex
|
||||
File: pgfcoretransparency.code.tex 2023-01-15 v3.1.10 (3.1.10)
|
||||
) (/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.code.tex
|
||||
File: pgfcorepatterns.code.tex 2023-01-15 v3.1.10 (3.1.10)
|
||||
)
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/basiclayer/pgfcorerdf.code.tex
|
||||
File: pgfcorerdf.code.tex 2023-01-15 v3.1.10 (3.1.10)
|
||||
)))
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/modules/pgfmoduleshapes.code.tex
|
||||
File: pgfmoduleshapes.code.tex 2023-01-15 v3.1.10 (3.1.10)
|
||||
\pgfnodeparttextbox=\box58
|
||||
)
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/modules/pgfmoduleplot.code.tex
|
||||
File: pgfmoduleplot.code.tex 2023-01-15 v3.1.10 (3.1.10)
|
||||
)
|
||||
(/usr/share/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-0-65.sty
|
||||
Package: pgfcomp-version-0-65 2023-01-15 v3.1.10 (3.1.10)
|
||||
\pgf@nodesepstart=\dimen199
|
||||
\pgf@nodesepend=\dimen256
|
||||
)
|
||||
(/usr/share/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-1-18.sty
|
||||
Package: pgfcomp-version-1-18 2023-01-15 v3.1.10 (3.1.10)
|
||||
))
|
||||
(/usr/share/texmf-dist/tex/latex/pgf/utilities/pgffor.sty
|
||||
(/usr/share/texmf-dist/tex/latex/pgf/utilities/pgfkeys.sty
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex))
|
||||
(/usr/share/texmf-dist/tex/latex/pgf/math/pgfmath.sty
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex))
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex
|
||||
Package: pgffor 2023-01-15 v3.1.10 (3.1.10)
|
||||
\pgffor@iter=\dimen257
|
||||
\pgffor@skip=\dimen258
|
||||
\pgffor@stack=\toks32
|
||||
\pgffor@toks=\toks33
|
||||
))
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex
|
||||
Package: tikz 2023-01-15 v3.1.10 (3.1.10)
|
||||
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/libraries/pgflibraryplothandlers.code.te
|
||||
x
|
||||
File: pgflibraryplothandlers.code.tex 2023-01-15 v3.1.10 (3.1.10)
|
||||
\pgf@plot@mark@count=\count294
|
||||
\pgfplotmarksize=\dimen259
|
||||
)
|
||||
\tikz@lastx=\dimen260
|
||||
\tikz@lasty=\dimen261
|
||||
\tikz@lastxsaved=\dimen262
|
||||
\tikz@lastysaved=\dimen263
|
||||
\tikz@lastmovetox=\dimen264
|
||||
\tikz@lastmovetoy=\dimen265
|
||||
\tikzleveldistance=\dimen266
|
||||
\tikzsiblingdistance=\dimen267
|
||||
\tikz@figbox=\box59
|
||||
\tikz@figbox@bg=\box60
|
||||
\tikz@tempbox=\box61
|
||||
\tikz@tempbox@bg=\box62
|
||||
\tikztreelevel=\count295
|
||||
\tikznumberofchildren=\count296
|
||||
\tikznumberofcurrentchild=\count297
|
||||
\tikz@fig@count=\count298
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/modules/pgfmodulematrix.code.tex
|
||||
File: pgfmodulematrix.code.tex 2023-01-15 v3.1.10 (3.1.10)
|
||||
\pgfmatrixcurrentrow=\count299
|
||||
\pgfmatrixcurrentcolumn=\count300
|
||||
\pgf@matrix@numberofcolumns=\count301
|
||||
)
|
||||
\tikz@expandcount=\count302
|
||||
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrary
|
||||
topaths.code.tex
|
||||
File: tikzlibrarytopaths.code.tex 2023-01-15 v3.1.10 (3.1.10)
|
||||
))) (/usr/share/texmf-dist/tex/latex/amsmath/amsmath.sty
|
||||
Package: amsmath 2024/11/05 v2.17t AMS math features
|
||||
\@mathmargin=\skip51
|
||||
|
||||
For additional information on amsmath, use the `?' option.
|
||||
(/usr/share/texmf-dist/tex/latex/amsmath/amstext.sty
|
||||
Package: amstext 2021/08/26 v2.01 AMS text
|
||||
|
||||
(/usr/share/texmf-dist/tex/latex/amsmath/amsgen.sty
|
||||
File: amsgen.sty 1999/11/30 v2.0 generic functions
|
||||
\@emptytoks=\toks34
|
||||
\ex@=\dimen268
|
||||
))
|
||||
(/usr/share/texmf-dist/tex/latex/amsmath/amsbsy.sty
|
||||
Package: amsbsy 1999/11/29 v1.2d Bold Symbols
|
||||
\pmbraise@=\dimen269
|
||||
)
|
||||
(/usr/share/texmf-dist/tex/latex/amsmath/amsopn.sty
|
||||
Package: amsopn 2022/04/08 v2.04 operator names
|
||||
)
|
||||
\inf@bad=\count303
|
||||
LaTeX Info: Redefining \frac on input line 233.
|
||||
\uproot@=\count304
|
||||
\leftroot@=\count305
|
||||
LaTeX Info: Redefining \overline on input line 398.
|
||||
LaTeX Info: Redefining \colon on input line 409.
|
||||
\classnum@=\count306
|
||||
\DOTSCASE@=\count307
|
||||
LaTeX Info: Redefining \ldots on input line 495.
|
||||
LaTeX Info: Redefining \dots on input line 498.
|
||||
LaTeX Info: Redefining \cdots on input line 619.
|
||||
\Mathstrutbox@=\box63
|
||||
\strutbox@=\box64
|
||||
LaTeX Info: Redefining \big on input line 721.
|
||||
LaTeX Info: Redefining \Big on input line 722.
|
||||
LaTeX Info: Redefining \bigg on input line 723.
|
||||
LaTeX Info: Redefining \Bigg on input line 724.
|
||||
\big@size=\dimen270
|
||||
LaTeX Font Info: Redeclaring font encoding OML on input line 742.
|
||||
LaTeX Font Info: Redeclaring font encoding OMS on input line 743.
|
||||
\macc@depth=\count308
|
||||
LaTeX Info: Redefining \bmod on input line 904.
|
||||
LaTeX Info: Redefining \pmod on input line 909.
|
||||
LaTeX Info: Redefining \smash on input line 939.
|
||||
LaTeX Info: Redefining \relbar on input line 969.
|
||||
LaTeX Info: Redefining \Relbar on input line 970.
|
||||
\c@MaxMatrixCols=\count309
|
||||
\dotsspace@=\muskip17
|
||||
\c@parentequation=\count310
|
||||
\dspbrk@lvl=\count311
|
||||
\tag@help=\toks35
|
||||
\row@=\count312
|
||||
\column@=\count313
|
||||
\maxfields@=\count314
|
||||
\andhelp@=\toks36
|
||||
\eqnshift@=\dimen271
|
||||
\alignsep@=\dimen272
|
||||
\tagshift@=\dimen273
|
||||
\tagwidth@=\dimen274
|
||||
\totwidth@=\dimen275
|
||||
\lineht@=\dimen276
|
||||
\@envbody=\toks37
|
||||
\multlinegap=\skip52
|
||||
\multlinetaggap=\skip53
|
||||
\mathdisplay@stack=\toks38
|
||||
LaTeX Info: Redefining \[ on input line 2953.
|
||||
LaTeX Info: Redefining \] on input line 2954.
|
||||
)
|
||||
(/usr/share/texmf-dist/tex/latex/amsfonts/amssymb.sty
|
||||
Package: amssymb 2013/01/14 v3.01 AMS font symbols
|
||||
|
||||
(/usr/share/texmf-dist/tex/latex/amsfonts/amsfonts.sty
|
||||
Package: amsfonts 2013/01/14 v3.01 Basic AMSFonts support
|
||||
\symAMSa=\mathgroup4
|
||||
\symAMSb=\mathgroup5
|
||||
LaTeX Font Info: Redeclaring math symbol \hbar on input line 98.
|
||||
LaTeX Font Info: Overwriting math alphabet `\mathfrak' in version `bold'
|
||||
(Font) U/euf/m/n --> U/euf/b/n on input line 106.
|
||||
))
|
||||
(/usr/share/texmf-dist/tex/latex/enumitem/enumitem.sty
|
||||
Package: enumitem 2025/02/06 v3.11 Customized lists
|
||||
\labelindent=\skip54
|
||||
\enit@outerparindent=\dimen277
|
||||
\enit@toks=\toks39
|
||||
\enit@inbox=\box65
|
||||
\enit@count@id=\count315
|
||||
\enitdp@description=\count316
|
||||
)
|
||||
(/usr/share/texmf-dist/tex/latex/tcolorbox/tcolorbox.sty
|
||||
Package: tcolorbox 2024/10/22 version 6.4.1 text color boxes
|
||||
|
||||
(/usr/share/texmf-dist/tex/latex/tools/verbatim.sty
|
||||
Package: verbatim 2024-01-22 v1.5x LaTeX2e package for verbatim enhancements
|
||||
\every@verbatim=\toks40
|
||||
\verbatim@line=\toks41
|
||||
\verbatim@in@stream=\read4
|
||||
)
|
||||
(/usr/share/texmf-dist/tex/latex/environ/environ.sty
|
||||
Package: environ 2014/05/04 v0.3 A new way to define environments
|
||||
|
||||
(/usr/share/texmf-dist/tex/latex/trimspaces/trimspaces.sty
|
||||
Package: trimspaces 2009/09/17 v1.1 Trim spaces around a token list
|
||||
))
|
||||
(/usr/share/texmf-dist/tex/latex/etoolbox/etoolbox.sty
|
||||
Package: etoolbox 2025/02/11 v2.5l e-TeX tools for LaTeX (JAW)
|
||||
\etb@tempcnta=\count317
|
||||
)
|
||||
\tcb@titlebox=\box66
|
||||
\tcb@upperbox=\box67
|
||||
\tcb@lowerbox=\box68
|
||||
\tcb@phantombox=\box69
|
||||
\c@tcbbreakpart=\count318
|
||||
\c@tcblayer=\count319
|
||||
\c@tcolorbox@number=\count320
|
||||
\l__tcobox_tmpa_box=\box70
|
||||
\l__tcobox_tmpa_dim=\dimen278
|
||||
\tcb@temp=\box71
|
||||
\tcb@temp=\box72
|
||||
\tcb@temp=\box73
|
||||
\tcb@temp=\box74
|
||||
)
|
||||
(/usr/share/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty
|
||||
Package: fancyhdr 2025/02/07 v5.2 Extensive control of page headers and footers
|
||||
|
||||
\f@nch@headwidth=\skip55
|
||||
\f@nch@offset@elh=\skip56
|
||||
\f@nch@offset@erh=\skip57
|
||||
\f@nch@offset@olh=\skip58
|
||||
\f@nch@offset@orh=\skip59
|
||||
\f@nch@offset@elf=\skip60
|
||||
\f@nch@offset@erf=\skip61
|
||||
\f@nch@offset@olf=\skip62
|
||||
\f@nch@offset@orf=\skip63
|
||||
\f@nch@height=\skip64
|
||||
\f@nch@footalignment=\skip65
|
||||
\f@nch@widthL=\skip66
|
||||
\f@nch@widthC=\skip67
|
||||
\f@nch@widthR=\skip68
|
||||
\@temptokenb=\toks42
|
||||
)
|
||||
(/usr/share/texmf-dist/tex/latex/tools/multicol.sty
|
||||
Package: multicol 2024/09/14 v1.9i multicolumn formatting (FMi)
|
||||
\c@tracingmulticols=\count321
|
||||
\mult@box=\box75
|
||||
\multicol@leftmargin=\dimen279
|
||||
\c@unbalance=\count322
|
||||
\c@collectmore=\count323
|
||||
\doublecol@number=\count324
|
||||
\multicoltolerance=\count325
|
||||
\multicolpretolerance=\count326
|
||||
\full@width=\dimen280
|
||||
\page@free=\dimen281
|
||||
\premulticols=\dimen282
|
||||
\postmulticols=\dimen283
|
||||
\multicolsep=\skip69
|
||||
\multicolbaselineskip=\skip70
|
||||
\partial@page=\box76
|
||||
\last@line=\box77
|
||||
\mc@boxedresult=\box78
|
||||
\maxbalancingoverflow=\dimen284
|
||||
\mult@rightbox=\box79
|
||||
\mult@grightbox=\box80
|
||||
\mult@firstbox=\box81
|
||||
\mult@gfirstbox=\box82
|
||||
\@tempa=\box83
|
||||
\@tempa=\box84
|
||||
\@tempa=\box85
|
||||
\@tempa=\box86
|
||||
\@tempa=\box87
|
||||
\@tempa=\box88
|
||||
\@tempa=\box89
|
||||
\@tempa=\box90
|
||||
\@tempa=\box91
|
||||
\@tempa=\box92
|
||||
\@tempa=\box93
|
||||
\@tempa=\box94
|
||||
\@tempa=\box95
|
||||
\@tempa=\box96
|
||||
\@tempa=\box97
|
||||
\@tempa=\box98
|
||||
\@tempa=\box99
|
||||
\@tempa=\box100
|
||||
\@tempa=\box101
|
||||
\@tempa=\box102
|
||||
\@tempa=\box103
|
||||
\@tempa=\box104
|
||||
\@tempa=\box105
|
||||
\@tempa=\box106
|
||||
\@tempa=\box107
|
||||
\@tempa=\box108
|
||||
\@tempa=\box109
|
||||
\@tempa=\box110
|
||||
\@tempa=\box111
|
||||
\@tempa=\box112
|
||||
\@tempa=\box113
|
||||
\@tempa=\box114
|
||||
\@tempa=\box115
|
||||
\@tempa=\box116
|
||||
\@tempa=\box117
|
||||
\@tempa=\box118
|
||||
\c@minrows=\count327
|
||||
\c@columnbadness=\count328
|
||||
\c@finalcolumnbadness=\count329
|
||||
\last@try=\dimen285
|
||||
\multicolovershoot=\dimen286
|
||||
\multicolundershoot=\dimen287
|
||||
\mult@nat@firstbox=\box119
|
||||
\colbreak@box=\box120
|
||||
\mc@col@check@num=\count330
|
||||
)
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrary
|
||||
shapes.geometric.code.tex
|
||||
File: tikzlibraryshapes.geometric.code.tex 2023-01-15 v3.1.10 (3.1.10)
|
||||
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshapes.geomet
|
||||
ric.code.tex
|
||||
File: pgflibraryshapes.geometric.code.tex 2023-01-15 v3.1.10 (3.1.10)
|
||||
))
|
||||
(/usr/share/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrary
|
||||
calc.code.tex
|
||||
File: tikzlibrarycalc.code.tex 2023-01-15 v3.1.10 (3.1.10)
|
||||
) (/usr/share/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def
|
||||
File: l3backend-pdftex.def 2024-05-08 L3 backend support: PDF output (pdfTeX)
|
||||
\l__color_backend_stack_int=\count331
|
||||
\l__pdf_internal_box=\box121
|
||||
) (./knn_microregions_activite.aux
|
||||
(/usr/share/texmf-dist/tex/generic/babel/locale/fr/babel-french.tex
|
||||
Package babel Info: Importing font and identification data for french
|
||||
(babel) from babel-fr.ini. Reported on input line 11.
|
||||
))
|
||||
\openout1 = `knn_microregions_activite.aux'.
|
||||
|
||||
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 36.
|
||||
LaTeX Font Info: ... okay on input line 36.
|
||||
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 36.
|
||||
LaTeX Font Info: ... okay on input line 36.
|
||||
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 36.
|
||||
LaTeX Font Info: ... okay on input line 36.
|
||||
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 36.
|
||||
LaTeX Font Info: ... okay on input line 36.
|
||||
LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 36.
|
||||
LaTeX Font Info: ... okay on input line 36.
|
||||
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 36.
|
||||
LaTeX Font Info: ... okay on input line 36.
|
||||
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 36.
|
||||
LaTeX Font Info: ... okay on input line 36.
|
||||
LaTeX Info: Redefining \degres on input line 36.
|
||||
Package french.ldf Info: Setting StandardItemizeEnv=true for
|
||||
(french.ldf) compatibility with enumitem package,
|
||||
(french.ldf) reported on input line 36.
|
||||
Package french.ldf Info: Setting StandardEnumerateEnv=true for
|
||||
(french.ldf) compatibility with enumitem package,
|
||||
(french.ldf) reported on input line 36.
|
||||
LaTeX Info: Redefining \up on input line 36.
|
||||
|
||||
*geometry* driver: auto-detecting
|
||||
*geometry* detected driver: pdftex
|
||||
*geometry* verbose mode - [ preamble ] result:
|
||||
* driver: pdftex
|
||||
* paper: a4paper
|
||||
* layout: <same size as paper>
|
||||
* layoutoffset:(h,v)=(0.0pt,0.0pt)
|
||||
* modes:
|
||||
* h-part:(L,W,R)=(56.9055pt, 483.69687pt, 56.9055pt)
|
||||
* v-part:(T,H,B)=(56.9055pt, 731.23584pt, 56.9055pt)
|
||||
* \paperwidth=597.50787pt
|
||||
* \paperheight=845.04684pt
|
||||
* \textwidth=483.69687pt
|
||||
* \textheight=731.23584pt
|
||||
* \oddsidemargin=-15.36449pt
|
||||
* \evensidemargin=-15.36449pt
|
||||
* \topmargin=-52.36449pt
|
||||
* \headheight=12.0pt
|
||||
* \headsep=25.0pt
|
||||
* \topskip=11.0pt
|
||||
* \footskip=30.0pt
|
||||
* \marginparwidth=50.0pt
|
||||
* \marginparsep=10.0pt
|
||||
* \columnsep=10.0pt
|
||||
* \skip\footins=10.0pt plus 4.0pt minus 2.0pt
|
||||
* \hoffset=0.0pt
|
||||
* \voffset=0.0pt
|
||||
* \mag=1000
|
||||
* \@twocolumnfalse
|
||||
* \@twosidefalse
|
||||
* \@mparswitchfalse
|
||||
* \@reversemarginfalse
|
||||
* (1in=72.27pt=25.4mm, 1cm=28.453pt)
|
||||
|
||||
(/usr/share/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
|
||||
[Loading MPS to PDF converter (version 2006.09.02).]
|
||||
\scratchcounter=\count332
|
||||
\scratchdimen=\dimen288
|
||||
\scratchbox=\box122
|
||||
\nofMPsegments=\count333
|
||||
\nofMParguments=\count334
|
||||
\everyMPshowfont=\toks43
|
||||
\MPscratchCnt=\count335
|
||||
\MPscratchDim=\dimen289
|
||||
\MPnumerator=\count336
|
||||
\makeMPintoPDFobject=\count337
|
||||
\everyMPtoPDFconversion=\toks44
|
||||
) (/usr/share/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty
|
||||
Package: epstopdf-base 2020-01-24 v2.11 Base part for package epstopdf
|
||||
Package epstopdf-base Info: Redefining graphics rule for `.eps' on input line 4
|
||||
85.
|
||||
|
||||
(/usr/share/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg
|
||||
File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Liv
|
||||
e
|
||||
))
|
||||
LaTeX Font Info: Trying to load font information for U+msa on input line 63.
|
||||
|
||||
|
||||
(/usr/share/texmf-dist/tex/latex/amsfonts/umsa.fd
|
||||
File: umsa.fd 2013/01/14 v3.01 AMS symbols A
|
||||
)
|
||||
LaTeX Font Info: Trying to load font information for U+msb on input line 63.
|
||||
|
||||
|
||||
(/usr/share/texmf-dist/tex/latex/amsfonts/umsb.fd
|
||||
File: umsb.fd 2013/01/14 v3.01 AMS symbols B
|
||||
)
|
||||
|
||||
[1
|
||||
|
||||
{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}{/usr/share/texmf-dist/fonts
|
||||
/enc/dvips/cm-super/cm-super-t1.enc}]
|
||||
|
||||
[2]
|
||||
|
||||
[3]
|
||||
|
||||
[4]
|
||||
|
||||
[5]
|
||||
|
||||
[6] (./knn_microregions_activite.aux)
|
||||
***********
|
||||
LaTeX2e <2024-11-01> patch level 2
|
||||
L3 programming layer <2025-01-18>
|
||||
***********
|
||||
)
|
||||
Here is how much of TeX's memory you used:
|
||||
19631 strings out of 475142
|
||||
396220 string characters out of 5765947
|
||||
785977 words of memory out of 5000000
|
||||
42341 multiletter control sequences out of 15000+600000
|
||||
571118 words of font info for 64 fonts, out of 8000000 for 9000
|
||||
14 hyphenation exceptions out of 8191
|
||||
102i,11n,107p,426b,737s stack positions out of 10000i,1000n,20000p,200000b,200000s
|
||||
</usr/share/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi10.pfb></usr/share/
|
||||
texmf-dist/fonts/type1/public/amsfonts/cm/cmsy10.pfb></usr/share/texmf-dist/fon
|
||||
ts/type1/public/cm-super/sfbx1095.pfb></usr/share/texmf-dist/fonts/type1/public
|
||||
/cm-super/sfbx1200.pfb></usr/share/texmf-dist/fonts/type1/public/cm-super/sfbx1
|
||||
440.pfb></usr/share/texmf-dist/fonts/type1/public/cm-super/sfbx2488.pfb></usr/s
|
||||
hare/texmf-dist/fonts/type1/public/cm-super/sfrm1000.pfb></usr/share/texmf-dist
|
||||
/fonts/type1/public/cm-super/sfrm1095.pfb></usr/share/texmf-dist/fonts/type1/pu
|
||||
blic/cm-super/sfti1095.pfb>
|
||||
Output written on knn_microregions_activite.pdf (6 pages, 170496 bytes).
|
||||
PDF statistics:
|
||||
72 PDF objects out of 1000 (max. 8388607)
|
||||
45 compressed objects within 1 object stream
|
||||
0 named destinations out of 1000 (max. 500000)
|
||||
13 words of extra memory for PDF output out of 10000 (max. 10000000)
|
||||
|
||||
BIN
activite2/knn_microregions_activite.pdf
Normal file
BIN
activite2/knn_microregions_activite.pdf
Normal file
Binary file not shown.
BIN
activite2/knn_microregions_activite.synctex.gz
Normal file
BIN
activite2/knn_microregions_activite.synctex.gz
Normal file
Binary file not shown.
403
activite2/knn_microregions_activite.tex
Normal file
403
activite2/knn_microregions_activite.tex
Normal file
|
|
@ -0,0 +1,403 @@
|
|||
\documentclass[a4paper,11pt]{article}
|
||||
|
||||
% Packages
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage[T1]{fontenc}
|
||||
\usepackage[francais]{babel}
|
||||
\usepackage{geometry}
|
||||
\usepackage{tikz}
|
||||
\usepackage{amsmath}
|
||||
\usepackage{amssymb}
|
||||
\usepackage{enumitem}
|
||||
\usepackage{xcolor}
|
||||
\usepackage{tcolorbox}
|
||||
\usepackage{fancyhdr}
|
||||
\usepackage{multicol}
|
||||
|
||||
% Configuration de la page
|
||||
\geometry{margin=2cm}
|
||||
\pagestyle{fancy}
|
||||
\fancyhf{}
|
||||
\fancyfoot[C]{Page \thepage/4 -- Activité k-NN : Micro-régions}
|
||||
\renewcommand{\headrulewidth}{0pt}
|
||||
|
||||
% Couleurs pour les micro-régions
|
||||
\definecolor{region1}{RGB}{231,76,60} % Rouge
|
||||
\definecolor{region2}{RGB}{52,152,219} % Bleu
|
||||
\definecolor{region3}{RGB}{46,204,113} % Vert
|
||||
\definecolor{region4}{RGB}{241,196,15} % Jaune
|
||||
\definecolor{region5}{RGB}{155,89,182} % Violet
|
||||
\definecolor{lightblue}{RGB}{227,242,253}
|
||||
\definecolor{lightyellow}{RGB}{255,243,205}
|
||||
|
||||
% Configuration TikZ
|
||||
\usetikzlibrary{shapes.geometric,calc}
|
||||
|
||||
\begin{document}
|
||||
|
||||
% ============= PAGE 1 =============
|
||||
\begin{center}
|
||||
{\Huge \textbf{Activité débranchée : k-NN}}\\[0.3cm]
|
||||
{\Large \textbf{Classification par micro-régions}}
|
||||
\end{center}
|
||||
|
||||
\vspace{0.5cm}
|
||||
|
||||
\textbf{Objectif :} Utiliser l'algorithme k-NN pour déterminer à quelle micro-région appartient un nouveau point, en se basant sur ses plus proches voisins.
|
||||
|
||||
\vspace{0.3cm}
|
||||
|
||||
\begin{tcolorbox}[colback=lightblue,colframe=blue!75!black,title=\textbf{Principe}]
|
||||
\begin{itemize}[leftmargin=*]
|
||||
\item On dispose de points classifiés en plusieurs \textit{zones} (micro-régions)
|
||||
\item Pour classifier un nouveau point, on identifie ses \textit{k} plus proches voisins
|
||||
\item La zone majoritaire parmi ces \textit{k} voisins devient la classification du point
|
||||
\item \textbf{Différence avec 2 classes :} Avec plusieurs zones, les votes sont plus complexes !
|
||||
\end{itemize}
|
||||
\end{tcolorbox}
|
||||
|
||||
\vspace{0.5cm}
|
||||
|
||||
\section*{Exercice 1 : Classification avec 5 zones}
|
||||
|
||||
Voici des points répartis en 5 zones de couleurs différentes. Le point noir ($\star$) est à classifier.
|
||||
|
||||
\vspace{0.3cm}
|
||||
|
||||
\begin{center}
|
||||
\begin{tikzpicture}[scale=1.1]
|
||||
% Grille
|
||||
\draw[gray!30, step=1] (0,0) grid (10,10);
|
||||
|
||||
% Cadre
|
||||
\draw[thick] (0,0) rectangle (10,10);
|
||||
|
||||
% Zone 1 (Rouge) - En haut à gauche
|
||||
\foreach \point in {(1,9), (1.5,8.5), (2,9.5), (1,8), (2.5,8.5), (1.5,7.5)} {
|
||||
\fill[region1] \point circle (0.15);
|
||||
}
|
||||
|
||||
% Zone 2 (Bleu) - En haut à droite
|
||||
\foreach \point in {(8,9), (8.5,8.5), (9,9.5), (8,8), (9.5,8.5), (8.5,7.5)} {
|
||||
\fill[region2] \point circle (0.15);
|
||||
}
|
||||
|
||||
% Zone 3 (Vert) - En bas à gauche
|
||||
\foreach \point in {(1,2), (1.5,1.5), (2,2.5), (1,1), (2.5,1.5), (1.5,2.5)} {
|
||||
\fill[region3] \point circle (0.15);
|
||||
}
|
||||
|
||||
% Zone 4 (Jaune) - En bas à droite
|
||||
\foreach \point in {(8,2), (8.5,1.5), (9,2.5), (8,1), (9.5,1.5), (8.5,2.5)} {
|
||||
\fill[region4] \point circle (0.15);
|
||||
}
|
||||
|
||||
% Zone 5 (Violet) - Au centre
|
||||
\foreach \point in {(5,5), (5.5,5.5), (4.5,5.5), (5.5,4.5), (4.5,4.5), (5,6)} {
|
||||
\fill[region5] \point circle (0.15);
|
||||
}
|
||||
|
||||
% Point à classifier (étoile noire)
|
||||
\node[star,star points=5,star point ratio=2.5,fill=black,draw=black,thick,minimum size=0.6cm] at (6.5,6) {};
|
||||
|
||||
\end{tikzpicture}
|
||||
|
||||
\vspace{0.3cm}
|
||||
|
||||
% Légende
|
||||
\begin{tabular}{ccccccccc}
|
||||
\textcolor{region1}{$\bullet$} Zone 1 & \quad &
|
||||
\textcolor{region2}{$\bullet$} Zone 2 & \quad &
|
||||
\textcolor{region3}{$\bullet$} Zone 3 & \quad &
|
||||
\textcolor{region4}{$\bullet$} Zone 4 & \quad &
|
||||
\textcolor{region5}{$\bullet$} Zone 5
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
|
||||
\vspace{0.5cm}
|
||||
|
||||
\subsection*{Questions avec k = 3 :}
|
||||
|
||||
\begin{enumerate}
|
||||
\item Identifiez les 3 points les plus proches du point noir $\star$. Tracez les distances.
|
||||
|
||||
\vspace{0.3cm}
|
||||
Les 3 plus proches : Zone \underline{\hspace{1cm}}, Zone \underline{\hspace{1cm}}, Zone \underline{\hspace{1cm}}
|
||||
|
||||
\vspace{0.3cm}
|
||||
\item Comptez les votes pour chaque zone parmi ces 3 voisins :
|
||||
|
||||
\vspace{0.2cm}
|
||||
Zone 1 : \underline{\hspace{1cm}} \quad Zone 2 : \underline{\hspace{1cm}} \quad Zone 3 : \underline{\hspace{1cm}}
|
||||
|
||||
Zone 4 : \underline{\hspace{1cm}} \quad Zone 5 : \underline{\hspace{1cm}}
|
||||
|
||||
\vspace{0.3cm}
|
||||
\item Quelle est la zone majoritaire ? \underline{\hspace{4cm}}
|
||||
|
||||
\vspace{0.3cm}
|
||||
\item Y a-t-il égalité entre plusieurs zones ? \underline{\hspace{4cm}}
|
||||
\end{enumerate}
|
||||
|
||||
% ============= PAGE 2 =============
|
||||
%\newpage
|
||||
|
||||
\section*{Exercice 2 : Influence de k avec plusieurs classes}
|
||||
|
||||
Reprenez le même graphique que l'exercice 1.
|
||||
|
||||
\vspace{0.5cm}
|
||||
|
||||
\subsection*{a) Avec k = 5 (5 voisins)}
|
||||
|
||||
\begin{itemize}
|
||||
\item Listez les 5 points les plus proches :
|
||||
|
||||
\vspace{0.2cm}
|
||||
Zone \underline{\hspace{1.5cm}}, Zone \underline{\hspace{1.5cm}}, Zone \underline{\hspace{1.5cm}},
|
||||
|
||||
Zone \underline{\hspace{1.5cm}}, Zone \underline{\hspace{1.5cm}}
|
||||
|
||||
\vspace{0.3cm}
|
||||
\item Votes par zone :
|
||||
|
||||
\vspace{0.2cm}
|
||||
Zone 1 : \underline{\hspace{1cm}} \quad Zone 2 : \underline{\hspace{1cm}} \quad Zone 3 : \underline{\hspace{1cm}}
|
||||
|
||||
Zone 4 : \underline{\hspace{1cm}} \quad Zone 5 : \underline{\hspace{1cm}}
|
||||
|
||||
\vspace{0.3cm}
|
||||
\item Classification du point noir : Zone \underline{\hspace{3cm}}
|
||||
\end{itemize}
|
||||
|
||||
\vspace{0.8cm}
|
||||
|
||||
\subsection*{b) Avec k = 7 (7 voisins)}
|
||||
|
||||
\begin{itemize}
|
||||
\item Votes par zone :
|
||||
|
||||
\vspace{0.2cm}
|
||||
Zone 1 : \underline{\hspace{1cm}} \quad Zone 2 : \underline{\hspace{1cm}} \quad Zone 3 : \underline{\hspace{1cm}}
|
||||
|
||||
Zone 4 : \underline{\hspace{1cm}} \quad Zone 5 : \underline{\hspace{1cm}}
|
||||
|
||||
\vspace{0.3cm}
|
||||
\item Classification du point noir : Zone \underline{\hspace{3cm}}
|
||||
\end{itemize}
|
||||
|
||||
\vspace{1cm}
|
||||
|
||||
\begin{tcolorbox}[colback=lightyellow,colframe=orange!75!black,title=\textbf{Réflexion : Plusieurs classes}]
|
||||
|
||||
\textbf{1. Qu'est-ce qui change par rapport à 2 classes seulement ?}
|
||||
|
||||
\vspace{0.8cm}
|
||||
\underline{\hspace{14cm}}
|
||||
|
||||
\vspace{0.4cm}
|
||||
\underline{\hspace{14cm}}
|
||||
|
||||
\vspace{0.5cm}
|
||||
|
||||
\textbf{2. Peut-il y avoir des égalités entre zones ? Donnez un exemple.}
|
||||
|
||||
\vspace{0.8cm}
|
||||
\underline{\hspace{14cm}}
|
||||
|
||||
\vspace{0.4cm}
|
||||
\underline{\hspace{14cm}}
|
||||
|
||||
\vspace{0.5cm}
|
||||
|
||||
\textbf{3. Comment résoudre une égalité ?}
|
||||
|
||||
\vspace{0.8cm}
|
||||
\underline{\hspace{14cm}}
|
||||
|
||||
\vspace{0.4cm}
|
||||
\underline{\hspace{14cm}}
|
||||
|
||||
\end{tcolorbox}
|
||||
|
||||
% ============= PAGE 3 =============
|
||||
%\newpage
|
||||
|
||||
\section*{Exercice 3 : Cas complexe avec 4 zones}
|
||||
|
||||
Voici une nouvelle situation avec 4 zones différentes. Classifiez le point $\star$ avec k = 5.
|
||||
|
||||
\vspace{0.3cm}
|
||||
|
||||
\begin{center}
|
||||
\begin{tikzpicture}[scale=1.2]
|
||||
% Grille
|
||||
\draw[gray!30, step=1] (0,0) grid (10,10);
|
||||
|
||||
% Cadre
|
||||
\draw[thick] (0,0) rectangle (10,10);
|
||||
|
||||
% Zone A (Rouge) - Dispersée
|
||||
\foreach \point in {(1,8), (2,7), (1,6), (3,8.5), (2.5,6.5), (1.5,9)} {
|
||||
\fill[region1] \point circle (0.15);
|
||||
}
|
||||
|
||||
% Zone B (Bleu) - Coin supérieur droit
|
||||
\foreach \point in {(8,8), (9,8.5), (8.5,7.5), (9,9), (8,9.5), (7.5,8)} {
|
||||
\fill[region2] \point circle (0.15);
|
||||
}
|
||||
|
||||
% Zone C (Vert) - En bas
|
||||
\foreach \point in {(3,2), (4,1.5), (5,2), (6,1.5), (4,2.5), (5,1)} {
|
||||
\fill[region3] \point circle (0.15);
|
||||
}
|
||||
|
||||
% Zone D (Violet) - Centre-droit
|
||||
\foreach \point in {(6,5), (7,5.5), (6.5,4.5), (7.5,5), (6,6), (7,6.5)} {
|
||||
\fill[region5] \point circle (0.15);
|
||||
}
|
||||
|
||||
% Point à classifier
|
||||
\node[star,star points=5,star point ratio=2.5,fill=black,draw=black,thick,minimum size=0.6cm] at (5.5,5.5) {};
|
||||
|
||||
\end{tikzpicture}
|
||||
|
||||
\vspace{0.3cm}
|
||||
|
||||
% Légende
|
||||
\begin{tabular}{ccccccc}
|
||||
\textcolor{region1}{$\bullet$} Zone A & \quad &
|
||||
\textcolor{region2}{$\bullet$} Zone B & \quad &
|
||||
\textcolor{region3}{$\bullet$} Zone C & \quad &
|
||||
\textcolor{region5}{$\bullet$} Zone D
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
|
||||
\vspace{0.5cm}
|
||||
|
||||
\subsection*{Travail à faire :}
|
||||
|
||||
\begin{enumerate}
|
||||
\item Identifiez les 5 plus proches voisins et tracez les distances sur le graphique
|
||||
|
||||
\vspace{0.3cm}
|
||||
\item Complétez le tableau de votes :
|
||||
|
||||
\vspace{0.3cm}
|
||||
\begin{center}
|
||||
\begin{tabular}{|c|c|c|c|}
|
||||
\hline
|
||||
Zone A & Zone B & Zone C & Zone D \\
|
||||
\hline
|
||||
\hspace{1.5cm} & \hspace{1.5cm} & \hspace{1.5cm} & \hspace{1.5cm} \\[0.5cm]
|
||||
\hline
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
|
||||
\vspace{0.3cm}
|
||||
\item Classification finale : Zone \underline{\hspace{4cm}}
|
||||
|
||||
\vspace{0.3cm}
|
||||
\item Cette classification vous semble-t-elle cohérente visuellement ? Pourquoi ?
|
||||
|
||||
\vspace{0.8cm}
|
||||
\underline{\hspace{14cm}}
|
||||
|
||||
\vspace{0.4cm}
|
||||
\underline{\hspace{14cm}}
|
||||
\end{enumerate}
|
||||
|
||||
% ============= PAGE 4 =============
|
||||
%\newpage
|
||||
|
||||
\section*{Exercice 4 : Création libre}
|
||||
|
||||
Créez votre propre situation avec au moins 3 zones différentes.
|
||||
|
||||
\vspace{0.5cm}
|
||||
|
||||
\begin{center}
|
||||
\begin{tikzpicture}[scale=1.3]
|
||||
% Grille
|
||||
\draw[gray!20, step=1] (0,0) grid (12,12);
|
||||
|
||||
% Cadre
|
||||
\draw[very thick] (0,0) rectangle (12,12);
|
||||
|
||||
% Graduations
|
||||
\foreach \x in {0,2,4,6,8,10,12} {
|
||||
\node[below] at (\x,-0.2) {\small \x};
|
||||
}
|
||||
\foreach \y in {0,2,4,6,8,10,12} {
|
||||
\node[left] at (-0.2,\y) {\small \y};
|
||||
}
|
||||
\end{tikzpicture}
|
||||
\end{center}
|
||||
|
||||
\vspace{0.5cm}
|
||||
|
||||
\begin{tcolorbox}[colback=lightblue,colframe=blue!75!black,title=\textbf{Instructions}]
|
||||
\begin{itemize}
|
||||
\item Choisissez 3 à 5 zones (utilisez des couleurs différentes)
|
||||
\item Placez au moins 5 points par zone
|
||||
\item Placez une étoile noire (point à classifier)
|
||||
\item Utilisez k = 5 et déterminez la zone du point noir
|
||||
\end{itemize}
|
||||
\end{tcolorbox}
|
||||
|
||||
\vspace{0.5cm}
|
||||
|
||||
\textbf{Vos zones :}
|
||||
|
||||
Zone 1 : \underline{\hspace{3cm}} (couleur : \underline{\hspace{2cm}})
|
||||
|
||||
Zone 2 : \underline{\hspace{3cm}} (couleur : \underline{\hspace{2cm}})
|
||||
|
||||
Zone 3 : \underline{\hspace{3cm}} (couleur : \underline{\hspace{2cm}})
|
||||
|
||||
\vspace{0.3cm}
|
||||
|
||||
\textbf{Classification avec k = 5 :} Zone \underline{\hspace{4cm}}
|
||||
|
||||
\vspace{1cm}
|
||||
|
||||
\section*{Pour aller plus loin}
|
||||
|
||||
\subsection*{Applications avec plusieurs classes}
|
||||
|
||||
L'algorithme k-NN avec plusieurs classes est utilisé pour :
|
||||
\begin{itemize}
|
||||
\item \textbf{Reconnaissance de chiffres} : Classifier 0, 1, 2, ..., 9 (10 classes)
|
||||
\item \textbf{Classification de fleurs} : Différentes espèces (iris, rose, tulipe...)
|
||||
\item \textbf{Zonage géographique} : Micro-régions, quartiers, zones climatiques
|
||||
\item \textbf{Diagnostic médical} : Plusieurs types de maladies possibles
|
||||
\item \textbf{Reconnaissance vocale} : Identifier différents phonèmes ou mots
|
||||
\end{itemize}
|
||||
|
||||
\vspace{0.5cm}
|
||||
|
||||
\subsection*{Défis avec plusieurs classes}
|
||||
|
||||
\begin{enumerate}
|
||||
\item \textbf{Égalités plus fréquentes} : Avec 2 classes, égalité rare. Avec 5 classes, beaucoup plus probable !
|
||||
|
||||
\item \textbf{Choix de k important} : Si k est trop petit, risque de ne pas capturer la diversité. Si trop grand, perd la précision locale.
|
||||
|
||||
\item \textbf{Classes déséquilibrées} : Si une zone a beaucoup plus de points qu'une autre, elle sera sur-représentée.
|
||||
|
||||
\item \textbf{Frontières complexes} : Avec plusieurs zones, les frontières peuvent être très irrégulières.
|
||||
\end{enumerate}
|
||||
|
||||
\vspace{0.5cm}
|
||||
|
||||
\begin{tcolorbox}[colback=lightyellow,colframe=orange!75!black,title=\textbf{Question finale}]
|
||||
Pourquoi est-il préférable d'utiliser un \textit{k} impair lorsqu'on a un nombre pair de classes ?
|
||||
|
||||
\vspace{1cm}
|
||||
\underline{\hspace{14cm}}
|
||||
|
||||
\vspace{0.4cm}
|
||||
\underline{\hspace{14cm}}
|
||||
\end{tcolorbox}
|
||||
|
||||
\end{document}
|
||||
492
activite2/knn_microregions_animation.html
Normal file
492
activite2/knn_microregions_animation.html
Normal file
|
|
@ -0,0 +1,492 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>k-NN Animation - Micro-régions</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||||
margin: 0;
|
||||
padding: 20px;
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
background: white;
|
||||
border-radius: 15px;
|
||||
padding: 30px;
|
||||
box-shadow: 0 10px 30px rgba(0,0,0,0.3);
|
||||
}
|
||||
|
||||
h1 {
|
||||
text-align: center;
|
||||
color: #333;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
text-align: center;
|
||||
color: #666;
|
||||
margin-bottom: 30px;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
canvas {
|
||||
border: 2px solid #ddd;
|
||||
border-radius: 10px;
|
||||
display: block;
|
||||
margin: 20px auto;
|
||||
cursor: crosshair;
|
||||
background: #fafafa;
|
||||
}
|
||||
|
||||
.controls {
|
||||
background: #f5f5f5;
|
||||
padding: 20px;
|
||||
border-radius: 10px;
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
.control-group {
|
||||
margin: 15px 0;
|
||||
}
|
||||
|
||||
label {
|
||||
font-weight: bold;
|
||||
color: #555;
|
||||
display: block;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
input[type="range"] {
|
||||
width: 100%;
|
||||
height: 8px;
|
||||
border-radius: 5px;
|
||||
background: #ddd;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
input[type="range"]::-webkit-slider-thumb {
|
||||
appearance: none;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 50%;
|
||||
background: #667eea;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
input[type="range"]::-moz-range-thumb {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 50%;
|
||||
background: #667eea;
|
||||
cursor: pointer;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.value-display {
|
||||
display: inline-block;
|
||||
background: #667eea;
|
||||
color: white;
|
||||
padding: 5px 15px;
|
||||
border-radius: 20px;
|
||||
font-weight: bold;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.legend {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 20px;
|
||||
margin: 20px 0;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.legend-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 8px 15px;
|
||||
background: white;
|
||||
border-radius: 8px;
|
||||
border: 2px solid #ddd;
|
||||
}
|
||||
|
||||
.legend-circle {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 50%;
|
||||
border: 2px solid #333;
|
||||
}
|
||||
|
||||
.result {
|
||||
text-align: center;
|
||||
font-size: 1.5em;
|
||||
font-weight: bold;
|
||||
margin: 20px 0;
|
||||
padding: 20px;
|
||||
border-radius: 10px;
|
||||
background: #f0f0f0;
|
||||
}
|
||||
|
||||
.votes {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 15px;
|
||||
margin: 15px 0;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.vote-box {
|
||||
padding: 15px 20px;
|
||||
border-radius: 10px;
|
||||
text-align: center;
|
||||
min-width: 100px;
|
||||
border: 3px solid transparent;
|
||||
}
|
||||
|
||||
.vote-count {
|
||||
font-size: 2em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.vote-label {
|
||||
font-size: 0.9em;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.buttons {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
justify-content: center;
|
||||
margin: 20px 0;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
button {
|
||||
padding: 12px 24px;
|
||||
font-size: 16px;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
font-weight: bold;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 5px 15px rgba(0,0,0,0.2);
|
||||
}
|
||||
|
||||
.btn-reset {
|
||||
background: #f44336;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.btn-random {
|
||||
background: #4CAF50;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.instructions {
|
||||
background: #fff3cd;
|
||||
border-left: 4px solid #ffc107;
|
||||
padding: 15px;
|
||||
margin: 20px 0;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.instructions h3 {
|
||||
margin-top: 0;
|
||||
color: #856404;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>🎯 Animation k-NN : Classification multi-zones</h1>
|
||||
<p class="subtitle">Algorithme des k plus proches voisins avec plusieurs classes</p>
|
||||
|
||||
<div class="instructions">
|
||||
<h3>📋 Instructions</h3>
|
||||
<ul>
|
||||
<li><strong>Cliquez</strong> sur le graphique pour placer un nouveau point</li>
|
||||
<li><strong>Ajustez le curseur k</strong> pour voir l'impact du nombre de voisins</li>
|
||||
<li>Observez comment les <strong>votes</strong> se répartissent entre les zones</li>
|
||||
<li>Les lignes colorées montrent les <strong>k plus proches voisins</strong></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<canvas id="canvas" width="800" height="600"></canvas>
|
||||
|
||||
<div class="legend" id="legend"></div>
|
||||
|
||||
<div class="controls">
|
||||
<div class="control-group">
|
||||
<label>
|
||||
Nombre de voisins (k) :
|
||||
<span class="value-display" id="kValue">5</span>
|
||||
</label>
|
||||
<input type="range" id="kSlider" min="1" max="21" value="5" step="2">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="result" id="result">
|
||||
Cliquez sur le graphique pour classifier un point
|
||||
</div>
|
||||
|
||||
<div class="votes" id="votes"></div>
|
||||
|
||||
<div class="buttons">
|
||||
<button class="btn-random" onclick="placeRandomPoint()">🎲 Point Aléatoire</button>
|
||||
<button class="btn-reset" onclick="resetPoint()">🔄 Réinitialiser</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const canvas = document.getElementById('canvas');
|
||||
const ctx = canvas.getContext('2d');
|
||||
const kSlider = document.getElementById('kSlider');
|
||||
const kValue = document.getElementById('kValue');
|
||||
const result = document.getElementById('result');
|
||||
const votesDiv = document.getElementById('votes');
|
||||
const legendDiv = document.getElementById('legend');
|
||||
|
||||
// Définition des zones (micro-régions)
|
||||
const zones = [
|
||||
{ name: 'Alta Rocca', color: '#e74c3c', shortName: 'Alta Rocca' },
|
||||
{ name: 'Balagne', color: '#3498db', shortName: 'Balagne' },
|
||||
{ name: 'Centre Corse', color: '#2ecc71', shortName: 'Centre' },
|
||||
{ name: 'Extrême Sud', color: '#f39c12', shortName: 'Sud' },
|
||||
{ name: 'Cap Corse', color: '#9b59b6', shortName: 'Cap' }
|
||||
];
|
||||
|
||||
// Points d'apprentissage (générés automatiquement par zone)
|
||||
const trainingPoints = [];
|
||||
|
||||
// Zone 1 - Alta Rocca (rouge, bas gauche)
|
||||
for (let i = 0; i < 15; i++) {
|
||||
trainingPoints.push({
|
||||
x: 100 + Math.random() * 150,
|
||||
y: 400 + Math.random() * 150,
|
||||
zone: 0
|
||||
});
|
||||
}
|
||||
|
||||
// Zone 2 - Balagne (bleu, haut gauche)
|
||||
for (let i = 0; i < 15; i++) {
|
||||
trainingPoints.push({
|
||||
x: 100 + Math.random() * 150,
|
||||
y: 50 + Math.random() * 150,
|
||||
zone: 1
|
||||
});
|
||||
}
|
||||
|
||||
// Zone 3 - Centre Corse (vert, centre)
|
||||
for (let i = 0; i < 15; i++) {
|
||||
trainingPoints.push({
|
||||
x: 300 + Math.random() * 200,
|
||||
y: 200 + Math.random() * 200,
|
||||
zone: 2
|
||||
});
|
||||
}
|
||||
|
||||
// Zone 4 - Extrême Sud (jaune, bas droite)
|
||||
for (let i = 0; i < 15; i++) {
|
||||
trainingPoints.push({
|
||||
x: 550 + Math.random() * 150,
|
||||
y: 400 + Math.random() * 150,
|
||||
zone: 3
|
||||
});
|
||||
}
|
||||
|
||||
// Zone 5 - Cap Corse (violet, haut droite)
|
||||
for (let i = 0; i < 15; i++) {
|
||||
trainingPoints.push({
|
||||
x: 550 + Math.random() * 150,
|
||||
y: 50 + Math.random() * 150,
|
||||
zone: 4
|
||||
});
|
||||
}
|
||||
|
||||
let testPoint = null;
|
||||
let k = 5;
|
||||
|
||||
// Créer la légende
|
||||
function createLegend() {
|
||||
legendDiv.innerHTML = '';
|
||||
zones.forEach(zone => {
|
||||
const item = document.createElement('div');
|
||||
item.className = 'legend-item';
|
||||
item.innerHTML = `
|
||||
<div class="legend-circle" style="background: ${zone.color};"></div>
|
||||
<span>${zone.name}</span>
|
||||
`;
|
||||
legendDiv.appendChild(item);
|
||||
});
|
||||
}
|
||||
|
||||
function distance(p1, p2) {
|
||||
return Math.sqrt((p1.x - p2.x) ** 2 + (p1.y - p2.y) ** 2);
|
||||
}
|
||||
|
||||
function findKNearest(point, k) {
|
||||
const distances = trainingPoints.map(p => ({
|
||||
point: p,
|
||||
dist: distance(point, p)
|
||||
}));
|
||||
|
||||
distances.sort((a, b) => a.dist - b.dist);
|
||||
return distances.slice(0, k);
|
||||
}
|
||||
|
||||
function classify(point, k) {
|
||||
const nearest = findKNearest(point, k);
|
||||
const votes = {};
|
||||
|
||||
zones.forEach((_, idx) => votes[idx] = 0);
|
||||
|
||||
nearest.forEach(n => {
|
||||
votes[n.point.zone]++;
|
||||
});
|
||||
|
||||
// Trouver la zone avec le plus de votes
|
||||
let maxVotes = -1;
|
||||
let predictedZone = -1;
|
||||
|
||||
for (let zone in votes) {
|
||||
if (votes[zone] > maxVotes) {
|
||||
maxVotes = votes[zone];
|
||||
predictedZone = parseInt(zone);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
zone: predictedZone,
|
||||
votes: votes,
|
||||
nearest: nearest
|
||||
};
|
||||
}
|
||||
|
||||
function draw() {
|
||||
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
||||
|
||||
// Dessiner les points d'apprentissage
|
||||
trainingPoints.forEach(p => {
|
||||
ctx.beginPath();
|
||||
ctx.arc(p.x, p.y, 6, 0, 2 * Math.PI);
|
||||
ctx.fillStyle = zones[p.zone].color;
|
||||
ctx.fill();
|
||||
ctx.strokeStyle = '#333';
|
||||
ctx.lineWidth = 1;
|
||||
ctx.stroke();
|
||||
});
|
||||
|
||||
// Si un point test existe
|
||||
if (testPoint) {
|
||||
const classification = classify(testPoint, k);
|
||||
|
||||
// Dessiner les lignes vers les k plus proches voisins
|
||||
classification.nearest.forEach((n, index) => {
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(testPoint.x, testPoint.y);
|
||||
ctx.lineTo(n.point.x, n.point.y);
|
||||
ctx.strokeStyle = zones[n.point.zone].color;
|
||||
ctx.globalAlpha = 0.3 + 0.7 * (k - index) / k;
|
||||
ctx.lineWidth = 2;
|
||||
ctx.stroke();
|
||||
ctx.globalAlpha = 1;
|
||||
});
|
||||
|
||||
// Dessiner un cercle autour du k-ième plus proche voisin
|
||||
if (classification.nearest.length > 0) {
|
||||
const maxDist = classification.nearest[classification.nearest.length - 1].dist;
|
||||
ctx.beginPath();
|
||||
ctx.arc(testPoint.x, testPoint.y, maxDist, 0, 2 * Math.PI);
|
||||
ctx.strokeStyle = 'rgba(0, 0, 0, 0.2)';
|
||||
ctx.lineWidth = 2;
|
||||
ctx.setLineDash([5, 5]);
|
||||
ctx.stroke();
|
||||
ctx.setLineDash([]);
|
||||
}
|
||||
|
||||
// Dessiner le point test
|
||||
ctx.beginPath();
|
||||
ctx.arc(testPoint.x, testPoint.y, 12, 0, 2 * Math.PI);
|
||||
ctx.fillStyle = '#95a5a6';
|
||||
ctx.fill();
|
||||
ctx.strokeStyle = '#000';
|
||||
ctx.lineWidth = 3;
|
||||
ctx.stroke();
|
||||
|
||||
// Afficher le résultat
|
||||
displayResults(classification);
|
||||
}
|
||||
}
|
||||
|
||||
function displayResults(classification) {
|
||||
const zoneName = zones[classification.zone].name;
|
||||
const zoneColor = zones[classification.zone].color;
|
||||
|
||||
result.innerHTML = `Classification : <span style="color: ${zoneColor};">${zoneName}</span>`;
|
||||
result.style.background = zoneColor + '22';
|
||||
|
||||
// Afficher les votes
|
||||
votesDiv.innerHTML = '';
|
||||
zones.forEach((zone, idx) => {
|
||||
const voteBox = document.createElement('div');
|
||||
voteBox.className = 'vote-box';
|
||||
voteBox.style.background = zone.color + '22';
|
||||
voteBox.style.borderColor = classification.zone === idx ? zone.color : 'transparent';
|
||||
|
||||
const voteCount = classification.votes[idx] || 0;
|
||||
|
||||
voteBox.innerHTML = `
|
||||
<div class="vote-count" style="color: ${zone.color};">${voteCount}</div>
|
||||
<div class="vote-label">${zone.shortName}</div>
|
||||
`;
|
||||
votesDiv.appendChild(voteBox);
|
||||
});
|
||||
}
|
||||
|
||||
canvas.addEventListener('click', (e) => {
|
||||
const rect = canvas.getBoundingClientRect();
|
||||
testPoint = {
|
||||
x: e.clientX - rect.left,
|
||||
y: e.clientY - rect.top
|
||||
};
|
||||
draw();
|
||||
});
|
||||
|
||||
kSlider.addEventListener('input', (e) => {
|
||||
k = parseInt(e.target.value);
|
||||
kValue.textContent = k;
|
||||
draw();
|
||||
});
|
||||
|
||||
function placeRandomPoint() {
|
||||
testPoint = {
|
||||
x: Math.random() * (canvas.width - 100) + 50,
|
||||
y: Math.random() * (canvas.height - 100) + 50
|
||||
};
|
||||
draw();
|
||||
}
|
||||
|
||||
function resetPoint() {
|
||||
testPoint = null;
|
||||
result.innerHTML = 'Cliquez sur le graphique pour classifier un point';
|
||||
result.style.background = '#f0f0f0';
|
||||
votesDiv.innerHTML = '';
|
||||
draw();
|
||||
}
|
||||
|
||||
// Initialisation
|
||||
createLegend();
|
||||
draw();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue