diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-08-03 13:33:04 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-08-03 13:33:04 +0100 |
commit | 2eafa1650e51feb9715ec21f3562b75a0fc1a008 (patch) | |
tree | 56ba51e5ad2d987b0d63cc8b16adb14f9ed94d30 /src | |
parent | ab77b3398b3462776c4404291a9bdb4ee1b67365 (diff) | |
download | rspamd-2eafa1650e51feb9715ec21f3562b75a0fc1a008.tar.gz rspamd-2eafa1650e51feb9715ec21f3562b75a0fc1a008.zip |
[Project] Cleanup the redis script
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/lua/neural.lua | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/src/plugins/lua/neural.lua b/src/plugins/lua/neural.lua index 41a9b4f07..fcf9ac5c2 100644 --- a/src/plugins/lua/neural.lua +++ b/src/plugins/lua/neural.lua @@ -114,36 +114,6 @@ local redis_lua_script_vectors_len = [[ if ret then nham = tonumber(ret) end return {nspam,nham} - - if KEYS[2] == 'spam' then - if nspam <= lim then - if nspam > nham then - -- Apply sampling - local skip_rate = 1.0 - nham / (nspam + 1) - if coin < skip_rate - classes_bias then - return {tostring(-(nspam)),'sampled out with probability ' .. tostring(skip_rate - classes_bias)} - end - end - return {tostring(nspam),'can learn'} - else -- Enough learns - return {tostring(-(nspam)),'too many spam samples'} - end - else - if nham <= lim then - if nham > nspam then - -- Apply sampling - local skip_rate = 1.0 - nspam / (nham + 1) - if coin < skip_rate - classes_bias then - return {tostring(-(nham)),'sampled out with probability ' .. tostring(skip_rate - classes_bias)} - end - end - return {tostring(nham),'can learn'} - else - return {tostring(-(nham)),'too many ham samples'} - end - end - - return {tostring(-1),'bad input'} ]] local redis_lua_script_vectors_len_id = nil |