Fix line comments indentation
Project: http://git-wip-us.apache.org/repos/asf/incubator-samoa/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-samoa/commit/b79e92bd Tree: http://git-wip-us.apache.org/repos/asf/incubator-samoa/tree/b79e92bd Diff: http://git-wip-us.apache.org/repos/asf/incubator-samoa/diff/b79e92bd Branch: refs/heads/master Commit: b79e92bdb09f73de9c06c97318ed49cadab7b67a Parents: 5543ecd Author: Matthieu Morel <[email protected]> Authored: Mon Feb 2 18:43:31 2015 +0100 Committer: Matthieu Morel <[email protected]> Committed: Mon Feb 2 18:43:31 2015 +0100 ---------------------------------------------------------------------- .../measures/SilhouetteCoefficient.java | 3 +-- .../ensemble/BaggingDistributorProcessor.java | 3 +-- .../classifiers/rules/AMRulesRegressor.java | 3 +-- .../rules/HorizontalAMRulesRegressor.java | 3 +-- .../rules/VerticalAMRulesRegressor.java | 3 +-- .../centralized/AMRulesRegressorProcessor.java | 3 +-- .../classifiers/rules/common/Perceptron.java | 9 +++------ .../learners/classifiers/rules/common/Rule.java | 14 ++------------ .../rules/common/RuleActiveRegressionNode.java | 3 +-- .../rules/common/RulePassiveRegressionNode.java | 3 +-- .../rules/common/RuleRegressionNode.java | 3 +-- .../distributed/AMRDefaultRuleProcessor.java | 3 +-- .../distributed/AMRulesAggregatorProcessor.java | 3 +-- .../distributed/PredicateContentEvent.java | 3 +-- .../rules/distributed/RuleContentEvent.java | 3 +-- ...NumericAttributeClassObserverRegression.java | 14 ++++---------- .../classifiers/core/driftdetection/ADWIN.java | 7 ++----- .../core/driftdetection/EWMAChartDM.java | 3 +-- .../InfoGainSplitCriterionMultilabel.java | 4 +--- .../core/voting/InverseErrorWeightedVote.java | 3 +-- .../rules/driftdetection/PageHinkleyFading.java | 8 ++------ .../rules/driftdetection/PageHinkleyTest.java | 8 ++------ .../moa/clusterers/clustream/Clustream.java | 3 +-- .../moa/clusterers/clustream/WithKmeans.java | 3 +-- .../yahoo/labs/samoa/moa/core/DataPoint.java | 3 +-- .../streams/ClusteringEntranceProcessor.java | 18 +++--------------- .../labs/samoa/tasks/ClusteringEvaluation.java | 3 +-- .../java/com/yahoo/labs/samoa/utils/Utils.java | 3 +-- .../yahoo/labs/samoa/core/DoubleVectorTest.java | 15 ++++----------- samoa-instances/pom.xml | 20 ++++++++++++++++++++ samoa-local/pom.xml | 20 ++++++++++++++++++++ .../samoa/topology/impl/SimpleTopology.java | 3 +-- samoa-local/src/main/resources/log4j.xml | 20 ++++++++++++++++++++ samoa-s4/pom.xml | 20 ++++++++++++++++++++ samoa-s4/samoa-s4-adapter/pom.xml | 20 ++++++++++++++++++++ samoa-s4/src/main/assembly/samoa-s4.xml | 20 ++++++++++++++++++++ samoa-samza/pom.xml | 20 ++++++++++++++++++++ samoa-samza/src/main/assembly/samoa-samza.xml | 20 ++++++++++++++++++++ .../impl/SamzaEntranceProcessingItem.java | 13 ++----------- .../topology/impl/SamzaProcessingItem.java | 6 +----- samoa-samza/src/main/resources/log4j.xml | 20 ++++++++++++++++++++ samoa-storm/pom.xml | 20 ++++++++++++++++++++ .../samoa/topology/impl/StormSamoaUtils.java | 7 +------ .../topology/impl/StormProcessingItemTest.java | 3 +-- .../samoa/topology/impl/ThreadsTopology.java | 3 +-- .../java/com/yahoo/labs/samoa/AlgosTest.java | 3 +-- 46 files changed, 251 insertions(+), 144 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-api/src/main/java/com/yahoo/labs/samoa/evaluation/measures/SilhouetteCoefficient.java ---------------------------------------------------------------------- diff --git a/samoa-api/src/main/java/com/yahoo/labs/samoa/evaluation/measures/SilhouetteCoefficient.java b/samoa-api/src/main/java/com/yahoo/labs/samoa/evaluation/measures/SilhouetteCoefficient.java index 3740910..e689b7f 100644 --- a/samoa-api/src/main/java/com/yahoo/labs/samoa/evaluation/measures/SilhouetteCoefficient.java +++ b/samoa-api/src/main/java/com/yahoo/labs/samoa/evaluation/measures/SilhouetteCoefficient.java @@ -88,8 +88,7 @@ public class SilhouetteCoefficient extends MeasureCollection { int minOwnIndex = -1; for (int fc : ownClusters) { double normDist = distanceByClusters[fc] / (double) countsByClusters[fc]; - if (normDist < minAvgDistanceOwn) {// && pointInclusionProbFC[p][fc] > - // pointInclusionProbThreshold){ + if (normDist < minAvgDistanceOwn) {// && pointInclusionProbFC[p][fc] > pointInclusionProbThreshold){ minAvgDistanceOwn = normDist; minOwnIndex = fc; } http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/ensemble/BaggingDistributorProcessor.java ---------------------------------------------------------------------- diff --git a/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/ensemble/BaggingDistributorProcessor.java b/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/ensemble/BaggingDistributorProcessor.java index 44264ac..4f04d91 100644 --- a/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/ensemble/BaggingDistributorProcessor.java +++ b/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/ensemble/BaggingDistributorProcessor.java @@ -59,8 +59,7 @@ public class BaggingDistributorProcessor implements Processor { * @return true, if successful */ public boolean process(ContentEvent event) { - InstanceContentEvent inEvent = (InstanceContentEvent) event; // ((s4Event) - // event).getContentEvent(); + InstanceContentEvent inEvent = (InstanceContentEvent) event; // ((s4Event)event).getContentEvent(); // InstanceEvent inEvent = (InstanceEvent) event; if (inEvent.getInstanceIndex() < 0) { http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/AMRulesRegressor.java ---------------------------------------------------------------------- diff --git a/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/AMRulesRegressor.java b/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/AMRulesRegressor.java index fc49ebe..9a88a9b 100644 --- a/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/AMRulesRegressor.java +++ b/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/AMRulesRegressor.java @@ -102,8 +102,7 @@ public class AMRulesRegressor implements RegressionLearner, Configurable { "anomalyThreshold", 'n', "The threshold value of anomalies to be used in the anomaly detection.", - 30, 0, Integer.MAX_VALUE); // num minimum of instances to detect - // anomalies. 15. + 30, 0, Integer.MAX_VALUE); // num minimum of instances to detect anomalies anomalies. 15. public FlagOption unorderedRulesOption = new FlagOption("setUnorderedRulesOn", 'U', "unorderedRules."); http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/HorizontalAMRulesRegressor.java ---------------------------------------------------------------------- diff --git a/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/HorizontalAMRulesRegressor.java b/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/HorizontalAMRulesRegressor.java index f7038d3..74b3c8a 100644 --- a/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/HorizontalAMRulesRegressor.java +++ b/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/HorizontalAMRulesRegressor.java @@ -102,8 +102,7 @@ public class HorizontalAMRulesRegressor implements RegressionLearner, Configurab "anomalyThreshold", 'n', "The threshold value of anomalies to be used in the anomaly detection.", - 30, 0, Integer.MAX_VALUE); // num minimum of instances to detect - // anomalies. 15. + 30, 0, Integer.MAX_VALUE); // num minimum of instances to detect anomalies. 15. public FlagOption unorderedRulesOption = new FlagOption("setUnorderedRulesOn", 'U', "unorderedRules."); http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/VerticalAMRulesRegressor.java ---------------------------------------------------------------------- diff --git a/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/VerticalAMRulesRegressor.java b/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/VerticalAMRulesRegressor.java index 01c72e5..21294bc 100644 --- a/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/VerticalAMRulesRegressor.java +++ b/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/VerticalAMRulesRegressor.java @@ -101,8 +101,7 @@ public class VerticalAMRulesRegressor implements RegressionLearner, Configurable "anomalyThreshold", 'n', "The threshold value of anomalies to be used in the anomaly detection.", - 30, 0, Integer.MAX_VALUE); // num minimum of instances to detect - // anomalies. 15. + 30, 0, Integer.MAX_VALUE); // num minimum of instances to detect anomalies. 15. public FlagOption unorderedRulesOption = new FlagOption("setUnorderedRulesOn", 'U', "unorderedRules."); http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/centralized/AMRulesRegressorProcessor.java ---------------------------------------------------------------------- diff --git a/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/centralized/AMRulesRegressorProcessor.java b/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/centralized/AMRulesRegressorProcessor.java index 4bdd5c0..f8a6a90 100644 --- a/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/centralized/AMRulesRegressorProcessor.java +++ b/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/centralized/AMRulesRegressorProcessor.java @@ -251,8 +251,7 @@ public class AMRulesRegressorProcessor implements Processor { if (defaultRule.tryToExpand(this.splitConfidence, this.tieThreshold) == true) { ActiveRule newDefaultRule = newRule(defaultRule.getRuleNumberID(), (RuleActiveRegressionNode) defaultRule.getLearningNode(), - ((RuleActiveRegressionNode) defaultRule.getLearningNode()).getStatisticsOtherBranchSplit()); // other - // branch + ((RuleActiveRegressionNode) defaultRule.getLearningNode()).getStatisticsOtherBranchSplit()); // other branch defaultRule.split(); defaultRule.setRuleNumberID(++ruleNumberID); this.ruleSet.add(this.defaultRule); http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/common/Perceptron.java ---------------------------------------------------------------------- diff --git a/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/common/Perceptron.java b/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/common/Perceptron.java index f459b64..b33596e 100644 --- a/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/common/Perceptron.java +++ b/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/common/Perceptron.java @@ -40,8 +40,7 @@ import com.yahoo.labs.samoa.moa.core.Measurement; */ public class Perceptron extends AbstractClassifier implements Regressor { - private final double SD_THRESHOLD = 0.0000001; // THRESHOLD for normalizing - // attribute and target values + private final double SD_THRESHOLD = 0.0000001; // THRESHOLD for normalizing attribute and target values private static final long serialVersionUID = 1L; @@ -215,8 +214,7 @@ public class Perceptron extends AbstractClassifier implements Regressor { // this.fadingFactor=this.fadingFactorOption.getValue(); // this.classifierRandom.setSeed(randomSeedOption.getValue()); this.classifierRandom.setSeed(randomSeed); - this.initialisePerceptron = false; // not in resetLearningImpl() because - // it needs Instance! + this.initialisePerceptron = false; // not in resetLearningImpl() because it needs Instance! this.weightAttribute = new double[inst.numAttributes()]; for (int j = 0; j < inst.numAttributes(); j++) { weightAttribute[j] = 2 * this.classifierRandom.nextDouble() - 1; @@ -273,8 +271,7 @@ public class Perceptron extends AbstractClassifier implements Regressor { return normalizedPrediction + meanY; } else - return normalizedPrediction; // Perceptron may have been "reseted". Use - // old weights to predict + return normalizedPrediction; // Perceptron may have been "reseted". Use old weights to predict } http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/common/Rule.java ---------------------------------------------------------------------- diff --git a/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/common/Rule.java b/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/common/Rule.java index 76edd19..cbb0b52 100644 --- a/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/common/Rule.java +++ b/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/common/Rule.java @@ -96,20 +96,10 @@ public abstract class Rule extends AbstractMOAObject { .getSplitTest(); if (nodeTest.isUsingSameAttribute(ruleSplitNodeTest)) { isIncludedInNodeList = true; - if (nodeTest.isIncludedInRuleNode(ruleSplitNodeTest) == true) { // remove - // this - // line - // to - // keep - // the - // most - // recent - // attribute - // value + if (nodeTest.isIncludedInRuleNode(ruleSplitNodeTest) == true) { // remove this line to keep the most recent attribute value // replace the value nodeTest.setAttributeValue(ruleSplitNodeTest); - isUpdated = true; // if is updated (i.e. an expansion happened) a new - // learning node should be created + isUpdated = true; // if is updated (i.e. an expansion happened) a new learning node should be created } } } http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/common/RuleActiveRegressionNode.java ---------------------------------------------------------------------- diff --git a/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/common/RuleActiveRegressionNode.java b/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/common/RuleActiveRegressionNode.java index 3fc7ad8..b038687 100644 --- a/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/common/RuleActiveRegressionNode.java +++ b/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/common/RuleActiveRegressionNode.java @@ -185,8 +185,7 @@ public class RuleActiveRegressionNode extends RuleRegressionNode implements Rule } this.perceptron.trainOnInstance(inst); - if (this.predictionFunction != 1) { // Train target mean if prediction - // function is not Perceptron + if (this.predictionFunction != 1) { // Train target mean if prediction function is not Perceptron this.targetMean.trainOnInstance(inst); } } http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/common/RulePassiveRegressionNode.java ---------------------------------------------------------------------- diff --git a/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/common/RulePassiveRegressionNode.java b/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/common/RulePassiveRegressionNode.java index 1fe2db1..1ee25c8 100644 --- a/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/common/RulePassiveRegressionNode.java +++ b/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/common/RulePassiveRegressionNode.java @@ -68,8 +68,7 @@ public class RulePassiveRegressionNode extends RuleRegressionNode implements Rul nodeStatistics.addToValue(2, inst.classValue() * inst.classValue()); this.perceptron.trainOnInstance(inst); - if (this.predictionFunction != 1) { // Train target mean if prediction - // function is not Perceptron + if (this.predictionFunction != 1) { // Train target mean if prediction function is not Perceptron this.targetMean.trainOnInstance(inst); } } http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/common/RuleRegressionNode.java ---------------------------------------------------------------------- diff --git a/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/common/RuleRegressionNode.java b/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/common/RuleRegressionNode.java index e73d94f..e0379a0 100644 --- a/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/common/RuleRegressionNode.java +++ b/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/common/RuleRegressionNode.java @@ -250,8 +250,7 @@ public abstract class RuleRegressionNode implements Serializable { double probability = 0.0; if (sd > 0.0) { - double k = (Math.abs(value - mean) / sd); // One tailed variant of - // Chebyshev's inequality + double k = (Math.abs(value - mean) / sd); // One tailed variant of Chebyshev's inequality probability = 1.0 / (1 + k * k); } http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/distributed/AMRDefaultRuleProcessor.java ---------------------------------------------------------------------- diff --git a/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/distributed/AMRDefaultRuleProcessor.java b/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/distributed/AMRDefaultRuleProcessor.java index 007c535..79db7c5 100644 --- a/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/distributed/AMRDefaultRuleProcessor.java +++ b/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/distributed/AMRDefaultRuleProcessor.java @@ -139,8 +139,7 @@ public class AMRDefaultRuleProcessor implements Processor { if (defaultRule.tryToExpand(this.splitConfidence, this.tieThreshold) == true) { ActiveRule newDefaultRule = newRule(defaultRule.getRuleNumberID(), (RuleActiveRegressionNode) defaultRule.getLearningNode(), - ((RuleActiveRegressionNode) defaultRule.getLearningNode()).getStatisticsOtherBranchSplit()); // other - // branch + ((RuleActiveRegressionNode) defaultRule.getLearningNode()).getStatisticsOtherBranchSplit()); // other branch defaultRule.split(); defaultRule.setRuleNumberID(++ruleNumberID); // send out the new rule http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/distributed/AMRulesAggregatorProcessor.java ---------------------------------------------------------------------- diff --git a/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/distributed/AMRulesAggregatorProcessor.java b/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/distributed/AMRulesAggregatorProcessor.java index 3e3df01..d1eecf8 100644 --- a/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/distributed/AMRulesAggregatorProcessor.java +++ b/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/distributed/AMRulesAggregatorProcessor.java @@ -200,8 +200,7 @@ public class AMRulesAggregatorProcessor implements Processor { if (defaultRule.tryToExpand(this.splitConfidence, this.tieThreshold) == true) { ActiveRule newDefaultRule = newRule(defaultRule.getRuleNumberID(), (RuleActiveRegressionNode) defaultRule.getLearningNode(), - ((RuleActiveRegressionNode) defaultRule.getLearningNode()).getStatisticsOtherBranchSplit()); // other - // branch + ((RuleActiveRegressionNode) defaultRule.getLearningNode()).getStatisticsOtherBranchSplit()); // other branch defaultRule.split(); defaultRule.setRuleNumberID(++ruleNumberID); this.ruleSet.add(new PassiveRule(this.defaultRule)); http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/distributed/PredicateContentEvent.java ---------------------------------------------------------------------- diff --git a/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/distributed/PredicateContentEvent.java b/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/distributed/PredicateContentEvent.java index f6c8934..c863da0 100644 --- a/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/distributed/PredicateContentEvent.java +++ b/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/distributed/PredicateContentEvent.java @@ -50,8 +50,7 @@ public class PredicateContentEvent implements ContentEvent { public PredicateContentEvent(int ruleID, RuleSplitNode ruleSplitNode, RulePassiveRegressionNode learningNode) { this.ruleNumberID = ruleID; - this.ruleSplitNode = ruleSplitNode; // is this is null: this is for updating - // learningNode only + this.ruleSplitNode = ruleSplitNode; // is this is null: this is for updating learningNode only this.learningNode = learningNode; } http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/distributed/RuleContentEvent.java ---------------------------------------------------------------------- diff --git a/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/distributed/RuleContentEvent.java b/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/distributed/RuleContentEvent.java index 19f7e46..ed1c017 100644 --- a/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/distributed/RuleContentEvent.java +++ b/samoa-api/src/main/java/com/yahoo/labs/samoa/learners/classifiers/rules/distributed/RuleContentEvent.java @@ -37,8 +37,7 @@ public class RuleContentEvent implements ContentEvent { private static final long serialVersionUID = -9046390274402894461L; private final int ruleNumberID; - private final ActiveRule addingRule; // for removing rule, we only need the - // rule's ID + private final ActiveRule addingRule; // for removing rule, we only need the rule's ID private final boolean isRemoving; public RuleContentEvent() { http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/classifiers/core/attributeclassobservers/BinaryTreeNumericAttributeClassObserverRegression.java ---------------------------------------------------------------------- diff --git a/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/classifiers/core/attributeclassobservers/BinaryTreeNumericAttributeClassObserverRegression.java b/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/classifiers/core/attributeclassobservers/BinaryTreeNumericAttributeClassObserverRegression.java index c05b76e..89aeada 100644 --- a/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/classifiers/core/attributeclassobservers/BinaryTreeNumericAttributeClassObserverRegression.java +++ b/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/classifiers/core/attributeclassobservers/BinaryTreeNumericAttributeClassObserverRegression.java @@ -50,13 +50,9 @@ public class BinaryTreeNumericAttributeClassObserverRegression extends AbstractO public double cut_point; - public double[] lessThan; // This array maintains statistics for the - // instance reaching the node with attribute - // values less than or iqual to the cutpoint. + public double[] lessThan; // This array maintains statistics for the instance reaching the node with attribute values less than or iqual to the cutpoint. - public double[] greaterThan; // This array maintains statistics for the - // instance reaching the node with attribute - // values greater than to the cutpoint. + public double[] greaterThan; // This array maintains statistics for the instance reaching the node with attribute values greater than to the cutpoint. public Node left; @@ -67,10 +63,8 @@ public class BinaryTreeNumericAttributeClassObserverRegression extends AbstractO this.lessThan = new double[3]; this.greaterThan = new double[3]; this.lessThan[0] = target; // The sum of their target attribute values. - this.lessThan[1] = target * target; // The sum of the squared target - // attribute values. - this.lessThan[2] = 1.0; // A counter of the number of instances that have - // reached the node. + this.lessThan[1] = target * target; // The sum of the squared target attribute values. + this.lessThan[2] = 1.0; // A counter of the number of instances that have reached the node. this.greaterThan[0] = 0.0; this.greaterThan[1] = 0.0; this.greaterThan[2] = 0.0; http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/classifiers/core/driftdetection/ADWIN.java ---------------------------------------------------------------------- diff --git a/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/classifiers/core/driftdetection/ADWIN.java b/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/classifiers/core/driftdetection/ADWIN.java index 5a52cf8..babb557 100644 --- a/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/classifiers/core/driftdetection/ADWIN.java +++ b/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/classifiers/core/driftdetection/ADWIN.java @@ -503,9 +503,7 @@ public class ADWIN extends AbstractMOAObject { break; } double absvalue = (u0 / n0) - (u1 / n1); // n1<WIDTH-mintMinWinLength-1 - if ((n1 > mintMinWinLength + 1 && n0 > mintMinWinLength + 1) && // Diference - // NEGATIVE - // if( + if ((n1 > mintMinWinLength + 1 && n0 > mintMinWinLength + 1) && // Diference NEGATIVE if( blnCutexpression(n0, n1, u0, u1, v0, v1, absvalue, delta)) { blnBucketDeleted = true; Detect = mintTime; @@ -544,8 +542,7 @@ public class ADWIN extends AbstractMOAObject { private boolean blnCutexpression(int n0, int n1, double u0, double u1, double v0, double v1, double absvalue, double delta) { int n = getWidth(); - double dd = Math.log(2 * Math.log(n) / delta); // -- ull perque el ln n va - // al numerador. + double dd = Math.log(2 * Math.log(n) / delta); // -- ull perque el ln n va al numerador. // Formula Gener 2008 double v = getVariance(); double m = ((double) 1 / ((n0 - mintMinWinLength + 1))) + ((double) 1 / ((n1 - mintMinWinLength + 1))); http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/classifiers/core/driftdetection/EWMAChartDM.java ---------------------------------------------------------------------- diff --git a/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/classifiers/core/driftdetection/EWMAChartDM.java b/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/classifiers/core/driftdetection/EWMAChartDM.java index b838e7d..0e0d357 100644 --- a/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/classifiers/core/driftdetection/EWMAChartDM.java +++ b/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/classifiers/core/driftdetection/EWMAChartDM.java @@ -90,8 +90,7 @@ public class EWMAChartDM extends AbstractChangeDetector { z_t += lambda * (prediction - z_t); - double L_t = 3.97 - 6.56 * m_p + 48.73 * Math.pow(m_p, 3) - 330.13 * Math.pow(m_p, 5) + 848.18 * Math.pow(m_p, 7); // %1 - // FP + double L_t = 3.97 - 6.56 * m_p + 48.73 * Math.pow(m_p, 3) - 330.13 * Math.pow(m_p, 5) + 848.18 * Math.pow(m_p, 7); // %1 FP this.estimation = m_p; this.isChangeDetected = false; this.isWarningZone = false; http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/classifiers/core/splitcriteria/InfoGainSplitCriterionMultilabel.java ---------------------------------------------------------------------- diff --git a/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/classifiers/core/splitcriteria/InfoGainSplitCriterionMultilabel.java b/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/classifiers/core/splitcriteria/InfoGainSplitCriterionMultilabel.java index 814fd5f..f96a06e 100644 --- a/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/classifiers/core/splitcriteria/InfoGainSplitCriterionMultilabel.java +++ b/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/classifiers/core/splitcriteria/InfoGainSplitCriterionMultilabel.java @@ -44,9 +44,7 @@ public class InfoGainSplitCriterionMultilabel extends InfoGainSplitCriterion { for (double num : dist) { double d = num / sum; if (d > 0.0) { // TODO: how small can d be before log2 overflows? - entropy -= d * Utils.log2(d) + (1 - d) * Utils.log2(1 - d); // Extension - // to - // Multilabel + entropy -= d * Utils.log2(d) + (1 - d) * Utils.log2(1 - d); // Extension to Multilabel } } } http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/classifiers/rules/core/voting/InverseErrorWeightedVote.java ---------------------------------------------------------------------- diff --git a/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/classifiers/rules/core/voting/InverseErrorWeightedVote.java b/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/classifiers/rules/core/voting/InverseErrorWeightedVote.java index 8ed0799..c27c2b5 100644 --- a/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/classifiers/rules/core/voting/InverseErrorWeightedVote.java +++ b/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/classifiers/rules/core/voting/InverseErrorWeightedVote.java @@ -31,8 +31,7 @@ public class InverseErrorWeightedVote extends AbstractErrorWeightedVote { /** * */ - private static final double EPS = 0.000000001; // just to prevent divide by 0 - // in 1/X -> 1/(x+EPS) + private static final double EPS = 0.000000001; // just to prevent divide by 0 in 1/X -> 1/(x+EPS) private static final long serialVersionUID = 6359349250620616482L; public InverseErrorWeightedVote() { http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/classifiers/rules/driftdetection/PageHinkleyFading.java ---------------------------------------------------------------------- diff --git a/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/classifiers/rules/driftdetection/PageHinkleyFading.java b/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/classifiers/rules/driftdetection/PageHinkleyFading.java index d18134b..8c41569 100644 --- a/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/classifiers/rules/driftdetection/PageHinkleyFading.java +++ b/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/classifiers/rules/driftdetection/PageHinkleyFading.java @@ -58,12 +58,8 @@ public class PageHinkleyFading extends PageHinkleyTest { this.sumAbsolutError = fadingFactor * this.sumAbsolutError + absolutError; if (this.instancesSeen > 30) { double mT = absolutError - (this.sumAbsolutError / this.instancesSeen) - this.alpha; - this.cumulativeSum = this.cumulativeSum + mT; // Update the cumulative mT - // sum - if (this.cumulativeSum < this.minimumValue) { // Update the minimum mT - // value if the new mT is - // smaller than the current - // minimum + this.cumulativeSum = this.cumulativeSum + mT; // Update the cumulative mT sum + if (this.cumulativeSum < this.minimumValue) { // Update the minimum mT value if the new mT is smaller than the current minimum this.minimumValue = this.cumulativeSum; } return (((this.cumulativeSum - this.minimumValue) > this.threshold)); http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/classifiers/rules/driftdetection/PageHinkleyTest.java ---------------------------------------------------------------------- diff --git a/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/classifiers/rules/driftdetection/PageHinkleyTest.java b/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/classifiers/rules/driftdetection/PageHinkleyTest.java index 354b9a8..e9f06c9 100644 --- a/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/classifiers/rules/driftdetection/PageHinkleyTest.java +++ b/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/classifiers/rules/driftdetection/PageHinkleyTest.java @@ -70,12 +70,8 @@ public class PageHinkleyTest implements Serializable { this.sumAbsolutError = this.sumAbsolutError + absolutError; if (this.phinstancesSeen > 30) { double mT = absolutError - (this.sumAbsolutError / this.phinstancesSeen) - this.alpha; - this.cumulativeSum = this.cumulativeSum + mT; // Update the cumulative mT - // sum - if (this.cumulativeSum < this.minimumValue) { // Update the minimum mT - // value if the new mT is - // smaller than the current - // minimum + this.cumulativeSum = this.cumulativeSum + mT; // Update the cumulative mT sum + if (this.cumulativeSum < this.minimumValue) { // Update the minimum mT value if the new mT is smaller than the current minimum this.minimumValue = this.cumulativeSum; } return (((this.cumulativeSum - this.minimumValue) > this.threshold)); http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/clusterers/clustream/Clustream.java ---------------------------------------------------------------------- diff --git a/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/clusterers/clustream/Clustream.java b/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/clusterers/clustream/Clustream.java index 101d297..7db68dd 100644 --- a/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/clusterers/clustream/Clustream.java +++ b/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/clusterers/clustream/Clustream.java @@ -145,8 +145,7 @@ public class Clustream extends AbstractClusterer { // 3. Date does not fit, we need to free // some space to insert a new kernel - long threshold = timestamp - timeWindow; // Kernels before this can be - // forgotten + long threshold = timestamp - timeWindow; // Kernels before this can be forgotten // 3.1 Try to forget old kernels for (int i = 0; i < kernels.length; i++) { http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/clusterers/clustream/WithKmeans.java ---------------------------------------------------------------------- diff --git a/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/clusterers/clustream/WithKmeans.java b/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/clusterers/clustream/WithKmeans.java index ef8fed8..f03d5f7 100644 --- a/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/clusterers/clustream/WithKmeans.java +++ b/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/clusterers/clustream/WithKmeans.java @@ -138,8 +138,7 @@ public class WithKmeans extends AbstractClusterer { // 3. Date does not fit, we need to free // some space to insert a new kernel - long threshold = timestamp - timeWindow; // Kernels before this can be - // forgotten + long threshold = timestamp - timeWindow; // Kernels before this can be forgotten // 3.1 Try to forget old kernels for (int i = 0; i < kernels.length; i++) { http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/core/DataPoint.java ---------------------------------------------------------------------- diff --git a/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/core/DataPoint.java b/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/core/DataPoint.java index a5a82af..45abea2 100644 --- a/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/core/DataPoint.java +++ b/samoa-api/src/main/java/com/yahoo/labs/samoa/moa/core/DataPoint.java @@ -44,8 +44,7 @@ public class DataPoint extends DenseInstance { measure_values = new HashMap<String, String>(); Attribute classLabel = dataset().classAttribute(); - noiseLabel = classLabel.indexOfValue("noise"); // -1 returned if there is no - // noise + noiseLabel = classLabel.indexOfValue("noise"); // -1 returned if there is no noise } public void updateWeight(int cur_timestamp, double decay_rate) { http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-api/src/main/java/com/yahoo/labs/samoa/streams/ClusteringEntranceProcessor.java ---------------------------------------------------------------------- diff --git a/samoa-api/src/main/java/com/yahoo/labs/samoa/streams/ClusteringEntranceProcessor.java b/samoa-api/src/main/java/com/yahoo/labs/samoa/streams/ClusteringEntranceProcessor.java index ddb047e..9247a7a 100644 --- a/samoa-api/src/main/java/com/yahoo/labs/samoa/streams/ClusteringEntranceProcessor.java +++ b/samoa-api/src/main/java/com/yahoo/labs/samoa/streams/ClusteringEntranceProcessor.java @@ -224,17 +224,7 @@ public final class ClusteringEntranceProcessor implements EntranceProcessor { // evaluationStream.put(evalEvent); // } - groundTruthSamplingFrequency = ((ClusteringStream) streamSource.getStream()).getDecayHorizon(); // FIXME - // should - // it - // be - // taken - // from - // the - // ClusteringEvaluation - // -f - // option - // instead? + groundTruthSamplingFrequency = ((ClusteringStream) streamSource.getStream()).getDecayHorizon(); // FIXME should it be takend from the ClusteringEvaluation -f option instead? if (isFinished()) { // send ending event ClusteringContentEvent contentEvent = new ClusteringContentEvent(-1, firstInstance); @@ -245,10 +235,8 @@ public final class ClusteringEntranceProcessor implements EntranceProcessor { numInstanceSent++; if (numInstanceSent % groundTruthSamplingFrequency == 0) { // TODO implement an interface ClusteringGroundTruth with a - // getGeneratingClusters() method, check if the source implements the - // interface - // send a clustering evaluation event for external measures (distance - // from the gt clusters) + // getGeneratingClusters() method, check if the source implements the interface + // send a clustering evaluation event for external measures (distance from the gt clusters) Clustering gtClustering = ((RandomRBFGeneratorEvents) streamSource.getStream()).getGeneratingClusters(); return new ClusteringEvaluationContentEvent(gtClustering, nextDataPoint, false); } else { http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-api/src/main/java/com/yahoo/labs/samoa/tasks/ClusteringEvaluation.java ---------------------------------------------------------------------- diff --git a/samoa-api/src/main/java/com/yahoo/labs/samoa/tasks/ClusteringEvaluation.java b/samoa-api/src/main/java/com/yahoo/labs/samoa/tasks/ClusteringEvaluation.java index c62de1e..f6a734d 100644 --- a/samoa-api/src/main/java/com/yahoo/labs/samoa/tasks/ClusteringEvaluation.java +++ b/samoa-api/src/main/java/com/yahoo/labs/samoa/tasks/ClusteringEvaluation.java @@ -144,8 +144,7 @@ public class ClusteringEvaluation implements Task, Configurable { distributorStream = builder.createStream(distributor); distributor.setOutputStream(distributorStream); evaluationStream = builder.createStream(distributor); - distributor.setEvaluationStream(evaluationStream); // passes evaluation - // events along + distributor.setEvaluationStream(evaluationStream); // passes evaluation events along logger.debug("Successfully instantiated Distributor"); // instantiate learner and connect it to distributorStream http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-api/src/main/java/com/yahoo/labs/samoa/utils/Utils.java ---------------------------------------------------------------------- diff --git a/samoa-api/src/main/java/com/yahoo/labs/samoa/utils/Utils.java b/samoa-api/src/main/java/com/yahoo/labs/samoa/utils/Utils.java index bd819ad..69b7480 100644 --- a/samoa-api/src/main/java/com/yahoo/labs/samoa/utils/Utils.java +++ b/samoa-api/src/main/java/com/yahoo/labs/samoa/utils/Utils.java @@ -43,8 +43,7 @@ public class Utils { public static void buildSamoaPackage() { try { - String output = "/tmp/samoa/samoa.jar";// System.getProperty("user.home") - // + "/samoa.jar"; + String output = "/tmp/samoa/samoa.jar";// System.getProperty("user.home") + "/samoa.jar"; Manifest manifest = createManifest(); BufferedOutputStream bo; http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-api/src/test/java/com/yahoo/labs/samoa/core/DoubleVectorTest.java ---------------------------------------------------------------------- diff --git a/samoa-api/src/test/java/com/yahoo/labs/samoa/core/DoubleVectorTest.java b/samoa-api/src/test/java/com/yahoo/labs/samoa/core/DoubleVectorTest.java index e8d589f..08ea475 100644 --- a/samoa-api/src/test/java/com/yahoo/labs/samoa/core/DoubleVectorTest.java +++ b/samoa-api/src/test/java/com/yahoo/labs/samoa/core/DoubleVectorTest.java @@ -71,29 +71,22 @@ public class DoubleVectorTest { // test automatic vector enlargement emptyVector.setValue(0, 1.0); assertEquals(1, emptyVector.getArrayRef().length); - assertEquals(1.0, emptyVector.getArrayRef()[0], 0.0); // should be exactly - // the same, so - // delta=0.0 + assertEquals(1.0, emptyVector.getArrayRef()[0], 0.0); // should be exactly the same, so delta=0.0 emptyVector.setValue(5, 5.5); assertEquals(6, emptyVector.getArrayRef().length); assertEquals(2, emptyVector.numNonZeroEntries()); - assertEquals(5.5, emptyVector.getArrayRef()[5], 0.0); // should be exactly - // the same, so - // delta=0.0 + assertEquals(5.5, emptyVector.getArrayRef()[5], 0.0); // should be exactly the same, so delta=0.0 } @Test public void testAddToValue() { array5Vector.addToValue(2, 5.0); - assertEquals(5, array5Vector.getArrayRef()[2], 0.0); // should be exactly - // the same, so - // delta=0.0 + assertEquals(5, array5Vector.getArrayRef()[2], 0.0); // should be exactly the same, so delta=0.0 // test automatic vector enlargement emptyVector.addToValue(0, 1.0); - assertEquals(1, emptyVector.getArrayRef()[0], 0.0); // should be exactly the - // same, so delta=0.0 + assertEquals(1, emptyVector.getArrayRef()[0], 0.0); // should be exactly the same, so delta=0.0 } @Test http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-instances/pom.xml ---------------------------------------------------------------------- diff --git a/samoa-instances/pom.xml b/samoa-instances/pom.xml index e8497d9..2db2eb8 100644 --- a/samoa-instances/pom.xml +++ b/samoa-instances/pom.xml @@ -1,5 +1,25 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- + #%L + SAMOA + %% + Copyright (C) 2013 - 2015 Yahoo! Inc. + %% + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + #L% + --> + +<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-local/pom.xml ---------------------------------------------------------------------- diff --git a/samoa-local/pom.xml b/samoa-local/pom.xml index 3716315..15d278c 100644 --- a/samoa-local/pom.xml +++ b/samoa-local/pom.xml @@ -1,5 +1,25 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- + #%L + SAMOA + %% + Copyright (C) 2013 - 2015 Yahoo! Inc. + %% + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + #L% + --> + +<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-local/src/main/java/com/yahoo/labs/samoa/topology/impl/SimpleTopology.java ---------------------------------------------------------------------- diff --git a/samoa-local/src/main/java/com/yahoo/labs/samoa/topology/impl/SimpleTopology.java b/samoa-local/src/main/java/com/yahoo/labs/samoa/topology/impl/SimpleTopology.java index e7fddbd..e7ed33f 100644 --- a/samoa-local/src/main/java/com/yahoo/labs/samoa/topology/impl/SimpleTopology.java +++ b/samoa-local/src/main/java/com/yahoo/labs/samoa/topology/impl/SimpleTopology.java @@ -40,8 +40,7 @@ public class SimpleTopology extends AbstractTopology { SimpleEntranceProcessingItem entrancePi = (SimpleEntranceProcessingItem) this.getEntranceProcessingItems() .toArray()[0]; - entrancePi.getProcessor().onCreate(0); // id=0 as it is not used in simple - // mode + entrancePi.getProcessor().onCreate(0); // id=0 as it is not used in simple mode entrancePi.startSendingEvents(); } } http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-local/src/main/resources/log4j.xml ---------------------------------------------------------------------- diff --git a/samoa-local/src/main/resources/log4j.xml b/samoa-local/src/main/resources/log4j.xml index e79c05e..89da61a 100644 --- a/samoa-local/src/main/resources/log4j.xml +++ b/samoa-local/src/main/resources/log4j.xml @@ -1,5 +1,25 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- + #%L + SAMOA + %% + Copyright (C) 2013 - 2015 Yahoo! Inc. + %% + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + #L% + --> + +<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-s4/pom.xml ---------------------------------------------------------------------- diff --git a/samoa-s4/pom.xml b/samoa-s4/pom.xml index 9cff7e9..b770fd5 100644 --- a/samoa-s4/pom.xml +++ b/samoa-s4/pom.xml @@ -1,5 +1,25 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- + #%L + SAMOA + %% + Copyright (C) 2013 - 2015 Yahoo! Inc. + %% + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + #L% + --> + +<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-s4/samoa-s4-adapter/pom.xml ---------------------------------------------------------------------- diff --git a/samoa-s4/samoa-s4-adapter/pom.xml b/samoa-s4/samoa-s4-adapter/pom.xml index 1f0ad5d..608266a 100644 --- a/samoa-s4/samoa-s4-adapter/pom.xml +++ b/samoa-s4/samoa-s4-adapter/pom.xml @@ -1,5 +1,25 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- + #%L + SAMOA + %% + Copyright (C) 2013 - 2015 Yahoo! Inc. + %% + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + #L% + --> + +<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-s4/src/main/assembly/samoa-s4.xml ---------------------------------------------------------------------- diff --git a/samoa-s4/src/main/assembly/samoa-s4.xml b/samoa-s4/src/main/assembly/samoa-s4.xml index adfedcc..04ca68d 100644 --- a/samoa-s4/src/main/assembly/samoa-s4.xml +++ b/samoa-s4/src/main/assembly/samoa-s4.xml @@ -1,5 +1,25 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- + #%L + SAMOA + %% + Copyright (C) 2013 - 2015 Yahoo! Inc. + %% + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + #L% + --> + +<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-samza/pom.xml ---------------------------------------------------------------------- diff --git a/samoa-samza/pom.xml b/samoa-samza/pom.xml index 07e7d8d..e54c361 100644 --- a/samoa-samza/pom.xml +++ b/samoa-samza/pom.xml @@ -1,5 +1,25 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- + #%L + SAMOA + %% + Copyright (C) 2013 - 2015 Yahoo! Inc. + %% + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + #L% + --> + +<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-samza/src/main/assembly/samoa-samza.xml ---------------------------------------------------------------------- diff --git a/samoa-samza/src/main/assembly/samoa-samza.xml b/samoa-samza/src/main/assembly/samoa-samza.xml index 2bed2a6..b48217f 100644 --- a/samoa-samza/src/main/assembly/samoa-samza.xml +++ b/samoa-samza/src/main/assembly/samoa-samza.xml @@ -1,5 +1,25 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- + #%L + SAMOA + %% + Copyright (C) 2013 - 2015 Yahoo! Inc. + %% + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + #L% + --> + +<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-samza/src/main/java/com/yahoo/labs/samoa/topology/impl/SamzaEntranceProcessingItem.java ---------------------------------------------------------------------- diff --git a/samoa-samza/src/main/java/com/yahoo/labs/samoa/topology/impl/SamzaEntranceProcessingItem.java b/samoa-samza/src/main/java/com/yahoo/labs/samoa/topology/impl/SamzaEntranceProcessingItem.java index 16be4fd..5f9f4c3 100644 --- a/samoa-samza/src/main/java/com/yahoo/labs/samoa/topology/impl/SamzaEntranceProcessingItem.java +++ b/samoa-samza/src/main/java/com/yahoo/labs/samoa/topology/impl/SamzaEntranceProcessingItem.java @@ -107,11 +107,7 @@ public class SamzaEntranceProcessingItem extends AbstractEntranceProcessingItem @Override public void init(Config config, TaskContext context) throws Exception { String yarnConfHome = config.get(SamzaConfigFactory.YARN_CONF_HOME_KEY); - if (yarnConfHome != null && yarnConfHome.length() > 0) // if the property is - // set , otherwise, - // assume we are - // running in - // local mode and ignore this + if (yarnConfHome != null && yarnConfHome.length() > 0) // if the property is set, otherwise, assume we are running in local mode and ignore this SystemsUtils.setHadoopConfigHome(yarnConfHome); String filename = config.get(SamzaConfigFactory.FILE_KEY); @@ -161,12 +157,7 @@ public class SamzaEntranceProcessingItem extends AbstractEntranceProcessingItem public SamoaSystemConsumer(String systemName, Config config) { String yarnConfHome = config.get(SamzaConfigFactory.YARN_CONF_HOME_KEY); - if (yarnConfHome != null && yarnConfHome.length() > 0) // if the property - // is set , - // otherwise, - // assume we are - // running in - // local mode and ignore this + if (yarnConfHome != null && yarnConfHome.length() > 0) // if the property is set, otherwise, assume we are running in local mode and ignore this SystemsUtils.setHadoopConfigHome(yarnConfHome); String filename = config.get(SamzaConfigFactory.FILE_KEY); http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-samza/src/main/java/com/yahoo/labs/samoa/topology/impl/SamzaProcessingItem.java ---------------------------------------------------------------------- diff --git a/samoa-samza/src/main/java/com/yahoo/labs/samoa/topology/impl/SamzaProcessingItem.java b/samoa-samza/src/main/java/com/yahoo/labs/samoa/topology/impl/SamzaProcessingItem.java index 4aa2924..b7f12e0 100644 --- a/samoa-samza/src/main/java/com/yahoo/labs/samoa/topology/impl/SamzaProcessingItem.java +++ b/samoa-samza/src/main/java/com/yahoo/labs/samoa/topology/impl/SamzaProcessingItem.java @@ -114,11 +114,7 @@ public class SamzaProcessingItem extends AbstractProcessingItem @Override public void init(Config config, TaskContext context) throws Exception { String yarnConfHome = config.get(SamzaConfigFactory.YARN_CONF_HOME_KEY); - if (yarnConfHome != null && yarnConfHome.length() > 0) // if the property is - // set , otherwise, - // assume we are - // running in - // local mode and ignore this + if (yarnConfHome != null && yarnConfHome.length() > 0) // if the property is set, otherwise, assume we are running in local mode and ignore this // set , otherwise, SystemsUtils.setHadoopConfigHome(yarnConfHome); String filename = config.get(SamzaConfigFactory.FILE_KEY); http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-samza/src/main/resources/log4j.xml ---------------------------------------------------------------------- diff --git a/samoa-samza/src/main/resources/log4j.xml b/samoa-samza/src/main/resources/log4j.xml index cef2be0..6cbcf2f 100644 --- a/samoa-samza/src/main/resources/log4j.xml +++ b/samoa-samza/src/main/resources/log4j.xml @@ -1,5 +1,25 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- + #%L + SAMOA + %% + Copyright (C) 2013 - 2015 Yahoo! Inc. + %% + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + #L% + --> + +<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-storm/pom.xml ---------------------------------------------------------------------- diff --git a/samoa-storm/pom.xml b/samoa-storm/pom.xml index 2f4f9ee..85655e3 100644 --- a/samoa-storm/pom.xml +++ b/samoa-storm/pom.xml @@ -1,5 +1,25 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- + #%L + SAMOA + %% + Copyright (C) 2013 - 2015 Yahoo! Inc. + %% + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + #L% + --> + +<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-storm/src/main/java/com/yahoo/labs/samoa/topology/impl/StormSamoaUtils.java ---------------------------------------------------------------------- diff --git a/samoa-storm/src/main/java/com/yahoo/labs/samoa/topology/impl/StormSamoaUtils.java b/samoa-storm/src/main/java/com/yahoo/labs/samoa/topology/impl/StormSamoaUtils.java index a90bfe2..e316c3b 100644 --- a/samoa-storm/src/main/java/com/yahoo/labs/samoa/topology/impl/StormSamoaUtils.java +++ b/samoa-storm/src/main/java/com/yahoo/labs/samoa/topology/impl/StormSamoaUtils.java @@ -50,12 +50,7 @@ public class StormSamoaUtils { Properties props = new Properties(); InputStream is; - File f = new File("src/main/resources/samoa-storm-cluster.properties"); // FIXME - // it - // does - // not - // exist - // anymore + File f = new File("src/main/resources/samoa-storm-cluster.properties"); // FIXME it does not exist anymore is = new FileInputStream(f); try { http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-storm/src/test/java/com/yahoo/labs/samoa/topology/impl/StormProcessingItemTest.java ---------------------------------------------------------------------- diff --git a/samoa-storm/src/test/java/com/yahoo/labs/samoa/topology/impl/StormProcessingItemTest.java b/samoa-storm/src/test/java/com/yahoo/labs/samoa/topology/impl/StormProcessingItemTest.java index d233ca6..7414540 100644 --- a/samoa-storm/src/test/java/com/yahoo/labs/samoa/topology/impl/StormProcessingItemTest.java +++ b/samoa-storm/src/test/java/com/yahoo/labs/samoa/topology/impl/StormProcessingItemTest.java @@ -68,8 +68,7 @@ public class StormProcessingItemTest { } }; - pi.addToTopology(topology, PARRALLELISM_HINT_4); // this parallelism hint is - // ignored + pi.addToTopology(topology, PARRALLELISM_HINT_4); // this parallelism hint is ignored new Verifications() { { http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-threads/src/main/java/com/yahoo/labs/samoa/topology/impl/ThreadsTopology.java ---------------------------------------------------------------------- diff --git a/samoa-threads/src/main/java/com/yahoo/labs/samoa/topology/impl/ThreadsTopology.java b/samoa-threads/src/main/java/com/yahoo/labs/samoa/topology/impl/ThreadsTopology.java index a6bad2b..4ce5e2b 100644 --- a/samoa-threads/src/main/java/com/yahoo/labs/samoa/topology/impl/ThreadsTopology.java +++ b/samoa-threads/src/main/java/com/yahoo/labs/samoa/topology/impl/ThreadsTopology.java @@ -46,8 +46,7 @@ public class ThreadsTopology extends AbstractTopology { .toArray()[0]; if (entrancePi == null) throw new IllegalStateException("You need to set entrance PI before running the topology."); - entrancePi.getProcessor().onCreate(0); // id=0 as it is not used in simple - // mode + entrancePi.getProcessor().onCreate(0); // id=0 as it is not used in simple mode entrancePi.startSendingEvents(); } http://git-wip-us.apache.org/repos/asf/incubator-samoa/blob/b79e92bd/samoa-threads/src/test/java/com/yahoo/labs/samoa/AlgosTest.java ---------------------------------------------------------------------- diff --git a/samoa-threads/src/test/java/com/yahoo/labs/samoa/AlgosTest.java b/samoa-threads/src/test/java/com/yahoo/labs/samoa/AlgosTest.java index 0b9b8a2..c2789b9 100644 --- a/samoa-threads/src/test/java/com/yahoo/labs/samoa/AlgosTest.java +++ b/samoa-threads/src/test/java/com/yahoo/labs/samoa/AlgosTest.java @@ -49,8 +49,7 @@ public class AlgosTest { TestParams baggingConfig = new TestParams.Builder() .inputInstances(100_000) .samplingSize(10_000) - .inputDelayMicroSec(100) // prevents saturating the system due to - // unbounded queues + .inputDelayMicroSec(100) // prevents saturating the system due to unbounded queues .evaluationInstances(90_000) .classifiedInstances(105_000) .classificationsCorrect(55f)
