From: Vsevolod Stakhov Date: Fri, 28 Aug 2020 16:40:13 +0000 (+0100) Subject: [Test] Add neural PCA tests X-Git-Tag: 2.6~99 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b562090c505b1cd9dd5d71734b6744b34c02f05c;p=rspamd.git [Test] Add neural PCA tests --- diff --git a/test/functional/cases/330_neural.robot b/test/functional/cases/330_neural.robot index a9a338f95..e7f8418ff 100644 --- a/test/functional/cases/330_neural.robot +++ b/test/functional/cases/330_neural.robot @@ -26,13 +26,17 @@ Train Check Neural HAM Sleep 2s Wait for neural to be loaded ${result} = Scan Message With Rspamc ${MESSAGE} --header Settings={symbols_enabled = ["HAM_SYMBOL"];groups_enabled=["neural"];symbols_disabled = ["NEURAL_LEARN"]} - Check Rspamc ${result} NEURAL_HAM_SHORT - Check Rspamc ${result} NEURAL_SPAM_SHORT inverse=1 + Check Rspamc ${result} NEURAL_HAM_SHORT ( + Check Rspamc ${result} NEURAL_SPAM_SHORT ( inverse=1 + Check Rspamc ${result} NEURAL_HAM_SHORT_PCA ( + Check Rspamc ${result} NEURAL_SPAM_SHORT_PCA ( inverse=1 Check Neural SPAM ${result} = Scan Message With Rspamc ${MESSAGE} --header Settings={symbols_enabled = ["SPAM_SYMBOL"];groups_enabled=["neural"];symbols_disabled = ["NEURAL_LEARN"]} - Check Rspamc ${result} NEURAL_SPAM_SHORT - Check Rspamc ${result} NEURAL_HAM_SHORT inverse=1 + Check Rspamc ${result} NEURAL_SPAM_SHORT ( + Check Rspamc ${result} NEURAL_HAM_SHORT ( inverse=1 + Check Rspamc ${result} NEURAL_SPAM_SHORT_PCA ( + Check Rspamc ${result} NEURAL_HAM_SHORT_PCA ( inverse=1 Train INVERSE @@ -46,13 +50,17 @@ Train INVERSE Check Neural HAM INVERSE Sleep 2s Wait for neural to be loaded ${result} = Scan Message With Rspamc ${MESSAGE} --header Settings={symbols_enabled = ["HAM_SYMBOL"];groups_enabled=["neural"]} - Check Rspamc ${result} NEURAL_SPAM_SHORT - Check Rspamc ${result} NEURAL_HAM_SHORT inverse=1 + Check Rspamc ${result} NEURAL_SPAM_SHORT ( + Check Rspamc ${result} NEURAL_SPAM_SHORT_PCA ( + Check Rspamc ${result} NEURAL_HAM_SHORT ( inverse=1 + Check Rspamc ${result} NEURAL_HAM_SHORT_PCA ( inverse=1 Check Neural SPAM INVERSE ${result} = Scan Message With Rspamc ${MESSAGE} --header Settings={symbols_enabled = ["SPAM_SYMBOL"];groups_enabled=["neural"]} - Check Rspamc ${result} NEURAL_HAM_SHORT - Check Rspamc ${result} NEURAL_SPAM_SHORT inverse=1 + Check Rspamc ${result} NEURAL_HAM_SHORT ( + Check Rspamc ${result} NEURAL_HAM_SHORT_PCA ( + Check Rspamc ${result} NEURAL_SPAM_SHORT ( inverse=1 + Check Rspamc ${result} NEURAL_SPAM_SHORT_PCA ( inverse=1 *** Keywords *** Neural Setup diff --git a/test/functional/configs/neural.conf b/test/functional/configs/neural.conf index 0a2ded95e..871a549fe 100644 --- a/test/functional/configs/neural.conf +++ b/test/functional/configs/neural.conf @@ -54,9 +54,23 @@ neural { symbol_spam = "NEURAL_SPAM_SHORT"; symbol_ham = "NEURAL_HAM_SHORT"; ann_expire = 86400; - watch_interval = 0.1; + watch_interval = 0.5; + } + SHORT_PCA { + train { + learning_rate = 0.001; + max_usages = 2; + spam_score = 1; + ham_score = -1; + max_trains = 10; + max_iterations = 250; + } + symbol_spam = "NEURAL_SPAM_SHORT_PCA"; + symbol_ham = "NEURAL_HAM_SHORT_PCA"; + ann_expire = 86400; + watch_interval = 0.5; + max_inputs = 2; } - } allow_local = true;