public DocumentAnomalyDetector(DocumentBlock document, IAnomalyFilterFactory factory, IDocumentReconstructor reconstructor, int windowSize = 3) { this.document = document ?? throw new ArgumentNullException(nameof(document)); this.factory = factory ?? throw new ArgumentNullException(nameof(factory)); this.reconstructor = reconstructor ?? throw new ArgumentNullException(nameof(reconstructor)); WindowSize = windowSize; }
public SvmModelStorage(ILoggerFactory factory, IDocumentVectorSource vectorSource, IDocumentReconstructor reconstructor) { this.vectorSource = vectorSource ?? throw new ArgumentNullException(nameof(vectorSource)); this.factory = factory ?? throw new ArgumentNullException(nameof(factory)); this.reconstructor = reconstructor ?? throw new ArgumentNullException(nameof(reconstructor)); logger = factory.CreateLogger <SvmModelStorage>(); }
public void SetUp() { loggerFactory = new NullLoggerFactory(); vectorSource = new EmbeddingVectorSource(WordModel.Load(Path.Combine(TestContext.CurrentContext.TestDirectory, @"Data\model.bin"))); documentReconstructor = new DocumentReconstructor(); documents = JsonConvert.DeserializeObject <Document[]>(File.ReadAllText(Path.Combine(TestContext.CurrentContext.TestDirectory, "Data", "docs.json"))); instance = CreateModelStorage(); }
public SvmModelStorageFactory(ILoggerFactory factory, IDocumentVectorSource vectorSource, IDocumentReconstructor reconstructor, StorageConfig config) { this.factory = factory ?? throw new ArgumentNullException(nameof(factory)); this.vectorSource = vectorSource ?? throw new ArgumentNullException(nameof(vectorSource)); this.reconstructor = reconstructor ?? throw new ArgumentNullException(nameof(reconstructor)); this.config = config ?? throw new ArgumentNullException(nameof(config)); if (config.Location == null) { throw new ArgumentNullException(nameof(config.Location)); } }