/// <summary>
        /// Skip <paramref name="count"/> rows in <paramref name="input"/>.
        /// </summary>
        /// <remarks>
        /// Skips the first <paramref name="count"/> rows from <paramref name="input"/> and returns an <see cref="IDataView"/> with all other rows.
        /// </remarks>
        /// <param name="input">The input data.</param>
        /// <param name="count">Number of rows to skip.</param>
        /// <example>
        /// <format type="text/markdown">
        /// <![CDATA[
        /// [!code-csharp[SkipRows](~/../docs/samples/docs/samples/Microsoft.ML.Samples/Dynamic/DataOperations/SkipRows.cs)]
        /// ]]>
        /// </format>
        /// </example>
        public IDataView SkipRows(IDataView input, long count)
        {
            Environment.CheckValue(input, nameof(input));
            Environment.CheckUserArg(count > 0, nameof(count), "Must be greater than zero.");

            var options = new SkipTakeFilter.SkipArguments()
            {
                Count = count
            };

            return(new SkipTakeFilter(Environment, options, input));
        }
Ejemplo n.º 2
0
        public static CommonOutputs.TransformOutput SkipFilter(IHostEnvironment env, SkipTakeFilter.SkipArguments input)
        {
            Contracts.CheckValue(env, nameof(env));
            var host = env.Register("SkipFilter");

            host.CheckValue(input, nameof(input));
            EntryPointUtils.CheckInputArgs(host, input);
            var xf = SkipTakeFilter.Create(host, input, input.Data);

            return(new CommonOutputs.TransformOutput {
                Model = new TransformModelImpl(env, xf, input.Data), OutputData = xf
            });
        }