adviserl got a gen_server API
Until now, to access a remote node running adviserl, you could use the native Erlang RPC:
I added a gen_server API to do exactly the same thing:
This is not simpler, but not more complicated either, and hopefully this will be more flexible when coming to distribution (the API may then become a global process).
I also added a bunch of shell script to start, stop, rate, or run prediction from command line. The start-stop script (adv.sh) is quite usefull, while the others are convenient when debugging. Those scripts have yet to be documented :( but are more or less straightforward and have a minimum help message when bad options or bad arguments are given.
I think my next post on adviserl will show a more useful example! :)
erlang> rpc:call(adviserl_node@localhost, adviserl, rate, [1, 2, {3,nodata}]).I added a gen_server API to do exactly the same thing:
erlang> gen_server:call({adv_api, adviserl_node@localhost}, {rate, 1, 2, {3,nodata}}).This is not simpler, but not more complicated either, and hopefully this will be more flexible when coming to distribution (the API may then become a global process).
I also added a bunch of shell script to start, stop, rate, or run prediction from command line. The start-stop script (adv.sh) is quite usefull, while the others are convenient when debugging. Those scripts have yet to be documented :( but are more or less straightforward and have a minimum help message when bad options or bad arguments are given.
shell> ./bin/adv.sh start
shell> ./bin/adv-rate.sh 1 2 2 # user 1 rate item 2 with score 2
shell> ./bin/adv-rate.sh 1 3 3 # ...
shell> ./bin/adv-rate.sh 2 3 3
shell> ./bin/adv-rate.sh 2 4 4
shell> ./bin/adv-rate.sh 3 3 3
shell> ./bin/adv-getratings.sh 1
3 3
2 2
shell> ./bin/adv-recommendall-source.sh 3 # prediction for user 3
4 4.00000
2 2.00000I think my next post on adviserl will show a more useful example! :)
Post imported from wordpress
Please refer to original post for earlier comments.