truelearn.models.BaseKnowledgeComponent#

class truelearn.models.BaseKnowledgeComponent(*args, **kwds)[source]#

Bases: Protocol

An interface defines a knowledge component of a learnable unit.

Each knowledge component can be represented as a Normal Distribution with certain skills (mu) and standard deviation (sqrt{variance}).

The variance of the knowledge component from the learnable unit will be a fixed small value as we assume the skill (recourse depth) clearly and accurately measure the resourcefulness of the learnable unit. The variance of the knowledge component from the learner will be a dynamic value derived from the classifier’s training process. This is to respect the fact that the skill (model’s understanding of the learner’s knowledge) is not perfectly accurate.

Attributes

mean#

The mean of the knowledge component.

Type:

float

timestamp#

The POSIX timestamp of when the knowledge component was last updated.

Type:

Optional[float]

variance#

The variance of the knowledge component.

Type:

float

Methods

clone(*, mean, variance[, timestamp])

Generate a copy of the current knowledge component with given mean, variance and timestamp.

export_as_dict()

Export the knowledge component into a dictionary.

update(*[, mean, variance, timestamp])

Update the mean, variance, and timestamp of the current knowledge component.

abstract clone(*, mean: float, variance: float, timestamp: Optional[float] = None) Self[source]#

Generate a copy of the current knowledge component with given mean, variance and timestamp.

Parameters:
  • * – Use to reject positional arguments.

  • mean – The new mean of the knowledge component.

  • variance – The new variance of the knowledge component.

  • timestamp – An optional new POSIX timestamp of the knowledge component.

Returns:

A cloned knowledge component with given mean, variance and timestamp.

abstract export_as_dict() Dict[str, Any][source]#

Export the knowledge component into a dictionary.

Returns:

A dictionary mapping the name of the variables to their value.

abstract update(*, mean: Optional[float] = None, variance: Optional[float] = None, timestamp: Optional[float] = None) None[source]#

Update the mean, variance, and timestamp of the current knowledge component.

If the given parameters are None, the corresponding attributes of the current knowledge component will not be updated.

Parameters:
  • * – Use to reject positional arguments.

  • mean – The new mean of the knowledge component.

  • variance – The new variance of the knowledge component.

  • timestamp – The new POSIX timestamp that indicates the update time of the knowledge component.

Returns:

None.