peal.teachers.cluster_teacher

Human-in-the-loop teacher that collects one verdict per counterfactual cluster.

A CFKD teacher answers “true”, “false” or “ood” for every counterfactual the explainer produced. This teacher serves the pre-rendered collages of each cluster through a small Flask page (clustered_feedback_loop.html), waits until a person has clicked a verdict for every cluster and broadcasts that verdict to all counterfactuals of the cluster. It is the interactive counterpart of the automatic teachers in peal.teachers.

Classes

ClusterTeacher

Teacher that asks a human for one verdict per cluster of counterfactuals.

DataStore

Mutable state shared between the Flask request handler and the teacher.