private RoleMappedSchema(Schema schema, Dictionary <string, IReadOnlyList <ColumnInfo> > map) { Contracts.AssertValue(schema); Contracts.AssertValue(map); Schema = schema; _map = map; foreach (var kvp in _map) { Contracts.Assert(Utils.Size(kvp.Value) > 0); var cols = kvp.Value; #if DEBUG foreach (var info in cols) { Contracts.Assert(!schema.IsHidden(info.Index), "How did a hidden column sneak in?"); } #endif if (cols.Count == 1) { switch (kvp.Key) { case FeatureString: Feature = cols[0]; break; case LabelString: Label = cols[0]; break; case GroupString: Group = cols[0]; break; case WeightString: Weight = cols[0]; break; case NameString: Name = cols[0]; break; } } } }