Commit 3c834faf authored by Carlos Ungil's avatar Carlos Ungil

update to 0.90

parent 5311e4f3
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
......@@ -13,20 +10,18 @@ typedef unsigned long long size_t;
#ifdef __cplusplus
#define XGB_EXTERN_C extern "C"
#include <cstdio>
#include <cstdint>
#else
#define XGB_EXTERN_C
#include <stdio.h>
#include <stdint.h>
#endif
// XGBoost C API will include APIs in Rabit C API
#include <rabit/c_api.h>
#endif // __cplusplus
#if defined(_MSC_VER) || defined(_WIN32)
#define XGB_DLL XGB_EXTERN_C __declspec(dllexport)
#else
#define XGB_DLL XGB_EXTERN_C
#endif
#endif // defined(_MSC_VER) || defined(_WIN32)
// manually define unsigned long
typedef uint64_t bst_ulong; // NOLINT(*)
......@@ -52,7 +47,7 @@ typedef struct { // NOLINT(*)
long* offset; // NOLINT(*)
#else
int64_t* offset; // NOLINT(*)
#endif
#endif // __APPLE__
/*! \brief labels of each instance */
float* label;
/*! \brief weight of each instance, can be NULL */
......@@ -151,23 +146,6 @@ XGB_DLL int XGDMatrixCreateFromCSREx(const size_t* indptr,
size_t nelem,
size_t num_col,
DMatrixHandle* out);
/*!
* \deprecated
* \brief create a matrix content from CSR format
* \param indptr pointer to row headers
* \param indices findex
* \param data fvalue
* \param nindptr number of rows in the matrix + 1
* \param nelem number of nonzero elements in the matrix
* \param out created dmatrix
* \return 0 when success, -1 when failure happens
*/
XGB_DLL int XGDMatrixCreateFromCSR(const bst_ulong *indptr,
const unsigned *indices,
const float *data,
bst_ulong nindptr,
bst_ulong nelem,
DMatrixHandle *out);
/*!
* \brief create a matrix content from CSC format
* \param col_ptr pointer to col headers
......@@ -186,23 +164,7 @@ XGB_DLL int XGDMatrixCreateFromCSCEx(const size_t* col_ptr,
size_t nelem,
size_t num_row,
DMatrixHandle* out);
/*!
* \deprecated
* \brief create a matrix content from CSC format
* \param col_ptr pointer to col headers
* \param indices findex
* \param data fvalue
* \param nindptr number of rows in the matrix + 1
* \param nelem number of nonzero elements in the matrix
* \param out created dmatrix
* \return 0 when success, -1 when failure happens
*/
XGB_DLL int XGDMatrixCreateFromCSC(const bst_ulong *col_ptr,
const unsigned *indices,
const float *data,
bst_ulong nindptr,
bst_ulong nelem,
DMatrixHandle *out);
/*!
* \brief create matrix content from dense matrix
* \param data pointer to the data space
......@@ -565,7 +527,7 @@ XGB_DLL int XGBoosterGetAttr(BoosterHandle handle,
*
* \param handle handle
* \param key The key of the attribute.
* \param value The value to be saved.
* \param value The value to be saved.
* If nullptr, the attribute would be deleted.
* \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.
......@@ -4,7 +4,7 @@
(defun almost-equal (a b &optional (epsilon 1e-5))
(if (and (listp a) (listp b))
(every #'identity (mapcar #'almost-equal a b))
(every #'identity (mapcar (lambda (a b) (almost-equal a b epsilon)) a b))
(if (and (numberp a) (numberp b))
(or (and (zerop a) (zerop b))
(and (not (zerop a)) (not (zerop b))
......@@ -86,7 +86,7 @@
(5am:test dataset-autoclaims
(5am:is-true (or (probe-file (merge-pathnames "demo/data/autoclaims.csv" *xgboost-path*))
(warn " Rscript get_autoclaims.R in xgboost/demo/data to download the autoclaims dataset"))))
(warn " Rscript gen_autoclaims.R in xgboost/demo/data to download the autoclaims dataset"))))
(5am:test gamma-regression :depends-on 'dataset-autoclaims
(5am:is (almost-equal 2282.969700
......@@ -189,4 +189,5 @@
:eval-metric "logloss" :eval-metric "error"))
(watch-list (list (list test "eval") (list train "train")))
(num-round 2))
(xgb:train booster train num-round :watch-list watch-list :return-evals t)))))
(xgb:train booster train num-round :watch-list watch-list :return-evals t))
1e-4)))
......@@ -10,7 +10,8 @@
(autowrap:c-include '(xgboost ffi "c_api.h") :spec-path '(xgboost ffi))
(cl:let ((library (cl:or (cl:probe-file (cl:merge-pathnames "xgboost/lib/libxgboost.so" (cl:user-homedir-pathname)))
(cl:let ((library (cl:or (cl:probe-file (cl:merge-pathnames "xgboost/lib/xgboost.so" (cl:user-homedir-pathname)))
(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)
......
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