asreview.Simulate#

class asreview.Simulate(X, labels, cycles, stopper=None, skip_transform=False, print_progress=True)[source]#

Bases: object

ASReview simulation class.

The simulation will stop when all records have been labeled or when the number of steps/queries reaches the stopping.

To seed the simulation, provide the seed to the classifier, query strategy, feature extraction model, and balance strategy or use a global random seed.

Parameters:
  • fm (numpy.ndarray) – The feature matrix to use for the simulation.

  • labels (numpy.ndarray, pandas.Series, list) – The labels to use for the simulation.

  • classifier (BaseModel) – The initialized classifier to use for the simulation.

  • querier (BaseQueryModel) – The initialized query strategy to use for the simulation.

  • balancer (BaseBalanceModel) – The initialized balance strategy to use for the simulation.

  • feature_extractor (BaseFeatureModel) – The initialized feature extraction model to use for the simulation. If None, the name of the feature extraction model is set to None.

  • stopper (int, callable) – The stopping mechanism to use for the simulation. When stopper is None, the simulation stops when all relevant records are found. If an integer, the simulation stops after n queries. A stopper or -1 stops the simulation after all records have been labeled. If class with .stop() method, the simulation stops when the callable returns True. Default is None.

  • skip_transform (bool) – If True, the feature matrix is not computed in the simulation. It is assumed that X is the feature matrix or input to the estimator. Default is False.

Methods

__init__(X, labels, cycles[, stopper, ...])

label(record_ids[, cycle])

Label the records with the given record_ids.

review()

Start the review process.

to_sql(fp)

Write the data a sql file.

label(record_ids, cycle=None)[source]#

Label the records with the given record_ids.

Parameters:

record_ids (list) – The record ids to label.

review()[source]#

Start the review process.

to_sql(fp)[source]#

Write the data a sql file.

Parameters:

fp (str, Path, asreview.Project) – The path to the sqlite file to write the results to.