public TrainModel(FeatureExtractionType eType, int EuclideanCentroidPointIndex, ClassifierType cType) { this.cType = cType; Trained = false; if (eType == FeatureExtractionType.EuclideanDistance) featureExtraction = new EuclideanDistance(EuclideanCentroidPointIndex); }
public TrainModel(FeatureExtractionType eType, ClassifierType cType) { this.cType = cType; Trained = false; if (eType == FeatureExtractionType.EuclideanDistance) featureExtraction = new EuclideanDistance(14); }
/// <summary> /// Extracts features from the doc specified. /// </summary> /// <param name="doc">The document.</param> /// <param name="docs">The docs to use to compare.</param> /// <param name="featureCount">The number of features/terms to return.</param> /// <param name="language">The language/extraction algorithm to use.</param> /// <returns>The important features/terms of the doc.</returns> public string[] Extract(Document doc, Document[] docs, int featureCount, FeatureExtractionType language) { if (!Extractors.TryGetValue(language, out var Extractor)) { return(Array.Empty <string>()); } return(Extractor.Extract(doc, docs, featureCount)); }
public TrainModel(FeatureExtractionType eType, int EuclideanCentroidPointIndex, ClassifierType cType) { this.cType = cType; Trained = false; if (eType == FeatureExtractionType.EuclideanDistance) { featureExtraction = new EuclideanDistance(EuclideanCentroidPointIndex); } }
public TrainModel(FeatureExtractionType eType, ClassifierType cType) { this.cType = cType; Trained = false; if (eType == FeatureExtractionType.EuclideanDistance) { featureExtraction = new EuclideanDistance(14); } }
public KFoldCrossValidation(List <Data> data, int k_fold, ClassifierType cType, FeatureExtractionType fType, int K = 3) { Kfold = k_fold; this.K = K; this.cType = cType; this.fType = fType; Data = data; r = new Random(); chunckSize = new List <int>(Kfold); for (int i = 0; i < Kfold - 1; ++i) { chunckSize.Add(Data.Count / Kfold); } chunckSize.Add(Data.Count - ((Kfold - 1) * (Data.Count / Kfold))); }
/// <summary> /// Gets the topics important in this document /// </summary> /// <param name="comparisonDocuments">The comparison documents.</param> /// <param name="featureCount">The feature count.</param> /// <param name="featureExtractionType">Type of the feature extraction.</param> /// <returns>The features/topics important in this document.</returns> public string[] GetFeatures(Document[] comparisonDocuments, int featureCount, FeatureExtractionType featureExtractionType) { return(FeatureExtractor.Extract(this, comparisonDocuments, featureCount, featureExtractionType)); }