Skip to main content
Version: Next

FitMultivariateAnomaly

from synapse.ml.cognitive import *

anomalyKey = os.environ.get("ANOMALY_API_KEY", getSecret("anomaly-api-key"))
startTime = "2021-01-01T00:00:00Z"
endTime = "2021-01-03T01:59:00Z"
timestampColumn = "timestamp"
inputColumns = ["feature0", "feature1", "feature2"]
intermediateSaveDir = "wasbs://madtest@anomalydetectiontest.blob.core.windows.net/intermediateData"

fitMultivariateAnomaly = (FitMultivariateAnomaly()
.setSubscriptionKey(anomalyKey)
.setLocation("westus2")
.setOutputCol("result")
.setStartTime(startTime)
.setEndTime(endTime)
.setIntermediateSaveDir(intermediateSaveDir)
.setTimestampCol(timestampColumn)
.setInputCols(inputColumns)
.setSlidingWindow(200))

# uncomment below for fitting your own dataframe
# model = fitMultivariateAnomaly.fit(df)
# fitMultivariateAnomaly.cleanUpIntermediateData()
Python API: FitMultivariateAnomalyScala API: FitMultivariateAnomaly.NET API: FitMultivariateAnomalySource: FitMultivariateAnomaly