Configuration#
All visual and algorithmic parameters live in
VisualizationConfig, a nested dataclass.
The default theme is DARK_SCIENTIFIC.
Structure#
VisualizationConfig
├── colors : ColorPalette — class colours, background, grid
├── render : RenderConfig — canvas size, opacity, marker size
└── projection : ProjectionConfig — method, scale_input, t-SNE / UMAP params
Fluent helpers#
The DARK_SCIENTIFIC singleton provides helpers that return a modified copy:
from geolatent import DARK_SCIENTIFIC
cfg = (
DARK_SCIENTIFIC
.with_method("tsne")
.with_title("My Figure")
.with_resolution(1400, 900)
.with_opacity(surface=0.3, scatter=0.9)
)
Manual configuration#
For full control, construct or copy the config and mutate its fields:
cfg = DARK_SCIENTIFIC.copy()
# Projection
cfg.projection.method = "sensitivity"
cfg.projection.scale_input = True
cfg.projection.sensitivity_n_subsample = 500
cfg.projection.tsne_perplexity = 40.0
cfg.projection.tsne_n_iter = 1000
# Rendering
cfg.render.width = 1200
cfg.render.height = 800
cfg.render.surface_opacity = 0.25
cfg.render.scatter_opacity = 0.95
cfg.render.marker_size = 4
Custom colour palette#
from geolatent.config.themes import ColorPalette, VisualizationConfig, RenderConfig, ProjectionConfig
my_colors = ColorPalette(
background="#0a0a0a",
grid="#1a1a2e",
text="#ffffff",
axis_line="#333366",
class_colors=["#e63946", "#457b9d", "#2a9d8f", "#e9c46a"],
annotation_color="#8888aa",
)
cfg = VisualizationConfig(
colors=my_colors,
render=RenderConfig(width=1100, height=750),
projection=ProjectionConfig(method="pca"),
)
ProjectionConfig reference#
Field |
Type |
Default |
Description |
|---|---|---|---|
|
str |
|
|
|
bool |
|
Standardise features before projection |
|
int |
|
Number of output dimensions |
|
float |
|
t-SNE perplexity |
|
int |
|
t-SNE iterations |
|
int |
|
UMAP neighbourhood size |
|
float |
|
UMAP minimum distance |
|
int |
|
Points used for Jacobian estimation |
|
float |
|
Finite-difference perturbation magnitude |