• This repository has been archived on 05/Dec/2018
  • Stars
    star
    144
  • Rank 255,590 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 11 years ago
  • Updated about 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

General Use Machine Learning for Learning Library

#guacamole guacamole is a collection of tools we use at Khan Academy to train our models from new data on a regular basis. These tools are meant to be compatible with a variety of data formats from anyone who has learning data - especially but not only data from online instruction.

The Tools:

The pipeline currently included here trains Multi-dimensional Item Response Theory (MIRT) models, including both item correctness and response time if you have that data (coming soon). The MIRT model is well suited to testing data (at Khan Academy, we use it for our assessments)

guacamole walkthrough

guacamole

guacamole is a useful tool for teachers and researchers to analyze and improve test items and students.

getting started

###Getting guacamole to run:

####Get numpy, scipy, and matplotlib working There are several strategies for this, depending on platform.

The normal and generally correct way to install Python libraries is using pip, but that often chokes on each of these. If installing with pip doesn't work, I recommend using the Scipy Superpack for Mac, or following the SciPy Stack installation instructions for Linux or Windows. For a heavier-weight but easy alternative, you can try Anaconda.

I recommend installing git as well.

Next download guacamole:

git clone [email protected]:Khan/guacamole.git

Go to the guacamole directory and run

./start_mirt_pipeline.py --generate --train -n 2 --visualize

It should take less than a minute, and if some graphs pop up, you're good to go. That -n 2 is just to make things faster - this will not be a good model. It'll only learn for two epochs, and you probably want it to learn for about 15.

Walkthrough

guacamole has a ton of features and abilities, and this walkthrough shows a few of them.

If you want a quick overview of what's available and you hate reading when it's not on the terminal, run

./start_mirt_pipeline.py --help

for an overview of the arguments

Generate Data

Data is generated with

./start_mirt_pipeline.py --generate

This constructs a bunch of students with fake abilities, a bunch of exercises with fake difficulties, and simulates those students doing those exercises. You can examine the generated data in

<PATH_TO_GUAC>/sample_data/all.responses

It should look something like

MERRIE,addition_1,1,True
MERRIE,identifying_points_1,1,False
YOSHIKO,addition_1,1,True
YOSHIKO,slope_intercept_form,1,True
YOSHIKO,graphing-proportional-relationships,1,True
YOSHIKO,constructions_1,1,True
CAITLYN,addition_1,1,True
CAITLYN,identifying_points_1,1,True
HORTENSE,vertical_angles_2,1,False
HORTENSE,visualizing-and-interpreting-relationships-between-patterns,1,True
HORTENSE,slope_intercept_form,1,False
MENDY,graphing-proportional-relationships,1,True
MENDY,constructions_1,1,False

These columns are name, exercise, time_taken, and correct. You can read more about data formats in train_util/model_training_util.py

###Train a model

You can train a model on data with

./start_mirt_pipeline.py --train

By default, this looks at the place that generate writes - at sample_data/all.responses. If you're interested in using your own data, you can use

./start_mirt_pipeline.py --train --data_file <PATH/TO/YOUT/DATA>

OPTIONAL: PARALLELIZATION) This will run for a while. If you want it to go faster, you can parallelize with the -w command. I use -w 6 on my eight-core computer. On a cluster, the number of workers can be really big, and training can be really fast. On some systems, (like Ubuntu) this only works when you have affinity installed - if multiple workers does not result in any speedup, try pip install affinity.

Now that your model is trained, it's in sample_data/models/model.json. You can actually use this model to run an adaptive test now, or you can examine it in a more readable format. If you want to save your model somewhere else, send in -m desired/model/file.json.

###Examining Models

There are a few ways to examine a model and evaluate how good it is.

####Report The simplest is to run

./start_mirt_pipeline.py --report

This prints out a formatted view of your exercises.

                                              Exercise  Bias        Dim. 1
                     area-and-circumference-of-circles  0.1527      0.1627
                                equation_of_an_ellipse  0.2390      0.0599
                          two-sided-limits-from-graphs  0.3392      0.0654
                                         subtraction_1  0.3454      0.1430
                                       scaling_vectors  0.3814      0.1886
                   dividing_polynomials_by_binomials_1  0.3991      0.3312
                                   area_of_triangles_1  0.4223      0.0746
                                              volume_1  0.5618      -0.0479
                    understanding_decimals_place_value  0.8695      0.0884
