Use high precision conversion from double to string in Tree::ToString() for new linear tree members (#3938)
Use high precision conversion from double to string in Tree::ToString() for new linear tree members (#3938)

* Fix index out-of-range exception generated by BaggingHelper on small datasets.

Prior to this change, the line "score_t threshold = tmp_gradients[top_k - 1];" would generate an exception, since tmp_gradients would be empty when the cnt input value to the function is zero.

* Update goss.hpp

* Update goss.hpp

* Add API method LGBM_BoosterPredictForMats which runs prediction on a data set given as of array of pointers to rows (as opposed to existing method LGBM_BoosterPredictForMat which requires data given as contiguous array)

* Fix incorrect upstream merge

* Add link to LightGBM.NET

* Fix indenting to 2 spaces

* Dummy edit to trigger CI

* Dummy edit to trigger CI

* remove duplicate functions from merge

* In Tree::ToString() method, print double values for linear tree models with high precision, so that the tree may be accurately reproduced elsewhere (LightGBM.Net in particular)

* Need to use more precise StringToArray instead of StringToArrayFast when parsing double valued arrays for linear trees, to ensure models round-trip via string or file correctly.

Co-authored-by: matthew-peacock <5159e67e5d2f80a6f6f6fc134b64e31065be00ca@whiteoakam.com>
Co-authored-by: Guolin Ke <b6ac6178ceff52d225485c1eb0cc4f42ee586996@outlook.com>
henry0312/LightGBM,microsoft/LightGBM,microsoft/LightGBM,henry0312/LightGBM,microsoft/LightGBM,henry0312/LightGBM,microsoft/LightGBM,henry0312/LightGBM,microsoft/LightGBM,henry0312/LightGBM