Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can you provide documentation on C API best practices? #6261

Open
limingyao001 opened this issue Jan 9, 2024 · 2 comments
Open

Can you provide documentation on C API best practices? #6261

limingyao001 opened this issue Jan 9, 2024 · 2 comments
Labels

Comments

@limingyao001
Copy link

limingyao001 commented Jan 9, 2024

I need to call its C api when using this algorithm, but I haven't found a complete usage document or interface document, which makes it difficult to use its C interface perfectly.

@limingyao001 limingyao001 changed the title Can you provide documentation on the best times for the C API? Can you provide documentation on C API best practices? Jan 9, 2024
@limingyao001
Copy link
Author

LIGHTGBM_C_EXPORT int LGBM_DatasetCreateFromMat(const void *data, int data_type, int32_t nrow, int32_t ncol, int is_row_major, const char *parameters, const DatasetHandle reference, DatasetHandle *out)

In this interface, is the first parameter a one-dimensional array? What is his situation like? For example, my training set has four sample points, feature 1 is 2, 3, 4, and 6, and feature 2 is 100, 105, 321, and 134 respectively. So is the first parameter data [2,3,4,6,100,105,321,134] or a two-dimensional array?

@guolinke
Copy link
Collaborator

You can refer to our test for c_api: https://github.com/microsoft/LightGBM/blob/master/tests/c_api_test/test_.py
You can also check how we use these apis in python/R packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants