# Install TF-DF !pip install tensorflow tensorflow_decision_forests # Load TF-DF import tensorflow_decision_forests as tfdf import pandas as pd # Load a dataset in a Pandas dataframe. train_df = pd.read_csv("project/train.csv") test_df = pd.read_csv("project/test.csv") # Convert the dataset into a TensorFlow dataset. train_ds = tfdf.keras.pd_dataframe_to_tf_dataset(train_df, label="my_label") test_ds = tfdf.keras.pd_dataframe_to_tf_dataset(test_df, label="my_label") # Train a Random Forest model. model = tfdf.keras.RandomForestModel() model.fit(train_ds) # Summary of the model structure. model.summary() # Evaluate the model. model.evaluate(test_ds) # Export the model to a SavedModel. model.save("project/model")
TensorFlow Decision Forests ( TF-DF ) เป็นไลบรารีสำหรับฝึก เรียกใช้ และตีความโมเดลฟอ เรสต์การตัดสินใจ (เช่น Random Forests, Gradient Boosted Trees) ใน TensorFlow TF-DF รองรับการจำแนก การถดถอย การจัดอันดับ และการยกระดับ มีให้บริการบน Linux และ Mac ผู้ใช้ Window สามารถใช้ WSL+Linux
TF-DF ขับเคลื่อนโดย Yggdrasil Decision Forest ( YDF ) ซึ่งเป็นไลบรารีสำหรับฝึกและใช้ฟอเรสต์การตัดสินใจใน c++, JavaScript, CLI และ Go รุ่น TF-DF เข้ากันได้ กับรุ่น YDF และในทางกลับกัน
คำสำคัญ: Decision Forests, TensorFlow, Random Forest, Gradient Boosted Trees, CART, การตีความโมเดล
เอกสารและแหล่งข้อมูล
มีแหล่งข้อมูลดังต่อไปนี้:
- คู่มือและแบบฝึกหัด
- การอ้างอิง API
- เอกสาร YDF (ใช้ได้กับ TF-DF ด้วย)
- ชั้นเรียน Google Developers เกี่ยวกับฟอเรสต์การตัดสินใจ
- ใช้ Simple ML สำหรับชีตเพื่อฝึกโมเดลใน Google ชีตของคุณ
ชุมชน
บริจาค
ยินดีต้อนรับการมีส่วนร่วมใน TensorFlow Decision Forests และ Yggdrasil Decision Forests หากคุณต้องการมีส่วนร่วม อย่าลืมอ่าน คู่มือสำหรับนักพัฒนาซอฟต์แวร์