yggdrasil decision forests
Python API 0.9.0

YDF (Yggdrasil決策林)是一個培訓,評估,解釋和服務隨機森林,梯度促進決策樹,購物車和隔離森林模型的圖書館。
有關YDF的更多信息,請參見文檔。
要從PYPI安裝YDF,請運行:
pip install ydf -U import ydf
import pandas as pd
# Load dataset with Pandas
ds_path = "https://raw.githubusercontent.com/google/yggdrasil-decision-forests/main/yggdrasil_decision_forests/test_data/dataset/"
train_ds = pd . read_csv ( ds_path + "adult_train.csv" )
test_ds = pd . read_csv ( ds_path + "adult_test.csv" )
# Train a Gradient Boosted Trees model
model = ydf . GradientBoostedTreesLearner ( label = "income" ). train ( train_ds )
# Look at a model (input features, training logs, structure, etc.)
model . describe ()
# Evaluate a model (e.g. roc, accuracy, confusion matrix, confidence intervals)
model . evaluate ( test_ds )
# Generate predictions
model . predict ( test_ds )
# Analyse a model (e.g. partial dependence plot, variable importance)
model . analyze ( test_ds )
# Benchmark the inference speed of a model
model . benchmark ( test_ds )
# Save the model
model . save ( "/tmp/my_model" )用C ++ API的示例。
auto dataset_path = " csv:train.csv " ;
// List columns in training dataset
DataSpecification spec;
CreateDataSpec (dataset_path, false , {}, &spec);
// Create a training configuration
TrainingConfig train_config;
train_config.set_learner( " RANDOM_FOREST " );
train_config.set_task(Task::CLASSIFICATION);
train_config.set_label( " my_label " );
// Train model
std::unique_ptr<AbstractLearner> learner;
GetLearner (train_config, &learner);
auto model = learner-> Train (dataset_path, spec);
// Export model
SaveModel ( " my_model " , model.get());(基於示例/初學者)
檢查入門教程?
如果您在科學出版物中我們的Yggdrasil決策森林,請引用以下論文:Yggdrasil決策森林:快速且可擴展的決策森林圖書館。
Bibtex
@inproceedings{GBBSP23,
author = {Mathieu Guillame{-}Bert and
Sebastian Bruch and
Richard Stotz and
Jan Pfeifer},
title = {Yggdrasil Decision Forests: {A} Fast and Extensible Decision Forests
Library},
booktitle = {Proceedings of the 29th {ACM} {SIGKDD} Conference on Knowledge Discovery
and Data Mining, {KDD} 2023, Long Beach, CA, USA, August 6-10, 2023},
pages = {4068--4077},
year = {2023},
url = {https://doi.org/10.1145/3580305.3599933},
doi = {10.1145/3580305.3599933},
}
生的
Yggdrasil決策森林:一個快速而可擴展的決策森林圖書館,Guillame-Bert等,KDD 2023:4068-4077。 doi:10.1145/3580305.3599933
您可以通過[email protected]與核心開發團隊聯繫。
Yggdrasil的決策森林和Tensorflow決策森林的開發是:
歡迎對Tensorflow決策森林和Yggdrasil決策森林的貢獻。如果您想貢獻,請檢查貢獻指南。
Apache許可證2.0