MCPcopy Index your code

hub / github.com/snorkel-team/snorkel / functions

Functions630 in github.com/snorkel-team/snorkel

↓ 46 callersMethodfit
Train label model. Train label model to estimate mu, the parameters used to combine LFs. Parameters ---------- L_tra
snorkel/labeling/model/label_model.py:812
↓ 27 callersFunctionmetric_score
Evaluate a standard metric on a set of predictions/probabilities. Parameters ---------- golds An array of gold (int) labels p
snorkel/analysis/metrics.py:16
↓ 26 callersMethodfit
Train a MultitaskClassifier. Parameters ---------- model The model to train dataloaders A lis
snorkel/classification/training/trainer.py:144
↓ 23 callersMethod_get_x
(self, num=8, text="Henry has fun")
test/map/test_core.py:79
↓ 23 callersMethodupdate
Update the count and total number.
snorkel/classification/training/loggers/log_manager.py:80
↓ 20 callersMethod_get_x_namespace
(self, data: List[int] = DATA)
test/augmentation/apply/test_tf_applier.py:52
↓ 17 callersMethodapply
Label list of data points or a NumPy array with LFs. Parameters ---------- data_points List of data points or Num
snorkel/labeling/apply/core.py:140
↓ 17 callersMethodscore
Calculate scores for one or more user-specified metrics. Parameters ---------- golds An array of gold (int) label
snorkel/analysis/scorer.py:70
↓ 14 callersMethodpredict
Return predicted labels, with ties broken according to policy. Policies to break ties include: - "abstain": return an abstain vote (
snorkel/labeling/model/label_model.py:423
↓ 14 callersFunctionsquare
(x: DataPoint)
test/map/test_core.py:66
↓ 13 callersFunctioncross_entropy_with_probs
Calculate cross-entropy loss when targets are probabilities (floats), not ints. PyTorch's F.cross_entropy() method requires integer labels; it do
snorkel/classification/loss.py:9
↓ 13 callersMethodtrigger_checkpointing
Check if current counts trigger checkpointing.
snorkel/classification/training/loggers/log_manager.py:114
↓ 13 callersMethodtrigger_evaluation
Check if current counts trigger evaluation.
snorkel/classification/training/loggers/log_manager.py:106
↓ 12 callersFunctionsquare
(x: DataPoint)
test/map/test_spark.py:44
↓ 11 callersMethod_set_class_balance
Set a prior for the class balance. In order of preference: 1) Use user-provided class_balance 2) Estimate balance from Y_dev
snorkel/labeling/model/label_model.py:559
↓ 11 callersMethodapply
Label Pandas DataFrame of data points with LFs. Parameters ---------- df Pandas DataFrame containing data points
snorkel/labeling/apply/pandas.py:75
↓ 10 callersMethod_get_x
(self, num=8, text="Henry has fun")
test/map/test_spark.py:57
↓ 10 callersFunctionto_int_label_array
Convert an array to a (possibly flattened) array of ints. Cast all values to ints and possibly flatten [n, 1] arrays to [n]. This method is t
snorkel/utils/core.py:94
↓ 9 callersFunctioncreate_task
(task_name, module_suffixes=("", ""))
test/classification/test_multitask_classifier.py:261
↓ 8 callersMethod_get_x_df
(self)
test/augmentation/apply/test_tf_applier.py:152
↓ 8 callersMethod_set_up_model
(self, L: np.ndarray, class_balance: List[float] = [0.5, 0.5])
test/labeling/model/test_label_model.py:18
↓ 8 callersMethodapply
Label Dask DataFrame of data points with LFs. Parameters ---------- df Dask DataFrame containing data points to b
snorkel/labeling/apply/dask.py:23
↓ 8 callersMethodcheckpoint
Check if iteration and current metrics necessitate a checkpoint. Parameters ---------- iteration Current training
snorkel/classification/training/loggers/checkpointer.py:107
↓ 8 callersMethodload
Load existing label model. Parameters ---------- source Filename to load model from Example ----
snorkel/labeling/model/base_labeler.py:129
↓ 8 callersFunctionprobs_to_preds
Convert an array of probabilistic labels into an array of predictions. Policies to break ties include: "abstain": return an abstain vote (-1)
snorkel/utils/core.py:13
↓ 8 callersMethodscore
Calculate scores for the provided DictDataLoaders. Parameters ---------- dataloaders A list of DictDataLoaders to
snorkel/classification/multitask_classifier.py:383
↓ 7 callersMethod_run_lf
(self, lf: NLPLabelingFunction)
test/labeling/lf/test_nlp.py:24
↓ 7 callersFunctionget_hashable
Get a hashable version of a potentially unhashable object. This helper is used for caching mapper outputs of data points. For common data poi
snorkel/map/core.py:41
↓ 7 callersFunctionpreds_to_probs
Convert an array of predictions into an array of probabilistic labels. Parameters ---------- pred A [num_datapoints] or [num_data
snorkel/utils/core.py:75
↓ 6 callersMethod_get_x_namespace_dict
(self, data: List[int] = DATA)
test/augmentation/apply/test_tf_applier.py:55
↓ 6 callersMethodapply
Label PySpark RDD of data points with LFs. Parameters ---------- data_points PySpark RDD containing data points t
snorkel/labeling/apply/spark.py:21
↓ 6 callersMethodcalculate_loss
Calculate the loss for each task and the number of data points contributing. Parameters ---------- X_dict A dict
snorkel/classification/multitask_classifier.py:232
↓ 6 callersFunctionlist_to_tensor
Convert a list of torch.Tensor into a single torch.Tensor.
snorkel/classification/utils.py:10
↓ 6 callersMethodlog
Print all metrics in metrics_dict to screen. Parameters ---------- metrics_dict Dictionary of metric names (keys)
snorkel/labeling/model/logger.py:37
↓ 6 callersFunctionmake_df
(values: list, index: list, key: str = "num")
test/augmentation/apply/test_tf_applier.py:42
↓ 6 callersFunctionpad_batch
Convert the batch into a padded tensor and mask tensor. Parameters ---------- batch The data for padding max_len Max
snorkel/classification/utils.py:29
↓ 6 callersMethodreset_cache
Reset the memoization cache.
snorkel/map/core.py:126
↓ 5 callersMethod_break_col_permutation_symmetry
r"""Heuristically choose amongst (possibly) several valid mu values. If there are several values of mu that equivalently satisfy the optimiza
snorkel/labeling/model/label_model.py:763
↓ 5 callersMethod_get_x_df_with_str
(self)
test/augmentation/apply/test_tf_applier.py:155
↓ 5 callersMethod_run_lf
(self, lf: LabelingFunction)
test/labeling/lf/test_core.py:31
↓ 5 callersMethod_set_constants
(self, L: np.ndarray)
snorkel/labeling/model/label_model.py:594
↓ 5 callersMethodapply
Augment a list of data points using TFs and policy. Parameters ---------- data_points List containing data points
snorkel/augmentation/apply/core.py:98
↓ 5 callersMethodapply
Augment a Pandas DataFrame of data points using TFs and policy. Parameters ---------- df Pandas DataFrame contain
snorkel/augmentation/apply/pandas.py:47
↓ 5 callersMethodget_conditional_probs
r"""Return the estimated conditional probabilities table. Return the estimated conditional probabilites table cprobs, where cprobs is an
snorkel/labeling/model/label_model.py:349
↓ 5 callersFunctionget_data_dict
(data: List[int] = DATA)
test/augmentation/apply/test_tf_applier.py:47
↓ 5 callersFunctionget_label_buckets
Return data point indices bucketed by label combinations. Parameters ---------- *y A list of np.ndarray of (int) labels Retu
snorkel/analysis/error_analysis.py:10
↓ 5 callersFunctionget_label_instances
Return instances in x with the specified combination of labels. Parameters ---------- bucket A tuple of label values correspondin
snorkel/analysis/error_analysis.py:61
↓ 5 callersMethodpredict
Calculate probabilities, (optionally) predictions, and pull out gold labels. Parameters ---------- dataloader A D
snorkel/classification/multitask_classifier.py:318
↓ 5 callersMethodscore
Calculate one or more scores from user-specified and/or user-defined metrics. Parameters ---------- L An [n,m] ma
snorkel/labeling/model/label_model.py:469
↓ 5 callersFunctionsf
(x)
test/slicing/test_monitor.py:12
↓ 4 callersMethod_apply_policy_to_data_point
(self, x: DataPoint)
snorkel/augmentation/apply/core.py:38
↓ 4 callersMethod_generate_O
Generate overlaps and conflicts matrix from label matrix. Parameters ---------- L An [n,m] label matrix with valu
snorkel/labeling/model/label_model.py:244
↓ 4 callersMethod_get_augmented_label_matrix
Create augmented version of label matrix. In augmented version, each column is an indicator for whether a certain source or clique of
snorkel/labeling/model/label_model.py:168
↓ 4 callersMethod_get_labels
(self)
test/analysis/test_scorer.py:14
↓ 4 callersMethod_get_x_df_dict
(self)
test/augmentation/apply/test_tf_applier.py:158
↓ 4 callersMethod_loss_mu
r"""Overall mu loss. Parameters ---------- l2 A float or np.array representing the per-source regularization
snorkel/labeling/model/label_model.py:541
↓ 4 callersMethod_numpy_from_row_data
(self, labels: List[RowData])
snorkel/labeling/apply/core.py:62
↓ 4 callersMethodapply_generator
Augment a list of data points using TFs and policy in batches. This method acts as a generator, yielding augmented data points for a
snorkel/augmentation/apply/core.py:69
↓ 4 callersMethodapply_generator
Augment a Pandas DataFrame of data points using TFs and policy in batches. This method acts as a generator, yielding augmented data points fo
snorkel/augmentation/apply/pandas.py:18
↓ 4 callersFunctioncheck_unique_names
Check that operator names are unique.
snorkel/utils/data_operators.py:5
↓ 4 callersFunctioncollect_flow_outputs_by_suffix
Return output_dict outputs specified by suffix, ordered by sorted flow_name.
snorkel/classification/utils.py:111
↓ 4 callersFunctioncreate_dataloader
(task_name="task", split="train", **kwargs)
test/classification/test_multitask_classifier.py:249
↓ 4 callersMethodforward
Do a forward pass through the network for all specified tasks. Parameters ---------- X_dict A dict of data fields
snorkel/classification/multitask_classifier.py:165
↓ 4 callersMethodlf_coverages
Compute frac. of examples each LF labels. Returns ------- numpy.ndarray Fraction of labeled examples for each LF
snorkel/labeling/analysis.py:159
↓ 4 callersMethodlf_overlaps
Compute frac. of examples each LF labels that are labeled by another LF. An overlapping example is one that at least one other LF returns a
snorkel/labeling/analysis.py:181
↓ 4 callersMethodlf_summary
Create a pandas DataFrame with the various per-LF statistics. Parameters ---------- Y [n] or [n, 1] np.ndarray of
snorkel/labeling/analysis.py:323
↓ 4 callersFunctionmake_spark_mapper
Convert ``Mapper`` to be compatible with PySpark. Parameters ---------- mapper Mapper to make compatible with PySpark
snorkel/map/spark.py:16
↓ 4 callersMethodscore_slices
Calculate user-specified and/or user-defined metrics overall + slices. Parameters ---------- S A recarray with en
snorkel/analysis/scorer.py:115
↓ 3 callersMethod_create_tree
(self)
snorkel/labeling/model/label_model.py:600
↓ 3 callersMethod_get_labels_to_tasks
Map each label to its corresponding task outputs based on whether the task is available. If remap_labels specified, overrides specific label
snorkel/classification/multitask_classifier.py:458
↓ 3 callersMethod_init_params
r"""Initialize the learned params. - \mu is the primary learned parameter, where each row corresponds to the probability of a clique
snorkel/labeling/model/label_model.py:260
↓ 3 callersMethod_loss_l2
r"""L2 loss centered around mu_init, scaled optionally per-source. In other words, diagonal Tikhonov regularization, ||D(\mu-\mu_
snorkel/labeling/model/label_model.py:515
↓ 3 callersMethod_move_to_device
Move the model to the device specified in the model config.
snorkel/classification/multitask_classifier.py:481
↓ 3 callersMethod_reset_losses
Reset the loss counters.
snorkel/classification/training/trainer.py:508
↓ 3 callersMethod_run_lf
(self, lf: SparkNLPLabelingFunction)
test/labeling/lf/test_nlp_spark.py:22
↓ 3 callersFunctionfilter_labels
Filter out examples from arrays based on specified labels to filter. The most common use of this method is to remove examples whose gold label is
snorkel/utils/core.py:131
↓ 3 callersFunctiongenerate_simple_label_matrix
Generate a synthetic label matrix with true parameters and labels. This function generates a set of labeling function conditional probability tab
snorkel/synthetic/synthetic_data.py:6
↓ 3 callersMethodlf_conflicts
Compute frac. of examples each LF labels and labeled differently by another LF. A conflicting example is one that at least one other LF retur
snorkel/labeling/analysis.py:224
↓ 3 callersMethodload
Load trainer config and optimizer state from the specified json file path to the trainer object. The optimizer state is stored, too. However, it only
snorkel/classification/training/trainer.py:539
↓ 3 callersMethodmake_slice_dataloader
Create DictDataLoader with slice labels, initialized from specified dataset. Parameters ---------- dataset A Dict
snorkel/slicing/sliceaware_classifier.py:93
↓ 3 callersFunctionmerge_config
Merge a (potentially nested) dict of kwargs into a config (NamedTuple). Parameters ---------- config An instantiated Config to up
snorkel/utils/config_utils.py:6
↓ 3 callersFunctionparse_package
(line: str)
scripts/check_requirements.py:26
↓ 2 callersMethod__init__
( self, n_tfs: int, n_per_original: int = 1, keep_original: bool = True )
snorkel/augmentation/policy/core.py:37
↓ 2 callersMethod_build_mask
Build mask applied to O^{-1}, O for the matrix approx constraint.
snorkel/labeling/model/label_model.py:229
↓ 2 callersMethod_conflicted_data_points
Get indicator vector z where z_i = 1 if x_i is labeled differently by two LFs.
snorkel/labeling/analysis.py:59
↓ 2 callersMethod_get_x_dict
(self)
test/map/test_core.py:82
↓ 2 callersMethod_make_metric_map
( self, metric_mode_iter: Optional[Iterable[str]] )
snorkel/classification/training/loggers/checkpointer.py:213
↓ 2 callersMethod_overlapped_data_points
Get indicator vector z where z_i = 1 if x_i is labeled by more than one LF.
snorkel/labeling/analysis.py:55
↓ 2 callersMethod_run_sf
(self, sf: NLPSlicingFunction)
test/slicing/sf/test_nlp.py:21
↓ 2 callersMethod_set_optimizer
(self, model: nn.Module)
snorkel/classification/training/trainer.py:301
↓ 2 callersMethod_test_generate_L
Test generated label matrix L for consistency with P, Y. This tests for consistency between the true conditional LF probabilities, P,
test/synthetic/test_synthetic_data.py:18
↓ 2 callersMethodadd_scalar
Log a scalar variable. Parameters ---------- name Name of the scalar collection value Value o
snorkel/classification/training/loggers/log_writer.py:61
↓ 2 callersFunctionadd_slice_labels
Modify a dataloader in-place, adding labels for slice tasks. Parameters ---------- dataloader A DictDataLoader whose dataset.Y_di
snorkel/slicing/utils.py:15
↓ 2 callersMethodapply
Label Pandas DataFrame of data points with LFs in parallel using Dask. Parameters ---------- df Pandas DataFrame
snorkel/labeling/apply/dask.py:62
↓ 2 callersFunctionapply_lfs_to_data_point
Label a single data point with a set of LFs. Parameters ---------- x Data point to label index Index of the data poin
snorkel/labeling/apply/core.py:84
↓ 2 callersMethodclear
Clear existing checkpoint files, besides the best-yet model.
snorkel/classification/training/loggers/checkpointer.py:177
↓ 2 callersFunctionconvert_to_slice_tasks
Add slice labels to dataloader and creates new slice tasks (including base slice). Each slice will get two slice-specific heads: - an indicat
snorkel/slicing/utils.py:58
↓ 2 callersFunctioncreate_data
Create uniform X data from [-1, 1] on both axes. Create labels with linear decision boundaries related to the two coordinates of X.
test/classification/test_classifier_convergence.py:78
↓ 2 callersFunctioncreate_dataloader
(df: pd.DataFrame, split: str, task_name: str)
test/classification/test_classifier_convergence.py:90
↓ 2 callersFunctioncreate_dummy_task
(task_name)
test/slicing/test_utils.py:112
next →1–100 of 630, ranked by callers