jubatus / jubatus_core

Jubatus algorithm component
GNU Lesser General Public License v2.1
20 stars 29 forks source link

Add distance weight option to nn regression #352

Closed shiodat closed 7 years ago

shiodat commented 7 years ago

This PR implements #351.

The weight parameter is optional and this PR implements only distance weight option. If uniformor other weight is set, it behaves the same way as the previous version.

I checked the behavior of the distance option using this code. https://gist.github.com/shiodat/e0920ebc299320a6e1630175a38e0bab

The config file changes as follows:

{
    "method": "NN",
    "parameter": {
        "method": "euclid_lsh",
        "nearest_neighbor_num": 8,
        "weight": "distance",  #new parameter(optional)
        "parameter": {
            "hash_num": 512
        }
    }
}
shiodat commented 7 years ago

@TkrUdagawa Thank you for your reviews and I fixed.

I tested using following code. https://gist.github.com/shiodat/7d353903cf5bb8ca495a784fe3f4d151

TkrUdagawa commented 7 years ago

Great Work! Please add a document for this option.