public TcFeatureSet getFeatureSet() { return new TcFeatureSet( TcFeatureFactory.create(WordNGram.class) ); }
public TcFeatureSet getFeatureSet() { return new TcFeatureSet( TcFeatureFactory.create(DiffNrOfTokensPairFeatureExtractor.class)); }
public TcFeatureSet getFeatureSet() { return new TcFeatureSet(TcFeatureFactory.create(CharacterNGram.class)); }
/** * Sets a new feature set * * @param features * an array of features which are added to the current features. If no features have * been set yet the feature set is initialized. */ public void setFeatures(TcFeature... features) { if (this.features == null) { this.features = new TcFeatureSet(features); } else { for (TcFeature f : features) { this.features.add(f); } } }
/** * Sets several features to be used in an experiment. If this method is used a single * {@link TcFeatureSet} is created in the background. If multiple feature sets shall be used use * {@link #featureSets(TcFeatureSet...)} Calling this method will remove all previously set * feature configurations * * @param features * one or more features * @return the builder object */ public ExperimentBuilder features(TcFeature... features) { if (features == null) { throw new NullPointerException("The features are null"); } this.featureSets = new ArrayList<>(); TcFeatureSet set = new TcFeatureSet(); for (TcFeature f : features) { set.add(f); } this.featureSets.add(set); return this; }
/** * Sets several features to be used in an experiment. If this method is used a * single {@link TcFeatureSet} is created in the background. If multiple feature * sets shall be used use {@link #featureSets(TcFeatureSet...)} Calling this * method will remove all previously set feature configurations * * @param features one or more features * @return the builder object */ public ExperimentBuilder features(TcFeature... features) { if (features == null) { throw new NullPointerException("The features are null"); } this.featureSets = new ArrayList<>(); TcFeatureSet set = new TcFeatureSet(); for (TcFeature f : features) { set.add(f); } this.featureSets.add(set); return this; }
public TcFeatureSet getFeatureSet() { return new TcFeatureSet(TcFeatureFactory.create(TokenRatioPerDocument.class), TcFeatureFactory.create(WordNGram.class, WordNGram.PARAM_NGRAM_USE_TOP_K, 600, WordNGram.PARAM_NGRAM_MIN_N, 1, WordNGram.PARAM_NGRAM_MAX_N, 3)); }
private static TcFeatureSet getFeatureSet() { return new TcFeatureSet("DummyFeatureSet", TcFeatureFactory.create(TokenRatioPerDocument.class), TcFeatureFactory.create(CharacterNGram.class, CharacterNGram.PARAM_NGRAM_USE_TOP_K, 500, CharacterNGram.PARAM_NGRAM_MIN_N, 1, CharacterNGram.PARAM_NGRAM_MAX_N, 3)); }
public TcFeatureSet getFeatureSet() { return new TcFeatureSet(TcFeatureFactory.create(TokenRatioPerDocument.class), TcFeatureFactory.create(CharacterNGram.class, CharacterNGram.PARAM_NGRAM_USE_TOP_K, 50)); }
public TcFeatureSet getFeatureSet() { return new TcFeatureSet(TcFeatureFactory.create(TokenRatioPerDocument.class), TcFeatureFactory.create(InitialCharacterUpperCase.class)); }
private static TcFeatureSet getFeatureNamesMinusOne(TcFeature[] names, int i) { TcFeatureSet nameList = new TcFeatureSet(names); nameList.setFeatureSetName(LEFTOUT_FE + names[i].getDiscriminatorValue()); nameList.remove(i); return nameList; }
public TcFeatureSet getFeatureSet() { return new TcFeatureSet(TcFeatureFactory.create(SentenceRatioPerDocument.class), TcFeatureFactory.create(LengthFeatureNominal.class), TcFeatureFactory.create(TokenRatioPerDocument.class)); }
/** * Returns a pre-defined dimension with feature extractor sets configured for an ablation test. * For example, if you specify four feature extractors A, B, C, and D, you will get [A,B,C,D], * [A,B,C], [A,B,D], [A,C,D], [B,C,D], * * @param features * All the feature extractors that should be tested. * @return a dimension with a list of feature extractor sets; named after the feature that is * left out */ public static Dimension<TcFeatureSet> getAblationTestFeatures(TcFeature... features) { TcFeatureSet[] featureSets = new TcFeatureSet[features.length + 1]; for (int i = 0; i < features.length; i++) { TcFeatureSet featureNamesMinusOne = getFeatureNamesMinusOne(features, i); featureSets[i] = featureNamesMinusOne; } // also add all features extractors featureSets[features.length] = new TcFeatureSet(features); Dimension<TcFeatureSet> dimFeatureSets = Dimension.create(Constants.DIM_FEATURE_SET, featureSets); return dimFeatureSets; }
private static TcFeatureSet getFeatureNamesMinusOne(TcFeature[] names, int i) { TcFeatureSet nameList = new TcFeatureSet(names); nameList.setFeatureSetName(LEFTOUT_FE + names[i].getDiscriminatorValue()); nameList.remove(i); return nameList; }
/** * Returns a pre-defined dimension with feature extractor sets configured for an ablation test. * For example, if you specify four feature extractors A, B, C, and D, you will get [A,B,C,D], * [A,B,C], [A,B,D], [A,C,D], [B,C,D], * * @param features * All the feature extractors that should be tested. * @return a dimension with a list of feature extractor sets; named after the feature that is * left out */ public static Dimension<TcFeatureSet> getAblationTestFeatures(TcFeature... features) { TcFeatureSet[] featureSets = new TcFeatureSet[features.length + 1]; for (int i = 0; i < features.length; i++) { TcFeatureSet featureNamesMinusOne = getFeatureNamesMinusOne(features, i); featureSets[i] = featureNamesMinusOne; } // also add all features extractors featureSets[features.length] = new TcFeatureSet(features); Dimension<TcFeatureSet> dimFeatureSets = Dimension.create(Constants.DIM_FEATURE_SET, featureSets); return dimFeatureSets; }
public static TcFeatureSet getDefaultFeatures(Classifier c) TcFeatureSet set = new TcFeatureSet();