public static ClassificationModel Read(string filePath)
        {
            Stream              stream     = File.Open(filePath, FileMode.Open);
            BinaryFormatter     bFormatter = new BinaryFormatter();
            ClassificationModel m          = (ClassificationModel)bFormatter.Deserialize(stream);

            stream.Close();
            return(m);
        }
        public ClassificationModel[] Train(BaseVector[] x, int[][] y, int ngroups, int[] rankedFeatures,
			IGroupDataProvider data)
        {
            int[] o = ranker.Rank(x, y, ngroups, rankerParam, data, 1); //TODO
            Array.Copy(o, rankedFeatures, o.Length);
            int[] sizes = GetSizes(x[0].Length, reductionFactor, maxFeatures);
            ClassificationModel[] result = new ClassificationModel[sizes.Length];
            for (int i = 0; i < result.Length; i++){
                if (i == 0 && sizes[0] == x[0].Length){
                    result[0] = classifier.Train(x, y, ngroups, classifierParam, 1);
                } else{
                    int[] inds = ArrayUtils.SubArray(o, sizes[i]);
                    result[i] =
                        new ClassificationOnSubFeatures(
                            classifier.Train(ClassificationWithRanking.ExtractFeatures(x, inds), y, ngroups, classifierParam, 1), inds);
                }
            }
            return result;
        }
 public GroupWiseClassifier(ClassificationModel[] classifiers)
 {
     this.classifiers = classifiers;
 }
 public ClassificationOnSubFeatures(ClassificationModel classifier, int[] featureInds)
 {
     this.classifier = classifier;
     this.featureInds = featureInds;
 }
        public ClassificationModel TrainGroupWise(BaseVector[] x, int[][] y, int ngroups, IGroupDataProvider data,
			int nthreads)
        {
            ClassificationModel[] c = new ClassificationModel[ngroups];
            ThreadDistributor td = new ThreadDistributor(nthreads, ngroups, i => { c[i] = TrainGroupWise(i, y, x, data); });
            td.Start();
            return new GroupWiseClassifier(c);
        }