phylanx icon indicating copy to clipboard operation
phylanx copied to clipboard

randomforest algorithm numpy and cpp primitive

Open ct-clmsn opened this issue 7 years ago • 5 comments

work in progress - pushed into phylanx upstream/master for review and commentary.

ct-clmsn avatar Nov 30 '18 02:11 ct-clmsn

~the phylanx primitive needs more argument checking, the primitive implementation needs to be cleaned up (it's borrowed code from lra), and testing work...among other things (the phylanx cpp code formatting linter will break on this cpp code)!~ where should cpp unit test code go? @justwagle @scheherzade

ct-clmsn avatar Nov 30 '18 02:11 ct-clmsn

will need to add support for the following capabilities

  • [x] implement training/prediction for randomforest
  • [x] implement model store/load into/from phylanx::ir::dictionary
  • [x] implement 'randomforest_fit' and 'randomforest_predict' functions in primitive
  • [x] implement c++ unit test
  • [x] implement python numpy unit test
  • [ ] implement python phylanx unit test

ct-clmsn avatar Dec 04 '18 22:12 ct-clmsn

where should cpp unit test code go?

@ct-clmsn what about adding it here: https://github.com/STEllAR-GROUP/phylanx/tree/master/tests/unit/algorithm?

hkaiser avatar Dec 05 '18 23:12 hkaiser

will try to modify the implementation to use primitive types.

ct-clmsn avatar Dec 09 '18 21:12 ct-clmsn

@hkaiser think the issue storing trained randomforest models is resolved. Two primitives have been added into this plugin, one to 'fit' (train) a model and another to do prediction. Trained models are converted into a tree composed of phylanx::ir::dictionary instances after training. The trained phylanx::ir::dictionary tree is the first parameter in the prediction function.

ct-clmsn avatar Dec 17 '18 01:12 ct-clmsn