RedisLabsModules / redisml

Machine Learning Model Server
http://redisml.io
Other
305 stars 44 forks source link

Issue with negative leaf value #8

Open nktaushanov opened 6 years ago

nktaushanov commented 6 years ago

There is an issue having negative leaf value when using a Decision tree model (other than -1).

127.0.0.1:6379> ML.FOREST.ADD myforst 0 . NUMERIC 1 0.1 .l LEAF 1 .r LEAF -1
OK
127.0.0.1:6379> ML.FOREST.ADD myforst 1 . NUMERIC 1 0.1 .l LEAF 1 .r LEAF -2
Error: Connection reset by peer

https://github.com/RedisLabsModules/redis-ml/blob/master/src/forest.c#L76

It seems like this is the reason.

nktaushanov commented 6 years ago

This should fix the issue IMO: https://github.com/RedisLabsModules/redis-ml/pull/9

tkrynski commented 6 years ago

@shaynativ this is an important one-line fix... it also prevents a huge memory leak. Please approve? 😄