Skip to content

Commit

Permalink
extreme value stats based outlier predictor
Browse files Browse the repository at this point in the history
  • Loading branch information
Pranab Ghosh committed Sep 12, 2018
1 parent 5fe1fe2 commit 2b6d57f
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import org.chombo.util.BaseAttribute
import com.typesafe.config.Config
import java.lang.Boolean
import org.beymani.predictor.ZscorePredictor
import org.beymani.predictor.ExtremeValuePredictor
import org.beymani.predictor.RobustZscorePredictor
import org.chombo.util.SeasonalAnalyzer
import org.chombo.spark.common.SeasonalUtility
Expand All @@ -36,6 +37,7 @@ object StatsBasedOutlierPredictor extends JobConfiguration with SeasonalUtility
private val predStrategyRobustZscore = "robustZscore";
private val predStrategyEstProb = "estimatedProbablity";
private val predStrategyEstAttrProb = "estimatedAttributeProbablity";
private val predStrategyExtremeValueProb = "extremeValueProbablity";

/**
* @param args
Expand Down Expand Up @@ -93,19 +95,23 @@ object StatsBasedOutlierPredictor extends JobConfiguration with SeasonalUtility
val saveOutput = appConfig.getBoolean("save.output")

val predictor = predictorStrategy match {
case `predStrategyZscore` => new ZscorePredictor(algoConfig, "id.fieldOrdinals", "attr.ordinals",
case `predStrategyZscore` => new ZscorePredictor(algoConfig, "id.fieldOrdinals", "attr.ordinals",
"field.delim.in", "attr.weights", "stats.filePath", "seasonal.analysis", "hdfs.file", "score.threshold",
"exp.const");
"exp.const")

case `predStrategyRobustZscore` => new RobustZscorePredictor(algoConfig, "id.fieldOrdinals", "attr.ordinals",
case `predStrategyExtremeValueProb` => new ExtremeValuePredictor(algoConfig, "id.fieldOrdinals", "attr.ordinals",
"field.delim.in", "attr.weights", "stats.filePath", "seasonal.analysis", "hdfs.file", "score.threshold",
"exp.const")

case `predStrategyRobustZscore` => new RobustZscorePredictor(algoConfig, "id.fieldOrdinals", "attr.ordinals",
"stats.medFilePath", "stats.madFilePath", "field.delim.in", "attr.weights","seasonal.analysis",
"hdfs.file", "exp.const","score.threshold");

case `predStrategyEstProb` => new EstimatedProbabilityBasedPredictor(algoConfig, "id.fieldOrdinals",
case `predStrategyEstProb` => new EstimatedProbabilityBasedPredictor(algoConfig, "id.fieldOrdinals",
"distr.file.path", "hdfs.file", "schema.file.path", "seasonal.analysis", "field.delim.in",
"score.threshold")

case `predStrategyEstAttrProb` => new EsimatedAttrtibuteProbabilityBasedPredictor(algoConfig,
case `predStrategyEstAttrProb` => new EsimatedAttrtibuteProbabilityBasedPredictor(algoConfig,
"id.fieldOrdinals", "attr.ordinals","distr.file.path", "hdfs.file", "schema.file.path",
"attr.weights", "seasonal.analysis", "field.delim.in", "score.threshold")
}
Expand Down Expand Up @@ -226,7 +232,7 @@ object StatsBasedOutlierPredictor extends JobConfiguration with SeasonalUtility
val isHdfsFile = getBooleanParamOrElse(appAlgoConfig, "hdfs.file", false)
configParams.put("hdfs.file", new java.lang.Boolean(isHdfsFile))
}
case `predStrategyRobustZscore` => {
case `predStrategyExtremeValueProb` => {
val attWeightList = getMandatoryDoubleListParam(appAlgoConfig, "attr.weights", "missing attribute weights")
val attrWeights = BasicUtils.fromListToDoubleArray(attWeightList)
configParams.put("attr.weights", attrWeights)
Expand Down

0 comments on commit 2b6d57f

Please sign in to comment.