{"schemaVersion":1,"resourceType":"connector","slug":"lightgbm","name":"LightGBM","catalog":"lightgbm","description":"Train, tune, evaluate, and explain gradient-boosted classifiers and regressors, with a saved-model registry","language":"Python","categories":["analytics"],"repository":"https://github.com/Query-farm/vgi-lightgbm","license":"MIT","generatedAt":"2026-12-01T18:22:16+00:00","runtime":{"engineVersion":"2.0.1","protocolVersion":"3.4"},"release":{"tag":"v0.2.0","publishedAt":"2026-11-25T17:55:27Z","url":"https://github.com/Query-farm/vgi-lightgbm/releases/tag/v0.2.0"},"links":{"html":"https://query.farm/products/orchard/connectors/lightgbm/","llms":"https://query.farm/products/orchard/connectors/lightgbm/llms.txt","markdown":"https://query.farm/products/orchard/connectors/lightgbm/index.md","json":"https://query.farm/products/orchard/api/v1/connectors/lightgbm.json","objects":"https://query.farm/products/orchard/api/v1/connectors/lightgbm/objects.json","search":"https://query.farm/products/orchard/api/v1/search.json?kind=object&connector=lightgbm&q={query}"},"authentication":{"mode":"none_declared","guidance":"No service credentials are declared by this connector. Individual datasets, input files or deployments may have their own prerequisites.","interpretation":"Secret parameter required flags describe the upstream declaration; they do not override the service-level mode above. Keep secrets in environment variables or the deployment secret store. SQL values in angle brackets are placeholders, not automatic environment lookups. Native DuckDB and Haybarn 2.0.1 do not provide a SQL getenv() function, even when worker-supplied snippets mention it. Read environment variables in your application and pass credential values through client parameter bindings (for example, Python con.execute(\"CREATE SECRET stripe (TYPE stripe, api_key ?)\", [os.environ[\"STRIPE_API_KEY\"]]) after attaching the connector. Omit unused optional parameters and keep real values out of saved SQL and logs.","secrets":[]},"deployment":{"local":{"methods":[{"id":"uvx","label":"uv","icon":"simple-icons:python","steps":[{"title":"Attach with uv","description":"Needs uv. uv fetches the worker script and its package at the release tag on first attach and reuses the cached environment after that.","lang":"sql","code":"ATTACH 'lightgbm' AS lightgbm (\n  TYPE vgi,\n  LOCATION 'uv run --with git+https://github.com/Query-farm/vgi-lightgbm@v0.2.0 https://raw.githubusercontent.com/Query-farm/vgi-lightgbm/v0.2.0/lightgbm_worker.py'\n);"}]},{"id":"docker","label":"Docker","icon":"simple-icons:docker","steps":[{"title":"Attach the signed image","description":"Needs Docker, Podman or another OCI runtime. The extension runs the container and talks to it over stdio.","lang":"sql","code":"ATTACH 'lightgbm' AS lightgbm (\n  TYPE vgi,\n  LOCATION 'oci://ghcr.io/query-farm/vgi-lightgbm:0.2.0'\n);"}]}],"pinnedMethods":[{"id":"uvx","label":"uv","icon":"simple-icons:python","steps":[{"title":"Attach with uv","description":"Needs uv. uv fetches the worker script and its package at the release tag on first attach and reuses the cached environment after that.","lang":"sql","code":"ATTACH 'lightgbm' AS lightgbm (\n  TYPE vgi,\n  LOCATION 'uv run --with git+https://github.com/Query-farm/vgi-lightgbm@v0.2.0 https://raw.githubusercontent.com/Query-farm/vgi-lightgbm/v0.2.0/lightgbm_worker.py'\n);"}]},{"id":"docker","label":"Docker","icon":"simple-icons:docker","steps":[{"title":"Attach the signed image","description":"Needs Docker, Podman or another OCI runtime. The extension runs the container and talks to it over stdio.","lang":"sql","code":"ATTACH 'lightgbm' AS lightgbm (\n  TYPE vgi,\n  LOCATION 'oci://ghcr.io/query-farm/vgi-lightgbm:0.2.0'\n);"}]}]},"selfHost":{"instructions":"https://github.com/Query-farm/vgi-lightgbm","connectionGuide":"https://query.farm/vgi/connect-to-a-worker/","guidance":"Deploy using the connector repository instructions and use its supported HTTP or SSH transport. Replace example URLs with your actual deployment; configure its authentication."},"queryFarm":{"available":true,"console":"https://auth.queryfarm.cloud/console/new?worker=lightgbm","organizationMonthlyMinimumUsd":10,"pricing":"https://query.farm/products/orchard/hosted/"},"publicDemo":null},"setup":{"extensions":{"duckdb":"SET allow_extension_repositories = 'allowed';\n\nCREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm\n    WITH PREFIX 'https://duckdb-extensions.query.farm';\n\nINSTALL vgi FROM query_farm;\nLOAD vgi FROM query_farm;","haybarn":"INSTALL vgi FROM community;\nLOAD vgi;"},"attachSql":"ATTACH 'lightgbm' AS lightgbm (\n  TYPE vgi,\n  LOCATION 'uv run --with git+https://github.com/Query-farm/vgi-lightgbm@v0.2.0 https://raw.githubusercontent.com/Query-farm/vgi-lightgbm/v0.2.0/lightgbm_worker.py'\n);","attachOptions":[],"note":"Install and load VGI, attach the connector using the catalog alias shown here, then create required secrets. Replace placeholders and omit unused optional secret parameters. Satisfy file, network and credential prerequisites before executing a query."},"example":{"title":"See where a classifier gets its predictions right","sql":"SELECT a.target_name AS actual, l.target_name AS predicted, count(*) AS n FROM lightgbm.main.cross_val_predict((SELECT * EXCLUDE (target_name) FROM lightgbm.main.iris()), estimator := 'lgbm_classifier', target := 'target', id := 'sample_id', cv := 5) p JOIN lightgbm.main.iris() a USING (sample_id) JOIN (SELECT DISTINCT target, target_name FROM lightgbm.main.iris()) l ON l.target = p.prediction GROUP BY actual, predicted ORDER BY actual, predicted;","requiresCredentials":null,"note":null,"objects":[{"name":"lightgbm.main.cross_val_predict","kind":"table_in_out_function","links":{"html":"https://query.farm/products/orchard/connectors/lightgbm/#obj-main-cross_val_predict","markdown":"https://query.farm/products/orchard/connectors/lightgbm/objects/table_in_out_function.bWFpbg.Y3Jvc3NfdmFsX3ByZWRpY3Q.md","json":"https://query.farm/products/orchard/api/v1/connectors/lightgbm/objects/table_in_out_function.bWFpbg.Y3Jvc3NfdmFsX3ByZWRpY3Q.json"}}],"evidence":{"status":"captured_result","capturedAt":"2026-12-01T06:21:29+00:00","engineVersion":"2.0.1","protocolVersion":"3.4.0","releaseTag":"v0.2.0","sample":{"columns":["actual","predicted","n"],"types":["VARCHAR","VARCHAR","BIGINT"],"rows":[["setosa","setosa",50],["versicolor","versicolor",46],["versicolor","virginica",4],["virginica","versicolor",6],["virginica","virginica",44]],"more":false}},"artifact":null},"objects":{"total":22,"index":"https://query.farm/products/orchard/api/v1/connectors/lightgbm/objects.json","search":"https://query.farm/products/orchard/api/v1/search.json?kind=object&connector=lightgbm&q={query}"},"agentTasks":["How many flowers of each species are in the built-in iris dataset? Return one row per species with columns named target_name and n, ordered by target_name.","How many wine samples are in the built-in wine-recognition dataset? Return a single row with one column named n.","Before trusting a tumour-screening model I need an honest out-of-sample number. Using the built-in Wisconsin breast-cancer data and all 30 cell-nucleus features, run 5-fold cross-validation with a LightGBM classifier and report the mean held-out accuracy. Round to 4 decimals and return a single row with one column named mean_cv_accuracy.","In the built-in California housing data, which one-degree latitude band (round the latitude to the nearest whole degree) has the highest average median house value? Return a single row with one column named lat.","Fit a LightGBM regressor on the diabetes dataset to predict the one-year progression score from the baseline measurements, then score those same rows with the fitted model and report the root-mean-squared error between the predictions and the actual scores. Round to 2 decimals and return a single row with one column named train_rmse.","I want a leakage-free accuracy for a LightGBM classifier on iris: predict every row from a model trained on the other folds (5 folds), then compare those out-of-fold predictions with the true labels. Round to 4 decimals and return a single row with one column named oof_accuracy.","I'm tuning a LightGBM classifier on iris. Sweep num_leaves over 7, 15 and 31 and learning_rate over 0.05 and 0.1 with 5-fold cross-validation, and report the best mean cross-validated accuracy across all those combinations. Round to 4 decimals and return a single row with one column named best_cv_accuracy.","The full grid is too big to sweep, so sample it instead: on iris, try 4 randomly chosen combinations of num_leaves (7, 15, 31, 63) and learning_rate (0.03, 0.05, 0.1, 0.2) with 3-fold cross-validation, using 42 as the sampling seed. How many combinations end up on the leaderboard? Return a single row with one column named n_combos."],"provenance":{"generatedAt":"2026-12-01T18:22:16+00:00","repository":"https://github.com/Query-farm/vgi-lightgbm","harvest":{"status":"ok","method":"subprocess","error":null,"vgi_version":"9773130dde"},"catalogVerification":{"verified":true,"status":"passed","total":5,"passed":5,"failed":0,"needs_credentials":0,"location":"uv run --with git+https://github.com/Query-farm/vgi-lightgbm@v0.2.0 https://raw.githubusercontent.com/Query-farm/vgi-lightgbm/v0.2.0/lightgbm_worker.py","transport":"subprocess","environment":{"vgi_extension_version":"9773130dde","haybarn_version":"2.0.1rc3","engine_version":"v2.0.1","python":"3.12.4","platform":"darwin_arm64","protocol_version":"3.4.0"},"checked_at":"2026-12-01T06:19:43+00:00"},"interpretation":"Catalog verification records the harvest environment. It is not proof that every query or current live API call succeeds. Only an example with captured_result has a saved result for that exact SQL."},"interpretation":["Missing, null, or undeclared metadata means unknown; do not invent defaults, credential scope, platform support or endpoint URLs.","Search is keyword retrieval, not proof of a capability. Read the exact object declaration before generating SQL.","A table and a table function can have the same name. Preserve parentheses and use the matching overload and schema.","Service credentials, external data availability and deployment authentication are separate requirements."]}