private protected OneToOneTransformBase(IHost host, OneToOneColumn[] column, IDataView input, Func <DataViewType, string> testType) : base(host, input) { Host.CheckUserArg(Utils.Size(column) > 0, nameof(column)); Host.CheckValueOrNull(testType); InputTranspose = Source as ITransposeDataView; _bindings = Bindings.Create(this, column, Source.Schema, InputTranspose, testType); Infos = _bindings.Infos; Metadata = new MetadataDispatcher(Infos.Length); }
private protected OneToOneTransformBase(IHost host, ModelLoadContext ctx, IDataView input, Func <DataViewType, string> testType) : base(host, input) { Host.CheckValue(ctx, nameof(ctx)); Host.CheckValueOrNull(testType); InputTranspose = Source as ITransposeDataView; _bindings = Bindings.Create(this, ctx, Source.Schema, InputTranspose, testType); Infos = _bindings.Infos; Metadata = new MetadataDispatcher(Infos.Length); }
/// <summary> /// This should really be private to MetadataDispatcher, but C#'s accessibility model doesn't /// allow restricting to an outer class. /// </summary> internal Builder(MetadataDispatcher md, int index, DataViewSchema schemaSrc = null, int indexSrc = -1, Func <string, int, bool> filterSrc = null) { Contracts.CheckValue(md, nameof(md)); Contracts.CheckParam(0 <= index && index < md.ColCount, nameof(index)); _index = index; _md = md; _info = _md.CreateInfo(schemaSrc, indexSrc, filterSrc); var tmp = _md.GetColInfoOrNull(_index); Contracts.Check(tmp == null, "Duplicate building of metadata"); }
private protected OneToOneTransformBase(IHostEnvironment env, string name, OneToOneTransformBase transform, IDataView newInput, Func <DataViewType, string> checkType) : base(env, name, newInput) { Host.CheckValueOrNull(checkType); InputTranspose = Source as ITransposeDataView; OneToOneColumn[] map = transform.Infos .Select(x => new ColumnTmp { Name = x.Name, Source = transform.Source.Schema[x.Source].Name, }) .ToArray(); _bindings = Bindings.Create(this, map, newInput.Schema, InputTranspose, checkType); Infos = _bindings.Infos; Metadata = new MetadataDispatcher(Infos.Length); }