Turi Create  4.0
xgboost_exporter.hpp
1 /* Copyright © 2017 Apple Inc. All rights reserved.
2  *
3  * Use of this source code is governed by a BSD-3-clause license that can
4  * be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
5  */
6 #ifndef COREML_XGBOOST_EXPORTER
7 #define COREML_XGBOOST_EXPORTER
8 
9 #include <map>
10 #include <memory>
11 #include <string>
12 #include <vector>
13 
14 #include <ml/ml_data/metadata.hpp>
15 #include <toolkits/coreml_export/mlmodel_wrapper.hpp>
16 
17 namespace turi {
18 
19 std::shared_ptr<coreml::MLModelWrapper> export_xgboost_model(
20  const std::shared_ptr<ml_metadata>& metadata,
21  const std::vector<std::string>& trees_as_json_dump,
22  bool is_classifier, bool is_random_forest,
23  const std::map<std::string, flexible_type>& context);
24 
25 // Simplified version of the above, with exported symbol visibility so that
26 // extensions can link to it.
27 void EXPORT export_xgboost_model(const std::string& filename,
28  const std::shared_ptr<ml_metadata>& metadata,
29  const std::vector<std::string>& trees_as_json_dump,
30  bool is_classifier, bool is_random_forest,
31  const std::map<std::string, flexible_type>& context);
32 
33 }
34 
35 #endif