asreview.Simulate#
- class asreview.Simulate(X, labels, cycles, stopper=None, skip_transform=False, print_progress=True, groups=None)[source]#
Bases:
objectASReview 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.
groups (list[tuple[int, int]] | None) – List of tuples (group_id, record_id). If this is not None, records in the same group will be labeled at the same time in the simulation.
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.