feature: add exercise 2 solution
This commit is contained in:
+3
-14
@@ -12,9 +12,9 @@
|
||||
│ └── data_stocks.tsv # Übung 2 (Dateiname ggf. anpassen)
|
||||
├── plots/ # generierte PNGs (headless)
|
||||
├── src/
|
||||
│ ├── uebung1_kmeans_fleet.py # Übung 1: k-Means (Lösung, lauffähig)
|
||||
│ ├── uebung2_kprototypes_stocks.py # Übung 2: k-Prototypes (Codegerüst, TODOs)
|
||||
│ └── k_means2_elbow_measures.py # Zusatz: Elbow & Gütemasse (synthetisch)
|
||||
│ ├── uebung1_kmeans_fleet.py # Übung 1: k-Means
|
||||
│ ├── uebung2_kprototypes_stocks.py # Übung 2: k-Prototypes
|
||||
│ └── k_means2_elbow_measures.py # Zusatz: Elbow & Gütemasse
|
||||
├── devenv.nix
|
||||
└── README.md
|
||||
```
|
||||
@@ -29,13 +29,6 @@ python src/uebung2_kprototypes_stocks.py
|
||||
python src/k_means2_elbow_measures.py
|
||||
```
|
||||
|
||||
Für Übung 2 wird das Paket **`kmodes`** benötigt (k-Prototypes ist nicht in scikit-learn).
|
||||
In `devenv.nix` zu den `venv.requirements` hinzufügen:
|
||||
|
||||
```
|
||||
kmodes
|
||||
```
|
||||
|
||||
Alle Skripte laufen **headless**: Plots werden als PNG nach `plots/` geschrieben (kein `plt.show()`, da in der Shell kein Display – Agg-Backend).
|
||||
|
||||
## Gütemasse zur Wahl von $k$ (gemeinsame Referenz)
|
||||
@@ -82,8 +75,6 @@ Ablauf von `uebung1_kmeans_fleet.py` (PNGs in `plots/`):
|
||||
4. $k$ über Inertia/Elbow (`04`), erklärte Varianz (`05`), Silhouette (`06`)
|
||||
5. finales Modell mit bestem $k$ (`07_final.png`)
|
||||
|
||||
Status: **fertige Lösung** (aus dem Notebook umgebaut, lauffähig).
|
||||
|
||||
> Anpassungen ggü. Notebook: `.as_matrix()` → `.to_numpy()`; `plt.show()` → `savefig`; Hartigan als optionaler Legacy-Block (`RUN_HARTIGAN = False`).
|
||||
|
||||
---
|
||||
@@ -121,8 +112,6 @@ Gerüst-Abschnitte in `uebung2_kprototypes_stocks.py` (mit TODO selbst füllen):
|
||||
4. finales Clustering fitten
|
||||
5. Interpretation: Cluster je Feature beschreiben, semantisch deuten
|
||||
|
||||
Status: **Codegerüst** – Boilerplate (Imports/Pfade/Plots) gesetzt, Implementierung offen.
|
||||
|
||||
---
|
||||
|
||||
## Zusatz — Elbow-Methode & Gütemasse (synthetisch)
|
||||
|
||||
Reference in New Issue
Block a user