コード例 #1
0
        /**
         * <summary> The operator method calls forward method which starts with having no feature in the model. In each iteration,
         * it keeps adding the features that are not currently listed.</summary>
         *
         * <param name="current">         FeatureSubset that will be added to new ArrayList.</param>
         * <param name="numberOfFeatures">Indicates the indices of indexList.</param>
         * <returns>ArrayList of FeatureSubSets created from forward.</returns>
         */
        protected override List <FeatureSubSet> Operator(FeatureSubSet current, int numberOfFeatures)
        {
            var result = new List <FeatureSubSet>();

            Forward(result, current, numberOfFeatures);
            return(result);
        }
コード例 #2
0
 /**
  * <summary> The backward method starts with all the features and removes the least significant feature at each iteration.</summary>
  *
  * <param name="currentSubSetList">List to add the FeatureSubsets.</param>
  * <param name="current">          FeatureSubset that will be added to currentSubSetList</param>
  */
 protected void Backward(List <FeatureSubSet> currentSubSetList, FeatureSubSet current)
 {
     for (var i = 0; i < current.Size(); i++)
     {
         var candidate = (FeatureSubSet)current.Clone();
         candidate.Remove(i);
         currentSubSetList.Add(candidate);
     }
 }
コード例 #3
0
 /**
  * <summary> The forward method starts with having no feature in the model. In each iteration, it keeps adding the features that are not currently listed.</summary>
  *
  * <param name="currentSubSetList">List to add the FeatureSubsets.</param>
  * <param name="current">          FeatureSubset that will be added to currentSubSetList.</param>
  * <param name="numberOfFeatures"> The number of features to add the subset.</param>
  */
 protected void Forward(List <FeatureSubSet> currentSubSetList, FeatureSubSet current, int numberOfFeatures)
 {
     for (var i = 0; i < numberOfFeatures; i++)
     {
         if (!current.Contains(i))
         {
             var candidate = (FeatureSubSet)current.Clone();
             candidate.Add(i);
             currentSubSetList.Add(candidate);
         }
     }
 }
コード例 #4
0
 /**
  * <summary> A constructor that sets the initial subset with given input.</summary>
  *
  * <param name="initialSubSet">{@link FeatureSubSet} input.</param>
  */
 public SubSetSelection(FeatureSubSet initialSubSet)
 {
     this.initialSubSet = initialSubSet;
 }
コード例 #5
0
 protected abstract List <FeatureSubSet> Operator(FeatureSubSet current, int numberOfFeatures);