were developed by Tanzania education professionals and are similar to the Uwezo annual learning assessment – a nationwide assessment used to measure learning in Tanzania (see Mbiti et al. 2021 for exact test creation). The Math test focused on counting, basic addition, subtraction, multiplication and division, while the Kiswahili test focused on correctly reading words, writing sentences and comprehension.<sup>6</sup> For calculating student learning gains, the same set of test questions were used at baseline and follow-up. The test was of a slightly higher level for Grade 3 compared to Grade 2 students. The tests were low stakes and designed to test a range of abilities such that scores could be equated across years using a set of linked questions in baseline and follow up. These features allow us to test children on the same knowledge scale. A student survey was also administered to collect data on student characteristics and student perceptions about teacher practices (e.g. practices that teachers did or did not engage in with students).

Our data set contains 52 explanatory variables that can be divided into the following categories: (i) studentlevel variables such as age, household asset ownership, baseline score and whether they attended private tuitions for the particular subject; (ii) school-level variables such as the pupil teacher ratio at the school, whether the school is in an urban or rural location and certain institutional/governance variables; and (iii) teacher level variables. We divide our teacher level variables into 4 categories: (i) Who teachers are (teacher characteristics); (ii) What teachers know (teacher knowledge measured through the teacher assessment); (iii) What teachers do (teacher practice measured through teacher classroom observation); and (iv) What teachers believe (teacher mindsets). These are discussed further in Section 3 and Annex 1.

The unit of observation is the teacher and the outcome of interest is average student learning gains between baseline and follow-up (approximately 8 months) for the teacher. We construct estimates of student learning gains using the matched teacher-student database and student assessment data from baseline and followup. Student learning gains linked to a particular teacher are calculated as the percentage correct score in the follow-up student assessment minus the percentage correct score in the baseline student assessment, averaged across their students. We then model student learning gains using our ML algorithms on a host of student, school and teacher level covariates. We conduct the analysis separately for Math and Kiswahili.

<mark>The estimation of student learning gains for a teacher can be seen as analogous to the estimation of Teacher Value Added (TVA), however there are some differences between our estimation of student learning gains and the way in which TVA is often estimated in the standard education economics literature. In this literature, TVA is estimated as the teacher fixed effect from a regression of student follow-up test scores on student level covariates including lagged test scores (see Koedel et al. 2015 for a comprehensive review)—this is often referred to as step 1. This teacher fixed effect is then regressed on a host of teacher and school level covariates to find out teacher characteristics that best predict TVA (Rockoff 2004, Chetty et al. 2014a, Koedel et al. 2015)—referred to as step 2. We choose the student learning gain approach over the standard TVA approach to avoid imposing a linear functional form in either step 1 or step 2. This allows</mark>

> 6 For Grade 2, the Math portion of the test had 12 questions while the Kiswahili portion had 16 questions. For Grade 3, The Math portion had 17 questions while the Kiswahili portion had 15 questions (to ensure uniformity in comparison, we only chose those questions that were repeated in baseline and follow-up).

5