@Override protected WeightedVotingCategorizerEnsemble<InputType, CategoryType, Evaluator<? super InputType, ? extends CategoryType>> createInitialEnsemble() { final Set<CategoryType> categories = DatasetUtil.findUniqueOutputs(this.getData()); return new WeightedVotingCategorizerEnsemble<InputType, CategoryType, Evaluator<? super InputType, ? extends CategoryType>>( categories); }
@Override protected boolean initializeAlgorithm() { boolean result = super.initializeAlgorithm(); if (result) { // Map each category to a list of indices for it. final int dataSize = this.dataList.size(); final Set<CategoryType> categories = DatasetUtil.findUniqueOutputs( this.dataList); this.categoryList = new ArrayList<CategoryType>(categories); this.dataPerCategory = new LinkedHashMap<CategoryType, ArrayList<Integer>>( categories.size()); for (CategoryType category : categories) { this.dataPerCategory.put(category, new ArrayList<Integer>()); } for (int i = 0; i < dataSize; i++) { final CategoryType category = this.dataList.get(i).getOutput(); this.dataPerCategory.get(category).add(i); } } return result; }
@Override protected boolean initializeAlgorithm() { boolean result = super.initializeAlgorithm(); if (result) { // Map each category to a list of indices for it. final int dataSize = this.dataList.size(); final Set<CategoryType> categories = DatasetUtil.findUniqueOutputs( this.dataList); this.categoryList = new ArrayList<CategoryType>(categories); this.dataPerCategory = new LinkedHashMap<CategoryType, ArrayList<Integer>>( categories.size()); for (CategoryType category : categories) { this.dataPerCategory.put(category, new ArrayList<Integer>()); } for (int i = 0; i < dataSize; i++) { final CategoryType category = this.dataList.get(i).getOutput(); this.dataPerCategory.get(category).add(i); } } return result; }
@Override protected boolean initializeAlgorithm() { boolean result = super.initializeAlgorithm(); if (result) { // Map each category to a list of indices for it. final int dataSize = this.dataList.size(); final Set<CategoryType> categories = DatasetUtil.findUniqueOutputs( this.dataList); this.categoryList = new ArrayList<CategoryType>(categories); this.dataPerCategory = new LinkedHashMap<CategoryType, ArrayList<Integer>>( categories.size()); for (CategoryType category : categories) { this.dataPerCategory.put(category, new ArrayList<Integer>()); } for (int i = 0; i < dataSize; i++) { final CategoryType category = this.dataList.get(i).getOutput(); this.dataPerCategory.get(category).add(i); } } return result; }
@Override protected WeightedVotingCategorizerEnsemble<InputType, CategoryType, Evaluator<? super InputType, ? extends CategoryType>> createInitialEnsemble() { final Set<CategoryType> categories = DatasetUtil.findUniqueOutputs(this.getData()); return new WeightedVotingCategorizerEnsemble<InputType, CategoryType, Evaluator<? super InputType, ? extends CategoryType>>( categories); }
@Override protected WeightedVotingCategorizerEnsemble<InputType, CategoryType, Evaluator<? super InputType, ? extends CategoryType>> createInitialEnsemble() { final Set<CategoryType> categories = DatasetUtil.findUniqueOutputs(this.getData()); return new WeightedVotingCategorizerEnsemble<InputType, CategoryType, Evaluator<? super InputType, ? extends CategoryType>>( categories); }
DatasetUtil.findUniqueOutputs(this.data));
DatasetUtil.findUniqueOutputs(this.data));
DatasetUtil.findUniqueOutputs(this.data));
DatasetUtil.findUniqueOutputs(data); final int categoryCount = categories.size(); final ArrayList<CategoryType> categoriesList =
DatasetUtil.findUniqueOutputs(data); final int categoryCount = categories.size(); final ArrayList<CategoryType> categoriesList =
DatasetUtil.findUniqueOutputs(data); final int categoryCount = categories.size(); final ArrayList<CategoryType> categoriesList =
final Set<CategoryType> categories = DatasetUtil.findUniqueOutputs( this.weightedData); this.ensemble = new WeightedVotingCategorizerEnsemble<InputType, CategoryType, Evaluator<? super InputType, ? extends CategoryType>>(
final Set<CategoryType> categories = DatasetUtil.findUniqueOutputs( this.weightedData); this.ensemble = new WeightedVotingCategorizerEnsemble<InputType, CategoryType, Evaluator<? super InputType, ? extends CategoryType>>(
final Set<CategoryType> categories = DatasetUtil.findUniqueOutputs( this.weightedData); this.ensemble = new WeightedVotingCategorizerEnsemble<InputType, CategoryType, Evaluator<? super InputType, ? extends CategoryType>>(
@Override protected boolean initializeAlgorithm() { if (CollectionUtil.isEmpty(this.getData())) { // No data to learn from. return false; } // Get the dimensionality of the data. final int dimensionality = DatasetUtil.getInputDimensionality( this.getData()); // Create the categorizer we will learn and create the prototypes for // each category. this.result = new LinearMultiCategorizer<CategoryType>(); final Set<CategoryType> categories = DatasetUtil.findUniqueOutputs( this.getData()); for (CategoryType category : categories) { final LinearBinaryCategorizer prototype = new LinearBinaryCategorizer( this.getVectorFactory().createVector(dimensionality), 0.0); this.result.getPrototypes().put(category, prototype); } // The algorithm is now initialized. return true; }
@Override protected boolean initializeAlgorithm() { if (CollectionUtil.isEmpty(this.getData())) { // No data to learn from. return false; } // Get the dimensionality of the data. final int dimensionality = DatasetUtil.getInputDimensionality( this.getData()); // Create the categorizer we will learn and create the prototypes for // each category. this.result = new LinearMultiCategorizer<CategoryType>(); final Set<CategoryType> categories = DatasetUtil.findUniqueOutputs( this.getData()); for (CategoryType category : categories) { final LinearBinaryCategorizer prototype = new LinearBinaryCategorizer( this.getVectorFactory().createVector(dimensionality), 0.0); this.result.getPrototypes().put(category, prototype); } // The algorithm is now initialized. return true; }
@Override protected boolean initializeAlgorithm() { if (CollectionUtil.isEmpty(this.getData())) { // No data to learn from. return false; } // Get the dimensionality of the data. final int dimensionality = DatasetUtil.getInputDimensionality( this.getData()); // Create the categorizer we will learn and create the prototypes for // each category. this.result = new LinearMultiCategorizer<CategoryType>(); final Set<CategoryType> categories = DatasetUtil.findUniqueOutputs( this.getData()); for (CategoryType category : categories) { final LinearBinaryCategorizer prototype = new LinearBinaryCategorizer( this.getVectorFactory().createVector(dimensionality), 0.0); this.result.getPrototypes().put(category, prototype); } // The algorithm is now initialized. return true; }