コード例 #1
0
            /// <summary>
            ///   Constructs a new Options object for the given column.
            /// </summary>
            ///
            /// <param name="name">The name of the column to create this options for.</param>
            /// <param name="variableType">The type of the variable in the column.</param>
            /// <param name="baseline">The baseline value to be used in conjunction with
            ///   <see cref="CodificationVariable.CategoricalWithBaseline"/>. The baseline
            ///   value will be treated as absolute zero in a otherwise one-hot representation.</param>
            ///
            ///
            public Options(String name, CodificationVariable variableType, T baseline)
                : this(name, variableType)
            {
                if (variableType != CodificationVariable.CategoricalWithBaseline)
                {
                    throw new ArgumentException("A 'baseline' can only be specified when 'variableType' is CodificationVariable.CategoricalWithBaseline.");
                }

                this.Mapping[baseline] = 0;
            }
コード例 #2
0
            /// <summary>
            ///   Constructs a new Options object for the given column.
            /// </summary>
            ///
            /// <param name="name">The name of the column to create this options for.</param>
            /// <param name="variableType">The type of the variable in the column.</param>
            /// <param name="order">The order of the variables in the mapping. The first variable
            ///   will be assigned to position (symbol) 1, the second to position 2, and so on.</param>
            ///
            public Options(String name, CodificationVariable variableType, params T[] order)
                : this(name, variableType)
            {
                if (variableType != CodificationVariable.Categorical && variableType != CodificationVariable.CategoricalWithBaseline && variableType != CodificationVariable.Ordinal)
                {
                    throw new ArgumentException("An 'order' can only be specified when 'variableType' is ordinal, categorical, or categorical with baseline.");
                }

                if (variableType == CodificationVariable.Discrete || variableType == CodificationVariable.Continuous)
                {
                    throw new Exception("Invalid variable type: " + variableType);
                }

                for (int i = 0; i < order.Length; i++)
                {
                    this.Mapping[order[i]] = i;
                }
            }
コード例 #3
0
 /// <summary>
 ///   Add a new column options definition with the given variable type to the collection.
 /// </summary>
 ///
 public void Add(CodificationVariable variableType)
 {
     this.Add(new Options(this.Columns.Count.ToString(), variableType));
 }
コード例 #4
0
 /// <summary>
 ///   Constructs a new Options object for the given column.
 /// </summary>
 ///
 /// <param name="name">The name of the column to create this options for.</param>
 /// <param name="variableType">The type of the variable in the column.</param>
 ///
 public Options(String name, CodificationVariable variableType)
     : this(name)
 {
     this.VariableType = variableType;
 }
コード例 #5
0
 /// <summary>
 /// Adds a new <see cref="Options">column options</see> to this filter's collection,
 /// specifying how a particular column should be processed by the filter..
 /// </summary>
 ///
 /// <param name="name">The name of the variable to added.</param>
 /// <param name="codificationVariable">The type of the variable to be added.</param>
 ///
 public void Add(string name, CodificationVariable codificationVariable)
 {
     this.Add(new Options(name, codificationVariable));
 }