public static ClassifierParams Create(ClassifierType type, ClassificationAlgorithmType algorithmType, string targetTag) { return new ClassifierParams { Type = type, TargetTag = targetTag, SamplingParams = new SamplingParams { NeedSampling = false }, ClassificationAlgorithmParams = new ClassificationAlgorithmParams { Type = algorithmType}, FeatureSelectionParams = new FeatureSelectionParams {Type = FeatureSelectorType.Unknown } }; }
public void FeatureSelectionExperiment(ClassificationAlgorithmType algorithmType, string targetTag, FeatureSelectorType featureSelectorType) { var classifierParamses = Enumerable .Range(1, 40) .Where(i => i <= 5 || i % 5 == 0) .Select(i => ClassifierParams .Create(ClassifierType.Simple, algorithmType, targetTag) .SelectFeatures(featureSelectorType, 0, i, 0, 1000)) .ToArray(); EvaluateManyClassifiers(classifierParamses, targetTag, x => string.Format("Selector {0} with selection percent {1}", x.FeatureSelectionParams.Type, x.FeatureSelectionParams.UpperBoundPercent)); }
public void FinalExam(ClassificationAlgorithmType algorithmType, string targetTag) { var problems = problemService.LoadAllDocumentsFromStorage(); var classifierParams = ClassifierParams .Create(ClassifierType.Simple, algorithmType, targetTag) .SelectFeatures(FeatureSelectorType.ChiSquared, 0, 10, 0, 1000); var overall = EvaluateSingle(problems, classifierParams, TestsCount, 60, DebugLevel.FullWithDump); PrintDelimeter(); Console.WriteLine(overall.FScore); }