Triển khai một pipeline active learning
Trong bài tập này, bạn sẽ thiết lập một active learner sử dụng mô hình logistic regression và chiến lược uncertainty sampling.
Bộ dữ liệu đã được nạp với X_labeled cho dữ liệu huấn luyện đã gán nhãn, X_unlabeled cho dữ liệu huấn luyện chưa gán nhãn, và y_labeled cho nhãn.
Các thư viện cần thiết đã được nhập: ActiveLearner từ modAL.models, uncertainty_sampling từ modAL.uncertainty và LogisticRegression từ sklearn.linear_model.
Bài tập này là một phần của khóa học
Reinforcement Learning from Human Feedback (RLHF)
Hướng dẫn bài tập
- Khởi tạo một đối tượng
ActiveLearner. - Dùng LogisticRegression làm estimator.
- Dùng uncertainty sampling làm query strategy.
- Khởi tạo learner với dữ liệu huấn luyện đã gán nhãn.
Bài tập tương tác thực hành trực tiếp
Hãy thử làm bài tập này bằng cách hoàn thành đoạn mã mẫu này.
# Create the active learner object
learner = ____(
# Set the estimator
____,
# Set the query strategy
____,
# Pass the labeled data
X_training=____, y_training=____
)