Spaces:
Sleeping
Sleeping
| from fastapi import APIRouter | |
| router = APIRouter(tags=["presets"]) | |
| def list_algorithms(): | |
| return { | |
| "algorithms": [ | |
| {"key": "kmeans", "label": "KMeans", "params": {"n_clusters": 4}}, | |
| {"key": "mini_batch_kmeans", "label": "MiniBatchKMeans", "params": {"n_clusters": 4, "batch_size": 1024}}, | |
| {"key": "agglomerative", "label": "Agglomerative", "params": {"n_clusters": 4}}, | |
| {"key": "birch", "label": "Birch", "params": {"n_clusters": 4, "threshold": 0.5}}, | |
| {"key": "dbscan", "label": "DBSCAN", "params": {"eps": 0.5, "min_samples": 5}}, | |
| {"key": "optics", "label": "OPTICS", "params": {"min_samples": 5}}, | |
| {"key": "mean_shift", "label": "Mean Shift", "params": {}}, | |
| {"key": "spectral", "label": "Spectral Clustering", "params": {"n_clusters": 4, "affinity": "nearest_neighbors"}}, | |
| {"key": "gaussian_mixture", "label": "Gaussian Mixture", "params": {"n_components": 4}}, | |
| {"key": "affinity_propagation", "label": "Affinity Propagation", "params": {}}, | |
| {"key": "bisecting_kmeans", "label": "Bisecting KMeans", "params": {"n_clusters": 4}}, | |
| {"key": "hdbscan", "label": "HDBSCAN", "params": {"min_cluster_size": 10, "min_samples": 5}} | |
| ] | |
| } | |