ct-tranchau commited on
Commit
322ebce
·
verified ·
1 Parent(s): 47c4bf8

RootScope v4: manuscript model (LightGBM per round, 3 seeds, layer + soft-neighbor context, radial prior)

Browse files
Files changed (1) hide show
  1. rootscope/classify_v4.py +7 -0
rootscope/classify_v4.py CHANGED
@@ -67,6 +67,13 @@ def classify(df_base, masks, source_file="image.tif", model_dir=None, seeds=None
67
  ctx.MASK = "<in-memory>"
68
  ctx.CL = CLASSES
69
 
 
 
 
 
 
 
 
70
  missing = [c for c in fcols if c not in geom.columns
71
  and c not in ctx.RINGCOLS and not c.startswith(("nbp_", "agree_"))]
72
  if missing:
 
67
  ctx.MASK = "<in-memory>"
68
  ctx.CL = CLASSES
69
 
70
+ # The 4 nearest-neighbour cell-type columns are model inputs that exist only
71
+ # as placeholders before round 1 (-1 = unknown); stage_features does not
72
+ # produce them, so create them here. fill_neighbors overwrites them from round 2.
73
+ for c in _eh.NEIGHBOR_CT_COLS:
74
+ if c not in geom.columns:
75
+ geom[c] = -1.0
76
+
77
  missing = [c for c in fcols if c not in geom.columns
78
  and c not in ctx.RINGCOLS and not c.startswith(("nbp_", "agree_"))]
79
  if missing: