No flags found
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
ed77718
... +2 ...
3ea77b3
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
420 | 420 | """Return predicted labels, with ties broken according to policy. |
|
421 | 421 | ||
422 | 422 | Policies to break ties include: |
|
423 | - | "abstain": return an abstain vote (-1) |
|
424 | - | "true-random": randomly choose among the tied options |
|
425 | - | "random": randomly choose among tied option using deterministic hash |
|
423 | + | ||
424 | + | - "abstain": return an abstain vote (-1) |
|
425 | + | - "true-random": randomly choose among the tied options |
|
426 | + | - "random": randomly choose among tied option using deterministic hash |
|
426 | 427 | ||
427 | 428 | NOTE: if tie_break_policy="true-random", repeated runs may have slightly different |
|
428 | 429 | results due to difference in broken ties |
472 | 473 | Y |
|
473 | 474 | Gold labels associated with data points in L |
|
474 | 475 | metrics |
|
475 | - | A list of metric names |
|
476 | + | A list of metric names. Possbile metrics are - `accuracy`, `coverage`, |
|
477 | + | `precision`, `recall`, `f1`, `f1_micro`, `f1_macro`, `fbeta`, |
|
478 | + | `matthews_corrcoef`, `roc_auc`. See `sklearn.metrics |
|
479 | + | <https://scikit-learn.org/stable/modules/classes.html#module-sklearn.metrics>`_ |
|
480 | + | for details on the metrics. |
|
476 | 481 | tie_break_policy |
|
477 | - | Policy to break ties when converting probabilistic labels to predictions |
|
482 | + | Policy to break ties when converting probabilistic labels to predictions. |
|
483 | + | Same as :func:`.predict` method above. |
|
478 | 484 | ||
479 | 485 | ||
480 | 486 | Returns |
810 | 816 | class_balance |
|
811 | 817 | Each class's percentage of the population, by default None |
|
812 | 818 | **kwargs |
|
813 | - | Arguments for changing train config defaults |
|
819 | + | Arguments for changing train config defaults. |
|
820 | + | ||
821 | + | n_epochs |
|
822 | + | The number of epochs to train (where each epoch is a single |
|
823 | + | optimization step), default is 100 |
|
824 | + | lr |
|
825 | + | Base learning rate (will also be affected by lr_scheduler choice |
|
826 | + | and settings), default is 0.01 |
|
827 | + | l2 |
|
828 | + | Centered L2 regularization strength, default is 0.0 |
|
829 | + | optimizer |
|
830 | + | Which optimizer to use (one of ["sgd", "adam", "adamax"]), |
|
831 | + | default is "sgd" |
|
832 | + | optimizer_config |
|
833 | + | Settings for the optimizer |
|
834 | + | lr_scheduler |
|
835 | + | Which lr_scheduler to use (one of ["constant", "linear", |
|
836 | + | "exponential", "step"]), default is "constant" |
|
837 | + | lr_scheduler_config |
|
838 | + | Settings for the LRScheduler |
|
839 | + | prec_init |
|
840 | + | LF precision initializations / priors, default is 0.7 |
|
841 | + | seed |
|
842 | + | A random seed to initialize the random number generator with |
|
843 | + | log_freq |
|
844 | + | Report loss every this many epochs (steps), default is 10 |
|
845 | + | mu_eps |
|
846 | + | Restrict the learned conditional probabilities to |
|
847 | + | [mu_eps, 1-mu_eps], default is None |
|
814 | 848 | ||
815 | 849 | Raises |
|
816 | 850 | ------ |
823 | 857 | >>> Y_dev = [0, 1, 0] |
|
824 | 858 | >>> label_model = LabelModel(verbose=False) |
|
825 | 859 | >>> label_model.fit(L) |
|
826 | - | >>> label_model.fit(L, Y_dev=Y_dev) |
|
827 | - | >>> label_model.fit(L, class_balance=[0.7, 0.3]) |
|
860 | + | >>> label_model.fit(L, Y_dev=Y_dev, seed=2020, lr=0.05) |
|
861 | + | >>> label_model.fit(L, class_balance=[0.7, 0.3], n_epochs=200, l2=0.4) |
|
828 | 862 | """ |
|
829 | 863 | # Set random seed |
|
830 | 864 | self.train_config: TrainConfig = merge_config( # type:ignore |
Learn more Showing 9 files with coverage changes found.
snorkel/slicing/sf/nlp.py
snorkel/labeling/lf/nlp.py
snorkel/classification/multitask_classifier.py
snorkel/map/core.py
snorkel/analysis/error_analysis.py
snorkel/preprocess/nlp.py
snorkel/types/__init__.py
snorkel/labeling/model/label_model.py
Files | Coverage |
---|---|
snorkel | -0.03% 97.18% |
Project Totals (67 files) | 97.18% |
#1592
3ea77b3
1544f9d
8ef3ba5
ed77718