Dữ liệu phù hợp cho rừng quyết định
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Rừng quyết định hiệu quả nhất khi bạn có một tập dữ liệu dạng bảng (dữ liệu bạn có thể trình bày trong bảng tính, tệp csv hoặc bảng cơ sở dữ liệu). Dữ liệu dạng bảng là một trong những định dạng dữ liệu phổ biến nhất và rừng quyết định sẽ là giải pháp "ưu tiên" để lập mô hình dữ liệu dạng bảng.
Bảng 1. Ví dụ về tập dữ liệu dạng bảng.
Số chặng |
Số mắt |
Trọng lượng (pound) |
Loài (nhãn) |
2 | 2 | 12 | Chim cánh cụt |
8 | 6 | 0,1 | Nhện |
4 | 2 | 44 | Chó |
… | … | … | … |
Không giống như mạng nơron, rừng quyết định sử dụng dữ liệu dạng bảng của mô hình ngay từ đầu.
Khi phát triển rừng quyết định, bạn không phải làm những việc như sau:
- Thực hiện xử lý trước như chuẩn hoá đặc điểm hoặc mã hoá một nóng.
- Thực hiện tính năng nội suy (ví dụ: thay thế giá trị bị thiếu bằng
-1
).
Tuy nhiên, rừng quyết định không phù hợp để trực tiếp sử dụng dữ liệu không ở dạng bảng (còn gọi là dữ liệu không có cấu trúc), chẳng hạn như hình ảnh hoặc văn bản. Có, có các giải pháp cho hạn chế này, nhưng mạng nơron thường xử lý dữ liệu không có cấu trúc tốt hơn.
Rừng quyết định có khả năng lấy mẫu hiệu quả. Tức là rừng quyết định rất phù hợp để huấn luyện trên các tập dữ liệu nhỏ hoặc trên các tập dữ liệu có tỷ lệ số lượng đặc điểm / số lượng ví dụ cao (có thể lớn hơn 1). Mặc dù rừng quyết định có thể lấy mẫu hiệu quả, nhưng giống như tất cả các mô hình học máy, rừng quyết định hoạt động hiệu quả nhất khi có nhiều dữ liệu.
Rừng quyết định thường suy luận nhanh hơn so với các mạng nơron tương đương. Ví dụ: một rừng quyết định cỡ trung bình chạy quy trình suy luận trong vài
micro giây trên một CPU hiện đại.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-27 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-27 UTC."],[[["\u003cp\u003eDecision forests are highly effective for modeling tabular data, making them a primary choice for datasets commonly found in spreadsheets, CSV files, or databases.\u003c/p\u003e\n"],["\u003cp\u003eUnlike neural networks, decision forests directly handle tabular data without requiring preprocessing steps like feature normalization or imputation.\u003c/p\u003e\n"],["\u003cp\u003eWhile decision forests can be adapted for non-tabular data like images or text, neural networks are generally better suited for such data types.\u003c/p\u003e\n"],["\u003cp\u003eDecision forests are sample efficient, performing well even with small datasets or those with a high feature-to-example ratio, but still benefit from larger datasets.\u003c/p\u003e\n"],["\u003cp\u003eDecision forests offer faster inference speeds compared to neural networks, typically completing predictions within microseconds on modern CPUs.\u003c/p\u003e\n"]]],[],null,["\u003cbr /\u003e\n\nDecision forests are most effective when you have a tabular dataset (data you\nmight represent in a spreadsheet, csv file, or database table). Tabular data is\none of the most common data formats, and decision forests should be your \"go-to\"\nsolution for modeling it.\n\n**Table 1. An example of a tabular dataset.**\n\n| Number of legs | Number of eyes | Weight (lbs) | Species (label) |\n|----------------|----------------|--------------|-----------------|\n| 2 | 2 | 12 | Penguin |\n| 8 | 6 | 0.1 | Spider |\n| 4 | 2 | 44 | Dog |\n| ... | ... | ... | ... |\n\nUnlike neural networks, decision forests natively consume model tabular data.\nWhen developing decision forests, you don't have to do tasks like the following:\n\n- Perform preprocessing like feature normalization or one-hot encoding.\n- Perform imputation (for example, replacing a missing value with `-1`).\n\nHowever, decision forests are not well suited to directly consume non-tabular\ndata (also called unstructured data), such as images or text. Yes, workarounds\nfor this limitation do exist, but neural networks generally handle unstructured\ndata better.\n\nPerformance\n\nDecision forests are sample efficient. That is, decision forests are well suited\nfor training on small datasets, or on datasets where the ratio of number of\nfeatures / number of examples is high (possibly greater than 1). Even though\ndecision forests are sample efficient, like all machine learning models,\ndecision forests perform best when lots of data is available.\n\nDecision forests typically infer faster than comparable neural\nnetworks. For example, a medium-size decision forest runs inference in a few\nmicroseconds on a modern CPU."]]