vote = (res, data) -> async.series [ (next) -> Case.findOne { caseId: data.id }, next (next) -> myvote = new Vote({case: mycase_id}).save(next) ], (err, result) -> if err console.error err else console.log "Success!"
/** * Aggregate an object with this one * * @param toAggregate the object to aggregate * @return the result of aggregation * @throws Exception if the supplied object can't be aggregated for some * reason */ @Override public Classifier aggregate(Classifier toAggregate) throws Exception { if (m_structure == null && m_Classifiers.length == 1 && (m_Classifiers[0] instanceof weka.classifiers.rules.ZeroR)) { // remove the single untrained ZeroR setClassifiers(new Classifier[0]); } // Can't do any training data compatibility checks unfortunately addPreBuiltClassifier(toAggregate); return this; }
/** * Main method for testing this class. * * @param argv should contain the following arguments: -t training file [-T * test file] [-c class index] */ public static void main(String[] argv) { runClassifier(new Vote(), argv); }
result = distributionForInstanceAverage(instance); break; case PRODUCT_RULE: result = distributionForInstanceProduct(instance); break; case MAJORITY_VOTING_RULE: result = distributionForInstanceMajorityVoting(instance); break; case MIN_RULE: result = distributionForInstanceMin(instance); break; case MAX_RULE: result = distributionForInstanceMax(instance); break; case MEDIAN_RULE: result[0] = classifyInstance(instance); break; default:
JSONArray jsonArray = jObject.getJSONArray("posts"); for(int i=0; i<jsonArray.length(); i++){ Vote vote = new Vote(); vote.setDeviceId(jsonArray.getJSONObject(i).getString("DeviceId")); vote.setName(jsonArray.getJSONObject(i).getString("FullName")); vote.setRate(jsonArray.getJSONObject(i).getString("Rate")); vote.setComment(jsonArray.getJSONObject(i).getString("Comment")); vote.setPublishDate(jsonArray.getJSONObject(i).getString("PublishTime"));
case MIN_RULE: case MAX_RULE: dist = distributionForInstance(instance); if (instance.classAttribute().isNominal()) { index = Utils.maxIndex(dist); result = classifyInstanceMedian(instance); break; default:
probs = getClassifier(i).distributionForInstance(instance); int maxIndex = 0; for (int j = 0; j < probs.length; j++) { if (majorityIndexes.size() > 1) { double[] distPreds = distributionForInstanceAverage(instance); majorityIndex = Utils.maxIndex(distPreds);
addPreBuiltClassifier((Classifier) c);
result = distributionForInstanceAverage(instance); break; case PRODUCT_RULE: result = distributionForInstanceProduct(instance); break; case MAJORITY_VOTING_RULE: result = distributionForInstanceMajorityVoting(instance); break; case MIN_RULE: result = distributionForInstanceMin(instance); break; case MAX_RULE: result = distributionForInstanceMax(instance); break; case MEDIAN_RULE: result[0] = classifyInstance(instance); break; default:
/** * Main method for testing this class. * * @param argv should contain the following arguments: -t training file [-T * test file] [-c class index] */ public static void main(String[] argv) { runClassifier(new Vote(), argv); }
case MIN_RULE: case MAX_RULE: dist = distributionForInstance(instance); if (instance.classAttribute().isNominal()) { index = Utils.maxIndex(dist); result = classifyInstanceMedian(instance); break; default:
probs = getClassifier(i).distributionForInstance(instance); int maxIndex = 0; for (int j = 0; j < probs.length; j++) { if (majorityIndexes.size() > 1) { double[] distPreds = distributionForInstanceAverage(instance); majorityIndex = Utils.maxIndex(distPreds);
addPreBuiltClassifier((Classifier) c);
/** Creates a default Vote */ public Classifier getClassifier() { return new Vote(); }
/** * Aggregate an object with this one * * @param toAggregate the object to aggregate * @return the result of aggregation * @throws Exception if the supplied object can't be aggregated for some * reason */ @Override public Classifier aggregate(Classifier toAggregate) throws Exception { if (m_structure == null && m_Classifiers.length == 1 && (m_Classifiers[0] instanceof weka.classifiers.rules.ZeroR)) { // remove the single untrained ZeroR setClassifiers(new Classifier[0]); } // Can't do any training data compatibility checks unfortunately addPreBuiltClassifier(toAggregate); return this; }
/** Creates a default Vote */ public Classifier getClassifier() { return new Vote(); }
: batchPredictors ? new BatchPredictorVote() : new Vote();