internal static CommonOutputs.TransformOutput PercentileThresholdTransform(IHostEnvironment env, PercentileThresholdTransform.Arguments input) { var h = EntryPointUtils.CheckArgsAndCreateHost(env, "PercentileThresholdTransform", input); var view = new PercentileThresholdTransform(h, input, input.Data); return(new CommonOutputs.TransformOutput() { Model = new TransformModelImpl(h, view, input.Data), OutputData = view }); }
private protected override void TransformCore(ref Single input, FixedSizeQueue <Single> windowedBuffer, long iteration, ref Single dst) { int count; int equalCount; int totalCount; PercentileThresholdTransform.CountGreaterOrEqualValues(windowedBuffer, input, out count, out equalCount, out totalCount); count = (_parent._isPositiveSide) ? count : totalCount - count - equalCount; dst = (Single)((count + _randomGen.NextDouble() * equalCount) / (totalCount + 1)); // Based on the equation in http://arxiv.org/pdf/1204.3251.pdf }
private protected override void InitializeStateCore() { _parent = (PercentileThresholdTransform)ParentTransform; }