API Reference#

Shown is the class and function hierarchy of TrueLearn.

For a more detailed description of the decisions made during implementation, please refer to the Design Considerations section.

truelearn.base: Contains the base classes for the library#

Base Classes#

base.BaseClassifier()

The base class of all the classifiers in TrueLearn.

truelearn.datasets: Contains utilities for using datasets#

The truelearn.datasets module contains utilities to load datasets, such as the PEEK dataset.

Classes#

datasets.PEEKKnowledgeComponentGenerator(...)

A class that defines an implicit interface to the generator of the knowledge component.

Functions#

datasets.load_peek_dataset(*[, dirname, ...])

Download and Parse PEEKDataset.

datasets.load_peek_dataset_raw(*[, dirname, ...])

Download and Load the raw PEEKDataset.

truelearn.learning: Contains the classifiers for learning#

The truelearn.learning module implements the classifiers in TrueLearn paper.

Classes#

learning.INKClassifier(*[, ...])

A meta-classifier that combines KnowledgeClassifier and InterestClassifier.

learning.InterestClassifier(*[, ...])

A classifier that models the learner's interest and makes prediction based on the interest.

learning.KnowledgeClassifier(*[, ...])

A classifier that models the learner's knowledge and makes prediction based on the knowledge.

learning.NoveltyClassifier(*[, ...])

A classifier that models the learner's knowledge and makes prediction based on the knowledge.

learning.EngageClassifier()

A Classifier that always makes a positive prediction.

learning.PersistentClassifier(*[, ...])

A classifier that makes predictions based on whether the learner has engaged with the last learnable unit.

learning.MajorityClassifier(*[, engagement, ...])

A classifier that predicts based on the number of learner's engagement and non-engagement.

truelearn.models: Contains the representations used for learning#

The truelearn.models module implements the knowledge, learner and event models.

Classes#

models.BaseKnowledgeComponent(*args, **kwds)

An interface defines a knowledge component of a learnable unit.

models.EventModel(knowledge, event_time)

A class that models a learning event in TrueLearn algorithm.

models.LearnerModel(knowledge, ...)

The model of a learner.

models.LearnerMetaWeights([novelty_weights, ...])

Store the weights used in meta training.

models.KnowledgeComponent(*args, **kwds)

A concrete class that implements BaseKnowledgeComponent.

models.HistoryAwareKnowledgeComponent(*args, ...)

A knowledge component that keeps a history about how it was updated.

models.Knowledge([knowledge])

The representation of the learner's knowledge.

truelearn.preprocessing: Contains preprocessing functions and classes#

The truelearn.preprocessing module implements the initial tasks required to use the classifiers.

Classes#

preprocessing.Wikifier(api_key)

A client that makes requests to the Wikifier API.

Functions#

preprocessing.get_values_mean(cosines)

Calculate the mean of an iterable of values.

preprocessing.get_values_sample_std(cosines)

Calculate the sample standard deviation of an iterable of values.

preprocessing.get_values_population_std(cosines)

Calculate the population standard deviation of an iterable of values.

truelearn.utils.metrics: Contains functions to generate metrics#

The truelearn.utils.metrics implements the commonly-used metrics in TrueLearn.

Functions#

utils.metrics.get_precision_score(...[, ...])

Get the precision score of the prediction.

utils.metrics.get_recall_score(act_labels, ...)

Get the recall score of the prediction.

utils.metrics.get_accuracy_score(act_labels, ...)

Get the accuracy score of the prediction.

utils.metrics.get_f1_score(act_labels, ...)

Get the f1 score of the prediction.

truelearn.utils.visualisations: Contains plotting functions and classes#

truelearn.utils.visualisations provides utilities for creating visualisations.

The module provides Plotter classes that take the learner’s knowledge as input and produce various different charts.

Classes#

utils.visualisations.LinePlotter([title, ...])

Line plotter.

utils.visualisations.PiePlotter([title])

Pie plotter.

utils.visualisations.RosePlotter([title])

Rose pie plotter.

utils.visualisations.BarPlotter([title, ...])

Bar plotter.

utils.visualisations.DotPlotter([title, ...])

Dot plotter.

utils.visualisations.BubblePlotter([title])

Bubble plotter.

utils.visualisations.WordPlotter()

Word cloud plotter.

utils.visualisations.RadarPlotter([title])

Radar plotter.

utils.visualisations.TreePlotter([title])

Treemap plotter.