/
DistADConfig.scala
46 lines (38 loc) · 1.92 KB
/
DistADConfig.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package net.sansa_stack.ml.spark.anomalydetection
import com.typesafe.config.Config
import net.sansa_stack.ml.spark.utils.ConfigResolver
/** This class gets a config file path and reads the values from the config file
* @param path the path of the config file
*/
class DistADConfig(path: String) extends Serializable {
val cfg: Config = new ConfigResolver(path).getConfig()
var silhouetteMethod: Boolean = cfg.getBoolean("silhouetteMethod")
var silhouetteMethodSamplingRate: Double =
cfg.getDouble("silhouetteMethodSamplingRate")
var verbose: Boolean = cfg.getBoolean("verbose")
var writeResultToFile: Boolean = cfg.getBoolean("writeResultToFile")
var clusteringType: String = cfg.getString("clusteringType")
var inputData: String = cfg.getString("inputData")
var resultFilePath: String = cfg.getString("resultFilePath")
var anomalyListSize: Int = cfg.getInt("anomalyListSize")
var anomalyDetectionType: String = cfg.getString("anomalyDetectionType")
var anomalyDetectionAlgorithm: String =
cfg.getString("anomalyDetectionAlgorithm")
var featureExtractor: String = cfg.getString("featureExtractor")
var numberOfClusters: Int = cfg.getInt("numberOfClusters")
var clusteringMethod: String = cfg.getString("clusteringMethod")
/** CONOD
*/
var pairWiseDistanceThreshold: Double =
cfg.getDouble("pairWiseDistanceThreshold")
/** Isolation Forest
*/
var maxSampleForIF: Int = cfg.getInt("maxSampleForIF")
/**
* Literal2Feature
*/
var l2fDepth: Int = cfg.getInt("depth")
var l2fSeedNumber: Int = cfg.getInt("seedNumber")
override def toString =
s"DistADConfig($silhouetteMethod, $silhouetteMethodSamplingRate, $verbose, $writeResultToFile, $clusteringType, $inputData, $resultFilePath, $anomalyListSize, $anomalyDetectionType, $anomalyDetectionAlgorithm, $featureExtractor, $numberOfClusters, $clusteringMethod, $pairWiseDistanceThreshold, $maxSampleForIF, $l2fDepth, $l2fSeedNumber)"
}