understanding-multiplying-fractions-and-whole-numbers   0.9794      0.1425

For more information on what these terms mean, check out IRT on Wikipedia.

####ROC Curve An ROC curve is a simple way of comparing models for predictive accuracy when there are binary classifications. When we train a model, we hold out a test set, and the ROC goes through that set of assessment and makes predictions about the accuracy of users on random questions. To see a ROC curve, run

./start_mirt_pipeline.py --roc_viz

This will take a bit of time, as it simulates generating a ROC curve from your test data.

####Problems

The model used for each problem can be thought of as a model meant to predict the probability that a student will answer that problem correctly given their ability. Running

./start_mirt_pipeline.py --sigmoid_viz

gives you a visualization of each problem in that context.

###Scoring

So scoring here is relative - we don't give anything on a score of 0-100. Instead, we give the mean of the student's estimated ability, which should have a mean around 0 and be approximately normally distributed.

This prints a student's id and their score. For instance:

NATASHA -0.281607745587
EMA -0.423702530148
HUNG 0.135014957553
IAN 1.00330296356
JANNET 0.141838668862
JAN 0.205517676995
LOUETTA 0.145722766169
RACHEAL 0.102205839596
LOUVENIA 0.0097095052554
SOLEDAD 0.400148176133
KAYLENE -0.409522253404
KATHRYN 0.245113015341

I got these names from the census, in case you're wondering. I really like the internet.

You can score with ./start_mirt_pipeline.py --score

Adaptive Test

Any time after training, we can create an adaptive test that gets the most information possible per question.

Start taking the interactive test with

./start_mirt_pipeline.py --test

You can specify the number of questions you'd like in your interactive test with -i

This isn't super cool by itself, because it just simulates answering questions correctly (1) or incorrectly. But it should be easy to hook this up as the backend to an interactive adaptive testing engine - that's what we do at Khan Academy.

The Algorithms

guacamole aspires to be a general purpose library with a spectrum of commonly used algorithms for analyzing educational data (especially at scale). For now, we support a few common algorithms.

Multidimensional Item Response Theory

Item response theory is a classic technique in psychometrics to calibrate tests and test items with student abilities, resulting in difficulty ratings for test items and ability ratings for students.

Visualizations

A few visualizations are available for the data.

First, you can see an ROC curve given your parameters: --roc_viz

ROC curve

You can also see graphs of each exercise by difficulty and discrimination ./start_mirt_pipeline.py --sigmoid_viz

sigmoids

To see how well each student did, call './start_mirt_pipeline.py --score'

The names

The names are from the US census bureau.

Khan Academy Data

This library is designed to be used on Khan Academy data. We have sample, non-student, data in that format now. If you are interested in using our real data at scale in your research, you should visit http://khanacademy.org/r/research, and then email us at [email protected].

If these tools are useful to you, let us know! If you'd like to contribute, you can submit a pull request or apply to work at Khan Academy - we're hiring data scientists and software engineers for both full time positions and internships.

Authors: Eliana Feasley, Jace Kohlmeier, Matt Faus, Jascha Sohl-Dickstein (2014)

More Repositories

1

aphrodite

Framework-agnostic CSS-in-JS with support for server-side rendering, browser prefixing, and minimum CSS generation
JavaScript
5,348
star
2

style-guides

Docs for the Organization
Shell
2,136
star
3

khan-exercises

A (deprecated) framework for building exercises to work with Khan Academy.
HTML
1,594
star
4

perseus

Perseus is Khan Academy's exercise question editor and renderer.
TypeScript
1,368
star
5

genqlient

a truly type-safe Go GraphQL client
Go
1,042
star
6

react-components

JavaScript
1,008
star
7

live-editor

A browser-based live coding environment.
JavaScript
754
star
8

flow-to-ts

Convert flow code to typescript
TypeScript
385
star
9

khan-api

Documentation for (and examples of) using the Khan Academy API
375
star
10

gae_mini_profiler

A ubiquitous mini-profiler for Google App Engine, inspired by mvc-mini-profiler
Python
273
star
11

khan-mobile

You’re probably looking for www.github.com/khan/mobile
JavaScript
239
star
12

Prototope

Swift library of lightweight interfaces for prototyping, bridged to JS
Swift
230
star
13

math-input

math-input = react + redux + mathquill
JavaScript
219
star
14

