Pattern: vegetation-management imagery
Energy / utilities — vegetation-management imagery pattern. Stratified accuracy by season, variant comparison, daily continuous evaluation in fire season.
Last updated
Was this helpful?
Was this helpful?
# Python (SDK)
from layerlens import Stratix
client = Stratix()
seasonal_disparity = client.scorers.create_code(
name="seasonal-disparity",
code="""
winter_acc = mean(score for trace, score in zip(traces, scores) if trace.tags['season'] == 'winter')
summer_acc = mean(score for trace, score in zip(traces, scores) if trace.tags['season'] == 'summer')
result = {'passed': abs(winter_acc - summer_acc) <= 0.05, 'gap': summer_acc - winter_acc}
""",
)
trace_eval = client.trace_evaluations.create(
trace_set={"tags": {"feature": "vegetation-management"}, "sample_rate": 0.01},
scorers=[seasonal_disparity.id, hazard_classifier_scorer_id],
schedule="daily",
)// TypeScript (REST)
const r = await fetch("https://stratix.layerlens.ai/api/v1/trace-evaluations", {
method: "POST",
headers: {
"X-API-Key": process.env.LAYERLENS_STRATIX_API_KEY!,
"Content-Type": "application/json",
},
body: JSON.stringify({
trace_set: { tags: { feature: "vegetation-management" }, sample_rate: 0.01 },
scorers: [seasonalDisparityId, hazardClassifierId],
schedule: "daily",
}),
});