Package: pyoats
OATSQuick and Easy Outlier Detection for Time SeriesExplore the docs »View Demo·Report Bug·Request FeatureTable of ContentsAbout The ProjectBuilt WithGetting StartedPrerequisitesInstallationUsageModelsRoadmapContributingLicenseContactAcknowledgmentsAbout The ProjectAdapting existing outlier detection & prediction methods into atime series outlier detectionsystem is not a simple task. Good news:OATShas done the heavy lifting for you!We present a straight-forward interface for popular, state-of-the-art detection methods to assist you in your experiments. In addition to the models, we also present different options when it comes to selecting a final threshold for predictions.OATSseamlessly supports both univariate and multivariate time series regardless of the model choice and guarantees the same output shape, enabling a modular approach to time series anoamly detection.(back to top)Built With(back to top)Getting StartedPrerequisites>=3.8, <3.11For Docker Install:For Local Install:InstallationPyPIInstall package via pippipinstallpyoats❗ Installing using an environment manager such asconda,venv, andpoetryis highly encouraged as this package contains deep learning frameworks.DockerClone the repogitclonehttps://github.com/georgian-io/pyoats.git&&cdpyoatsBuild imagedockerbuild-tpyoats.Run Container# CPU Onlydockerrun-itpyoats# with GPUdockerrun-it--gpusallpyoatsLocalClone the repogitclonehttps://github.com/georgian-io/pyoats.git&&cdpyoatsInstall via Poetrypoetryinstall(back to top)UsageQuick StartFor a quick start, please refer toour blogor copy ourColab notebook!Getting Anomaly Scorefromoats.modelsimportNHiTSModelmodel=NHiTSModel(window=20,use_gpu=True)model.fit(train)scores=model.get_scores(test)Getting Thresholdfromoats.thresholdimportQuantileThresholdt=QuantileThreshold()threshold=t.get_threshold(scores,0.99)anom=scores>thresholdFor more examples, please refer to theDocumentation(back to top)ModelsFor more details about the individual models, please refer to theDocumentationorthis blogfor deeper explanation.ModelTypeMultivariate Support*Requires FittingDL Framework DependencyPaperReference ModelARIMAPredictive⚠️✅statsmodels.ARIMAFluxEVPredictive⚠️✅📝LightGBMPredictive⚠️✅darts.LightGBMMoving AveragePredictive⚠️N-BEATSPredictive✅✅📝darts.NBEATSN-HiTSPredictive✅✅📝darts.NHiTSRandomForestPredictive⚠️✅darts.RandomForestRegressionPredictive⚠️✅darts.RegressionRNNPredictive✅✅darts.RNNTemporal Convolution NetworkPredictive✅✅📝darts.TCNTemporal Fusion TransformersPredictive✅✅📝darts.TFTTransformerPredictive✅✅📝darts.TransformerIsolation ForestDistance-Based✅✅pyod.IForestMatrix ProfileDistance-Based✅📝stumpyTranADReconstruction-Based✅✅📝tranadVariational AutoencoderReconstruction-Based✅✅📝pyod.VAEQuantileRule-Based⚠️*For models with ⚠️, score calculation is done separately along each column. This implicitly assumes independence of covariates, which means thatthe resultant anomaly scores do not take into account of inter-variable dependency structures.(back to top)RoadmapAutomatic hyper-parameter tuningMore examplesMore preprocessorsMore models frompyodSee theopen issuesfor a full list of proposed features (and known issues).(back to top)ContributingContributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make aregreatly appreciated.If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".Don't forget to give the project a star! Thanks again!Fork the ProjectCreate your Feature Branch (git checkout -b feature/amazing_feature)Commit your Changes (git commit -m 'Add some amazing_feature')Push to the Branch (git push origin feature/amazing_feature)Open a Pull Request(back to top)LicenseDistributed under the Apache 2.0 License. SeeLICENSEfor more information.(back to top)ContactBenjamin YeProject Link:https://github.com/georgian-io/oats(back to top)AcknowledgmentsI would like to thank my colleagues from Georgian for all the help and advice provided along the way.Angeline YasodharaAkshay BudhkarBorna AlmasiParinaz SobhaniRodrigo Ceballos LentiniI'd also like to extend my gratitude to all the contributors atDarts(for time series predictions) andPyOD(for general outlier detection), whose projects have enabled a straight-forward extension into the domain of time series anomaly detection.Finally, it'll be remiss of me to not mentionDATA Lab @ Rice University, whose wonderfulTODSpackage served as a major inspiration for this project. Please check them out especially if you're looking for AutoML support.(back to top)