snippets

Code related to collecting and pushing weekly snippets
Python
205
star
15

structuredjs

Test JavaScript code, look for functionality.
JavaScript
197
star
16

pull-request-comment-trigger

A github action for detecting a "trigger" in a pull request description or comment
JavaScript
190
star
17

react-multi-select

A multiple select component for React
JavaScript
178
star
18

react-render-server

A node.js server for server-side rendering anything!
JavaScript
140
star
19

tinyquery

A Python in-memory test stub for BigQuery
Python
131
star
20

slicker

a tool for moving things in python
Python
126
star
21

wonder-blocks

React components for Wonder Blocks design system.
TypeScript
123
star
22

KAS

A lightweight JavaScript CAS for comparing expressions and equations.
JavaScript
107
star
23

math-facts

JavaScript
77
star
24

hivemind

Experimental knowledge-management system for Long-term Research references
JavaScript
48
star
25

analytics

Tools to analyze KA logs and other data
Python
45
star
26

kmath

JavaScript Numeric Math Utilities
JavaScript
41
star
27

alertlib

A small library to make it easy to send alerts to various platforms
Python
41
star
28

khan-linter

Lint and code-munging tools for Khan Academy codebase
Python
40
star
29

jenkins-jobs

Scripts and the like that Jenkins jobs can run.
Groovy
35
star
30

react-balance-text

A React wrapper for the Adobe Web Platform's Balance-Text Project
JavaScript
34
star
31

frankenserver

A fork of the Google App Engine SDK with modifications required by Khan Academy
Python
30
star
32

khan-windows

Khan Academy for Windows 8
TypeScript
30
star
33

engblog

KA Engineering blog.
Python
29
star
34

mu-lambda

A small library of functional programming utilities.
JavaScript
25
star
35

gittip-gdoc

Extract records from a Google Doc spreadsheet and bulk set the results on Gittip.
JavaScript
23
star
36

internal-webserver

Code that runs on the khan-academy webserver ec2 instance (for dev tools and the like)
Python
21
star
37

youtube-export

Scripts to download and transcode Khan Academy videos and put them on S3
Python
20
star
38

KhanQuest

Khan Academy the game
JavaScript
18
star
39

culture-cow

NO LONGER USED! This is Culture Cow for HipChat. See Culture Cow code for Slack here: https://github.com/Khan/culture-cron
JavaScript
18
star
40

fuzzy-match-utils

A collection of string matching algorithms designed with React Select in mind.
JavaScript
17
star
41

graphie-to-png

A tool for converting graphie JS code to an image
HTML
17
star
42

react-native-codegen

Generating bindings between js & native via flow types
16
star
43

webapp-i18n-bigfile

The next generation of webapp-i18n, starting in April 2015, that uses git-bigfile to avoid storing large resources.
15
star
44

khan.github.io

An index of some of the open source efforts at Khan Academy
CSS
15
star
45

zendesk-theme

Files for our custom https://khanacademy.zendesk.com/ theme
CSS
15
star
46

typed-context

Sample code for the Khan Academy blog about statically typed context
Go
13
star
47

git-workflow

scripts to enable the git workflow at Khan Academy
Shell
12
star
48

localeplanet

A clone of the l10n files at localeplanet.com.
Python
11
star
49

OhaiPrototope

A prototope bootstrap project in xcode
Swift
11
star
50

dendro

A tool for analyzing dependency trees.
JavaScript
11
star
51

structured-blocks

JavaScript
11
star
52

Early-Math-Prototype-Player

Play the Early Math Prototypes embedded in an iPad app.
Swift
11
star
53

Cantor

Prototypes around a medium and toolset for exploring quantities and arithmetic operations
JavaScript
10
star
54

udp-relay

Fork of Simple UDP proxy at http://aluigi.altervista.org/mytoolz.htm, with modifications required by Khan Academy
C
10
star
55

computing-curriculum

Articles that teach computer programming and computer science on Khan Academy.
HTML
10
star
56

gae-continuous-deploy

A server which polls a repository and automatically deploys to Google App engine
JavaScript
10
star
57

slack-deploy-hooks

Slack outgoing webhooks to power Khan's deployment process
JavaScript
10
star
58

OpenResponses

Prototyping around supporting open-ended responses through peer learning
JavaScript
9
star
59

Early-Math-Prototypes

