Commit 5311e4f3 authored by Carlos Ungil's avatar Carlos Ungil

upgrade to xgboost 0.81

parent de14b7e1
This source diff could not be displayed because it is too large. You can view the blob instead.
typedef unsigned long long uint64_t;
typedef unsigned long long size_t;
/*!
* Copyright (c) 2015 by Contributors
* \file c_api.h
......@@ -96,6 +99,15 @@ XGB_EXTERN_C typedef int XGBCallbackDataIterNext( // NOLINT(*)
*/
XGB_DLL const char *XGBGetLastError(void);
/*!
* \brief register callback function for LOG(INFO) messages -- helpful messages
* that are not errors.
* Note: this function can be called by multiple threads. The callback function
* will run on the thread that registered it
* \return 0 for success, -1 for failure
*/
XGB_DLL int XGBRegisterLogCallback(void (*callback)(const char*));
/*!
* \brief load a data matrix
* \param fname the name of the file
......@@ -219,6 +231,22 @@ XGB_DLL int XGDMatrixCreateFromMat_omp(const float *data, // NOLINT
bst_ulong nrow, bst_ulong ncol,
float missing, DMatrixHandle *out,
int nthread);
/*!
* \brief create matrix content from python data table
* \param data pointer to pointer to column data
* \param feature_stypes pointer to strings
* \param nrow number of rows
* \param ncol number columns
* \param out created dmatrix
* \param nthread number of threads (up to maximum cores available, if <=0 use all cores)
* \return 0 when success, -1 when failure happens
*/
XGB_DLL int XGDMatrixCreateFromDT(void** data,
const char ** feature_stypes,
bst_ulong nrow,
bst_ulong ncol,
DMatrixHandle* out,
int nthread);
/*!
* \brief create a new dmatrix from sliced content of existing matrix
* \param handle instance of data matrix to be sliced
......@@ -261,7 +289,7 @@ XGB_DLL int XGDMatrixSetFloatInfo(DMatrixHandle handle,
* \brief set uint32 vector to a content in info
* \param handle a instance of data matrix
* \param field field name
* \param array pointer to float vector
* \param array pointer to unsigned int vector
* \param len length of array
* \return 0 when success, -1 when failure happens
*/
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -180,8 +180,8 @@
(xgb:nrow test))))))))
(5am:test evals-result
(5am:is (almost-equal '(("eval" "error" (0.042831 0.042831)) ("eval" "logloss" (0.480386 0.357755))
("train" "error" (0.046522 0.046522)) ("train" "logloss" (0.482541 0.359536)))
(5am:is (almost-equal '(("eval" "error" 0.042831 0.042831) ("eval" "logloss" 0.480386 0.357755)
("train" "error" 0.046522 0.046523) ("train" "logloss" 0.482541 0.359536))
(let* ((train (xgb:read-data-file (merge-pathnames "demo/data/agaricus.txt.train" *xgboost-path*) t))
(test (xgb:read-data-file (merge-pathnames "demo/data/agaricus.txt.test" *xgboost-path*) t))
(booster (xgb:booster :silent 1 :cache (list train test)
......
......@@ -3,8 +3,16 @@
;; to regenerate the autowrap definitions, delete or rename the .spec files
;; requires LLVM/Clang and c2ffi https://github.com/rpav/c2ffi
;; c_api.h is copied from xgboost/include/xgboost
;; you may have to add at the begging of the file the following lines:
;; typedef unsigned long long uint64_t;
;; typedef unsigned long long size_t;
(autowrap:c-include '(xgboost ffi "c_api.h") :spec-path '(xgboost ffi))
(cl:let ((library (cl:merge-pathnames "xgboost/lib/libxgboost.so" (cl:user-homedir-pathname))))
(cffi:load-foreign-library library)
(cl:format cl:t "~%~% Foreign library ~A loaded~%~%~%" library))
(cl:let ((library (cl:or (cl:probe-file (cl:merge-pathnames "xgboost/lib/libxgboost.so" (cl:user-homedir-pathname)))
(cl:probe-file (cl:merge-pathnames "xgboost/lib/libxgboost.dylib" (cl:user-homedir-pathname))))))
(cl:if library
(cl:and (cffi:load-foreign-library library)
(cl:format cl:t "~%~% Foreign library ~A loaded~%~%~%" library))
(cl:error "xgboost library not found, edit wrapper.lisp file")))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment