pelinker.cli.fit¶
FitCliConfig
dataclass
¶
Hydra config for python -m pelinker.cli.fit.
Source code in pelinker/cli/fit.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | |
clustering_sample_index = 0
class-attribute
instance-attribute
¶
Bootstrap index for clustering subsample (match model-selection sample_idx).
clustering_sample_rows = None
class-attribute
instance-attribute
¶
Max mention rows per clustering bootstrap draw (stratified). None = use all loaded rows.
mention_cap_seed = None
class-attribute
instance-attribute
¶
Seed for per-entity mention cap; defaults to seed when omitted.
pca_seed = 13
class-attribute
instance-attribute
¶
Random seed for PCA and cluster-viz PCA.
projection_enabled = True
class-attribute
instance-attribute
¶
When false, skip 3D manifold OOV score model (no predict-time gate from that path).
screener_kind = 'lda'
class-attribute
instance-attribute
¶
lda or svm; persisted as :attr:~pelinker.model.Linker.screener.
seed = 13
class-attribute
instance-attribute
¶
Bootstrap seed for clustering subsample draws (base_seed); also default for mention-cap and screener draws.
umap_seed = None
class-attribute
instance-attribute
¶
UMAP random seed; omit (None) for parallel UMAP. Set for reproducible production fits.
fit(cfg)
¶
Run embedding (optional), fit a Linker from parquet(s) (optional), and write outputs.
Paths (no implicit fallbacks — missing required paths raise):
embeddings_parquet: output path(s) forembed_only/bothstage (A), or input parquet(s) forfit_only/bothstage (B).report_path: directory; fit stages writelinker_fit.clustering_report.json.gzandlinker_fit.cluster_composition.json.gzthere (see :func:pelinker.reporting.linker_fit_clustering_report_pathand :func:pelinker.reporting.linker_fit_cluster_composition_path).model_path: filesystem path passed toLinker.dumpfor fit stages.
Pipelines:
pipeline=auto: embed then fit ifinput_text_table_pathis set; else fit from parquet.pipeline=embed_only: write parquet(s) only (model_path/report_pathnot used).pipeline=fit_only: fit from existing parquet(s); requiresmodel_pathandreport_path.pipeline=both: text table + embed then fit; requiresmodel_pathandreport_path.
Multiple embeddings_parquet values fuse in list order (inner join on pmid/entity/mention).
Set model_types / layers_specs (or scalars) so embedding_metadata.sources matches;
or infer model_type / layers_spec from each filename stem when lists are omitted.
Source code in pelinker/cli/fit.py
540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 | |