Skip to main content
Version: 0.10.0

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"]
containerName = "madtest"
intermediateSaveDir = "intermediateData"
connectionString = os.environ.get("MADTEST_CONNECTION_STRING", getSecret("madtest-connection-string"))

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

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