Exploratory prototypes of interactions for early math
JavaScript
9
star
60

BabyHint

Provide more helpful hints for JavaScript developers.
JavaScript
9
star
61

projects

We aim to provide motivating hands-on learning experiences for students all ages.
Arduino
8
star
62

appengine-mapreduce

A fork of http://code.google.com/p/appengine-mapreduce/ with modifications required by Khan Academy
Python
8
star
63

khan-webhooks

A KA-specific web hook to notify Slack/HipChat about Phabricator and GitHub events.
Python
7
star
64

kotlin-datastore

high-level kotlin library for accessing Google cloud datastore
Kotlin
7
star
65

react-sandbox

Play with your components!
JavaScript
7
star
66

khannotations

A React library for rough, animated, annotations.
TypeScript
7
star
67

KhanAcademy_clr

Khan Academy's colors, accessible via OS X's built-in color picker
7
star
68

BirdAcademy

This experimental learning activity tries to help young children implicitly construct a sense of place value via play.
JavaScript
7
star
69

i18n-babel-plugin

Babel plugin to convert <$_> and <$i18nDoNotTranslate> tags to function calls.
JavaScript
7
star
70

youtube-tools

Miscellaneous tools to modify KA's YouTube videos en masse
Python
6
star
71

translation-assistant

Intelligent translation memory for perseus exercises
JavaScript
6
star
72

wonder-stuff

Packages for sharing features across JavaScript-based projects
TypeScript
6
star
73

beep-boop

Automated issue-frequency HipChat notifier
Python
6
star
74

JSContextBenchmarking

How fast is iOS 7's new web-less JavaScript API?
Swift
6
star
75

todo-tools

Helps you track the TODOs in your codebase
Python
6
star
76

openpyxl

A fork of openpyxl with modifications required by Khan Academy.
Python
6
star
77

ka-clone

manages an isolated local gitconfig for cloned repositories
Python
6
star
78

ActiveQuizTouch

Exploring and expanding on the mechanics and concepts behind Jenova Chen's Active Quiz through multitouch prototyping
JavaScript
6
star
79

khan-i18n

This repo is just used to handle the issues for Khan Academy's internationalization efforts.
5
star
80

declarative-z-indexes

Prevent z-index conflicts by generating them from declarative constraints
JavaScript
5
star
81

two-truths

Two Truths and a Lie Slack Bot
Python
5
star
82

pull-request-workflow-cancel

Conserve resources by cancelling workflow runs for previous commits on a pull-request.
JavaScript
5
star
83

kake

A `make` library in Python
Python
5
star
84

placecomplete

A Select2/jQuery plugin for location autocomplete powered by the Google Maps API
JavaScript
5
star
85

algebra-tool

tool for manipulating algebraic expressions and equations
JavaScript
5
star
86

ka-player

Play your favorite Khan Academy CS programs on your phone
JavaScript
5
star
87

react-build

Configuration for making a custom build of React + ReactART for KA
JavaScript
4
star
88

render-gateway

The core implementation of our render-gateway service
JavaScript
4
star
89

real-time-exercises-dashboard

Dashboard of Khan Academy exercises completed in real time on a map!
JavaScript
4
star
90

khan-mobile-exercises

Edit our CSS to make exercises work great on mobile devices.
CSS
4
star
91

free-response-report

Publication regarding our experiments with open-ended online learning
JavaScript
4
star
92

A11yAnalytics

A tool to help you understand your users' accessibility needs.
Swift
4
star
93

mobile_video_zoom

Utility for producing mobile-friendly video zoom/pan sequences from KA videos
Python
4
star
94

eslint-plugin-khan

eslint plugin with our set of custom rules for various things
JavaScript
4
star
95

pygments-server

A simple server that provides HTTP access to `pygmentize`
Python
4
star
96

tutoring-accuracy-dataset

This repository hosts the paper β€œLLM Based Math Tutoring: Challenges and Dataset”, along with the accompanying dataset. It explores the performance and challenges of Large Language Models (LLMs) in math tutoring scenarios, providing a benchmark dataset for evaluating LLM accuracy in educational contexts.
4
star
97

web-workshop

Go
3
star
98

long-term-research-reports

Repository for developing longer-form reports from the Long-term Research team
HTML
3
star
99

canals

Canals: pure URL routing
JavaScript
3
star
100

fastlike

Go
3
star