Data and ML reference
Secure loading and validation for discovered AGENT-K datasets.
(c) Mike Casale 2025. Licensed under the MIT License.
DatasetBundle
dataclass
Validated training and unlabeled prediction frames.
Source code in agent_k/data.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | |
train_features
property
train_features: DataFrame
Return training features in manifest order.
train_targets
property
train_targets: DataFrame
Return training targets in manifest order.
predict_features
property
predict_features: DataFrame
Return prediction features in manifest order.
predict_ids
property
predict_ids: DataFrame
Return prediction IDs in manifest order.
load_dataset
load_dataset(manifest: DatasetManifest, input_root: Path, *, verify_hashes: bool = True) -> DatasetBundle
Load a manifest and enforce the train/predict trust boundary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
manifest
|
DatasetManifest
|
Discovered dataset contract. |
required |
input_root
|
Path
|
Root containing manifest-relative assets. |
required |
verify_hashes
|
bool
|
Whether to verify immutable asset digests. |
True
|
Returns:
| Type | Description |
|---|---|
DatasetBundle
|
Validated frames ready for candidate training and prediction. |
Source code in agent_k/data.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | |
read_table
read_table(path: Path) -> DataFrame
Read a supported tabular asset without guessing its format.
Source code in agent_k/data.py
83 84 85 86 87 88 89 90 | |
resolve_input_path
resolve_input_path(root: Path, relative_path: str) -> Path
Resolve a relative asset path while preventing directory traversal.
Source code in agent_k/data.py
93 94 95 96 97 98 99 100 101 102 | |
Dataset discovery and immutable dataset contracts for AGENT-K.
(c) Mike Casale 2025. Licensed under the MIT License.
DataModality
Bases: StrEnum
Supported input modalities.
Source code in agent_k/datasets.py
53 54 55 56 57 58 | |
TaskKind
Bases: StrEnum
Supported supervised-learning task kinds.
Source code in agent_k/datasets.py
61 62 63 64 65 | |
ProblemType
Bases: StrEnum
Complete supported problem taxonomy.
Source code in agent_k/datasets.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | |
from_parts
classmethod
from_parts(modality: DataModality, task: TaskKind) -> ProblemType
Build a problem type from its orthogonal dimensions.
Source code in agent_k/datasets.py
88 89 90 91 | |
DataAsset
Bases: BaseModel
A discovered immutable input asset.
Source code in agent_k/datasets.py
94 95 96 97 98 99 100 101 102 103 | |
DatasetManifest
Bases: BaseModel
Authoritative description inferred from competition data.
Source code in agent_k/datasets.py
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 | |
validate_contract
validate_contract() -> DatasetManifest
Reject ambiguous or internally inconsistent manifests.
Source code in agent_k/datasets.py
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | |
discover_dataset
discover_dataset(root: Path, *, metric_id: str | None = None) -> DatasetManifest
Discover train, prediction, target, ID, modality, and task metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
root
|
Path
|
Directory containing downloaded competition data. |
required |
metric_id
|
str | None
|
Optional trusted competition metric identifier. |
None
|
Returns:
| Type | Description |
|---|---|
DatasetManifest
|
A validated manifest with paths relative to |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If the root or required data files do not exist. |
ValueError
|
If the data roles cannot be inferred without ambiguity. |
Source code in agent_k/datasets.py
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 | |
Pydantic Evals integration for reproducible trusted candidate scoring.
(c) Mike Casale 2025. Licensed under the MIT License.
build_evaluation_dataset
build_evaluation_dataset(requests: Sequence[EvaluationRequest], *, name: str = 'trusted-candidate-evaluations') -> Dataset[EvaluationRequest, EvaluationResult, dict[str, str]]
Build typed Pydantic Evals cases from trusted evaluation requests.
Source code in agent_k/evals.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | |
run_evaluation_dataset
run_evaluation_dataset(dataset: Dataset[EvaluationRequest, EvaluationResult, dict[str, str]], *, max_concurrency: int = 1) -> EvaluationReport[EvaluationRequest, EvaluationResult, dict[str, str]]
Run trusted host-side scoring through Pydantic Evals instrumentation.
Source code in agent_k/evals.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 | |
Trusted split preparation and host-side candidate evaluation for AGENT-K.
(c) Mike Casale 2025. Licensed under the MIT License.
CandidateEngine
Bases: StrEnum
Supported concrete candidate implementations.
Source code in agent_k/evaluator.py
56 57 58 59 60 61 62 63 | |
CandidateStatus
Bases: StrEnum
Terminal candidate execution states.
Source code in agent_k/evaluator.py
66 67 68 69 70 | |
SplitRole
Bases: StrEnum
Trusted holdout purposes.
Source code in agent_k/evaluator.py
73 74 75 76 77 | |
CandidateSpec
Bases: BaseModel
Complete sandbox input contract, intentionally excluding hidden labels.
Source code in agent_k/evaluator.py
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 | |
validate_engine_and_problem
validate_engine_and_problem() -> CandidateSpec
Reject engine, modality, and task combinations that cannot execute.
Source code in agent_k/evaluator.py
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 | |
CandidateResult
Bases: BaseModel
Sandbox result metadata; prediction content remains a separate artifact.
Source code in agent_k/evaluator.py
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | |
validate_terminal_payload
validate_terminal_payload() -> CandidateResult
Require complete artifacts on success and an explanation on failure.
Source code in agent_k/evaluator.py
153 154 155 156 157 158 159 160 161 162 163 164 165 | |
EvaluationRequest
Bases: BaseModel
Host-only trusted evaluation request.
Source code in agent_k/evaluator.py
168 169 170 171 172 173 174 175 176 177 178 179 180 | |
EvaluationResult
Bases: BaseModel
Validated trusted score and its immutable evidence.
Source code in agent_k/evaluator.py
183 184 185 186 187 188 189 190 191 192 193 194 195 196 | |
PreparedSplit
Bases: BaseModel
Materialized candidate input paired with a host-only label location.
Source code in agent_k/evaluator.py
199 200 201 202 203 204 205 206 207 | |
PreparedSplitSet
Bases: BaseModel
Disjoint validation and acceptance split contracts.
Source code in agent_k/evaluator.py
210 211 212 213 214 215 216 | |
SubmissionArtifact
Bases: BaseModel
Immutable evidence for a sample-template-compatible submission.
Source code in agent_k/evaluator.py
219 220 221 222 223 224 225 226 227 | |
build_candidate_spec
build_candidate_spec(split: PreparedSplit, *, candidate_id: str, engine: CandidateEngine, metric_id: MetricId, seed: int = 42, hyperparameters: dict[str, JsonValue] | None = None, offline_assets: dict[str, str] | None = None) -> CandidateSpec
Build a sandbox candidate contract from one prepared split.
Source code in agent_k/evaluator.py
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 | |
build_submission_spec
build_submission_spec(manifest: DatasetManifest, *, candidate_id: str, engine: CandidateEngine, metric_id: MetricId, seed: int = 42, hyperparameters: dict[str, JsonValue] | None = None, offline_assets: dict[str, str] | None = None) -> CandidateSpec
Build a final full-training/unlabeled-test candidate contract.
Source code in agent_k/evaluator.py
267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 | |
hyperparameter_schema
hyperparameter_schema(model: type[BaseModel]) -> str
Render a validated configuration model as a compact prompt-ready JSON schema.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
type[BaseModel]
|
Pydantic model that validates one engine's hyperparameters. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Sorted JSON of each field's type, default, and bounds, with enum members |
str
|
listed under |
Source code in agent_k/evaluator.py
305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 | |
load_candidate_dataset
load_candidate_dataset(spec: CandidateSpec, input_root: Path) -> DatasetBundle
Load candidate-visible data and verify it against the sandbox contract.
Source code in agent_k/evaluator.py
327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 | |
materialize_trusted_splits
materialize_trusted_splits(manifest: DatasetManifest, dataset_root: Path, candidate_root: Path, trusted_root: Path, *, validation_fraction: float = 0.2, acceptance_fraction: float = 0.2, seed: int = 42) -> PreparedSplitSet
Create disjoint tuning and acceptance inputs with host-only labels.
The validation candidate trains on the fit partition. The acceptance candidate trains on all non-acceptance rows, including validation rows, but neither candidate input contains its own holdout labels.
Source code in agent_k/evaluator.py
363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 | |
evaluate_candidate
evaluate_candidate(request: EvaluationRequest) -> EvaluationResult
Validate and score a candidate artifact against inaccessible labels.
Source code in agent_k/evaluator.py
428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 | |
write_candidate_predictions
write_candidate_predictions(spec: CandidateSpec, predict_ids: DataFrame, predictions: DataFrame, output_root: Path, *, started: float, diagnostics: dict[str, JsonValue] | None = None) -> CandidateResult
Validate and atomically describe a candidate prediction artifact.
Source code in agent_k/evaluator.py
507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 | |
write_submission
write_submission(prediction_path: Path, manifest: DatasetManifest, dataset_root: Path, destination: Path, *, metric_id: MetricId | None = None) -> SubmissionArtifact
Map internal predictions into the exact sample-submission schema.
IDs are aligned to the sample template rather than trusted by row position. Probability columns are mapped only when class semantics can be proven; ambiguous same-width schemas are rejected.
Source code in agent_k/evaluator.py
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 | |
Training-only dataset summaries and actionable preprocessing guidance.
(c) Mike Casale 2026. Licensed under the MIT License.
ColumnProfile
Bases: BaseModel
Observable characteristics of one training column.
Source code in agent_k/hints.py
20 21 22 23 24 25 26 27 | |
DatasetProfile
Bases: BaseModel
A compact profile containing no row values or hidden labels.
Source code in agent_k/hints.py
30 31 32 33 34 35 36 | |
profile_training_data
profile_training_data(frame: DataFrame) -> DatasetProfile
Summarize training data without examining validation or acceptance rows.
Source code in agent_k/hints.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | |
summarize_profile
summarize_profile(profile: DatasetProfile, *, max_columns: int = 60) -> dict[str, Any]
Build a prompt-sized view of a profile that stays bounded for wide tables.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
profile
|
DatasetProfile
|
Training-only profile of the candidate-visible table. |
required |
max_columns
|
int
|
Largest number of individual columns to describe. |
60
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Aggregate counts for every column and details for the columns most likely |
dict[str, Any]
|
to need preprocessing: those with missing values first, then low cardinality. |
Source code in agent_k/hints.py
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 | |
Differentiable custom LightGBM objectives for AGENT-K evolution.
(c) Mike Casale 2025. Licensed under the MIT License.
LossId
Bases: StrEnum
Evolvable objective families implemented by this module.
Source code in agent_k/losses.py
36 37 38 39 40 41 42 43 44 45 | |
LossSpec
Bases: BaseModel
Validated parameters for a custom LightGBM objective.
Source code in agent_k/losses.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | |
validate_relevant_parameters
validate_relevant_parameters() -> LossSpec
Ensure an objective cannot be configured with unusable curvature.
Source code in agent_k/losses.py
63 64 65 66 67 68 69 | |
squared_error_objective
squared_error_objective(labels: ArrayLike, raw_predictions: ArrayLike) -> tuple[NDArray[float64], NDArray[float64]]
Return exact gradient and Hessian for half squared error.
Source code in agent_k/losses.py
72 73 74 75 76 77 78 79 | |
asymmetric_squared_objective
asymmetric_squared_objective(labels: ArrayLike, raw_predictions: ArrayLike, *, underprediction_weight: float = 1.0, overprediction_weight: float = 1.0) -> tuple[NDArray[float64], NDArray[float64]]
Penalize under- and overprediction with independently evolvable weights.
Source code in agent_k/losses.py
82 83 84 85 86 87 88 89 90 91 92 93 | |
pseudo_huber_objective
pseudo_huber_objective(labels: ArrayLike, raw_predictions: ArrayLike, *, delta: float = 1.0, min_hessian: float = 1e-06) -> tuple[NDArray[float64], NDArray[float64]]
Return robust pseudo-Huber derivatives with strictly positive curvature.
Source code in agent_k/losses.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 | |
smooth_l1_objective
smooth_l1_objective(labels: ArrayLike, raw_predictions: ArrayLike, *, squared_weight: float = 0.5, epsilon: float = 0.001, min_hessian: float = 1e-06) -> tuple[NDArray[float64], NDArray[float64]]
Blend squared error with a differentiable absolute-error approximation.
Source code in agent_k/losses.py
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | |
smooth_quantile_objective
smooth_quantile_objective(labels: ArrayLike, raw_predictions: ArrayLike, *, quantile: float = 0.5, smoothing: float = 0.05, min_hessian: float = 1e-06) -> tuple[NDArray[float64], NDArray[float64]]
Return derivatives for a smooth approximation to quantile pinball loss.
Source code in agent_k/losses.py
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | |
binary_log_loss_objective
binary_log_loss_objective(labels: ArrayLike, raw_predictions: ArrayLike, *, min_hessian: float = 1e-06) -> tuple[NDArray[float64], NDArray[float64]]
Return binary cross-entropy derivatives from raw LightGBM margins.
Source code in agent_k/losses.py
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | |
multiclass_log_loss_objective
multiclass_log_loss_objective(labels: ArrayLike, raw_predictions: ArrayLike, *, min_hessian: float = 1e-06) -> tuple[NDArray[float64], NDArray[float64]]
Return softmax cross-entropy gradient and diagonal Hessian.
Source code in agent_k/losses.py
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 | |
build_lightgbm_objective
build_lightgbm_objective(spec: LossSpec) -> LightGBMObjective
Build a top-level-compatible objective closure from a validated spec.
Source code in agent_k/losses.py
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 | |
Trusted metric definitions and prediction validation for AGENT-K.
(c) Mike Casale 2025. Licensed under the MIT License.
MetricId
Bases: StrEnum
Exact supported competition metric identifiers.
Source code in agent_k/metrics.py
40 41 42 43 44 45 46 47 48 49 50 51 | |
MetricDirection
Bases: StrEnum
Optimization direction for a trusted metric.
Source code in agent_k/metrics.py
54 55 56 57 58 | |
PredictionKind
Bases: StrEnum
Semantic form required from a candidate.
Source code in agent_k/metrics.py
61 62 63 64 65 66 67 | |
MetricSpec
Bases: BaseModel
Immutable trusted metric behavior.
Source code in agent_k/metrics.py
70 71 72 73 74 75 76 77 | |
metric_spec
metric_spec(metric_id: MetricId) -> MetricSpec
Return trusted behavior for an exact metric identifier.
Source code in agent_k/metrics.py
129 130 131 | |
prediction_columns
prediction_columns(metric_id: MetricId, target_columns: tuple[str, ...], class_labels: tuple[str, ...] = ()) -> tuple[str, ...]
Return the exact candidate output columns for a metric.
Source code in agent_k/metrics.py
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | |
validate_prediction_values
validate_prediction_values(predictions: ArrayLike, metric_id: MetricId, *, class_count: int | None = None) -> NDArray[float64] | NDArray[object_]
Validate shape, finiteness, and probability invariants.
Label metrics intentionally permit string arrays. All other metrics require finite numeric values. Probability matrices must have one column per class and every row must sum to one.
Source code in agent_k/metrics.py
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 | |
score_predictions
score_predictions(metric_id: MetricId, labels: ArrayLike, predictions: ArrayLike, *, class_labels: tuple[str, ...] = ()) -> float
Score trusted hidden labels against already ID-aligned predictions.
Source code in agent_k/metrics.py
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 | |
Production tabular candidates using LightGBM and NVIDIA Kumo Tabular.
(c) Mike Casale 2025. Licensed under the MIT License.
KumoFile
Bases: BaseModel
Digest evidence for one provisioned Kumo Hub file.
Source code in agent_k/tabular.py
74 75 76 77 78 79 80 81 | |
KumoAssetManifest
Bases: BaseModel
Pinned offline Kumo checkpoint set accepted by candidate workers.
Source code in agent_k/tabular.py
84 85 86 87 88 89 90 91 92 93 | |
run_candidate
run_candidate(spec: CandidateSpec, input_root: Path, output_root: Path) -> CandidateResult
Run the selected tabular engine inside an offline candidate sandbox.
Source code in agent_k/tabular.py
127 128 129 130 131 132 133 134 135 136 137 | |
describe_hyperparameters
describe_hyperparameters(engine: CandidateEngine) -> str
Describe the hyperparameters a tabular engine accepts, for evolution prompts.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
engine
|
CandidateEngine
|
Tabular engine whose |
required |
Returns:
| Type | Description |
|---|---|
str
|
A compact contract listing accepted names; unknown names fail the candidate. |
Source code in agent_k/tabular.py
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | |
run_lightgbm_candidate
run_lightgbm_candidate(spec: CandidateSpec, input_root: Path, output_root: Path) -> CandidateResult
Train LightGBM models and emit metric-appropriate predictions.
Source code in agent_k/tabular.py
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | |
run_kumo_candidate
run_kumo_candidate(spec: CandidateSpec, input_root: Path, output_root: Path) -> CandidateResult
Run offline pretrained Kumo Tabular inference with eight estimators by default.
Source code in agent_k/tabular.py
239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 | |
provision_kumo_assets
provision_kumo_assets(output: Path, *, size: str = 'small') -> KumoAssetManifest
Download the pinned Kumo files for a manually approved offline worker gate.
This provisioning function is deliberately separate from candidate execution. Candidate sandboxes remain network-disabled and accept only the resulting cache plus its digest manifest.
Source code in agent_k/tabular.py
855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 | |
main
main(argv: list[str] | None = None) -> int
Run explicit asset provisioning commands; candidate execution uses the runner.
Source code in agent_k/tabular.py
924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 | |
TF-IDF linear and offline transformer candidates for AGENT-K text tasks.
(c) Mike Casale 2025. Licensed under the MIT License.
describe_hyperparameters
describe_hyperparameters(engine: CandidateEngine) -> str
Describe the hyperparameters a text engine accepts, for evolution prompts.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
engine
|
CandidateEngine
|
Text engine whose |
required |
Returns:
| Type | Description |
|---|---|
str
|
A compact JSON-schema contract; unknown names fail the candidate. |
Source code in agent_k/text.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | |
run_candidate
run_candidate(spec: CandidateSpec, input_root: Path, output_root: Path) -> CandidateResult
Run the selected production text engine.
Source code in agent_k/text.py
109 110 111 112 113 114 115 116 117 118 119 | |
run_tfidf_candidate
run_tfidf_candidate(spec: CandidateSpec, input_root: Path, output_root: Path) -> CandidateResult
Fit a word n-gram TF-IDF representation and a regularized linear model.
Source code in agent_k/text.py
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 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | |
run_transformer_candidate
run_transformer_candidate(spec: CandidateSpec, input_root: Path, output_root: Path) -> CandidateResult
Fine-tune a locally mounted Hugging Face sequence model without network access.
Source code in agent_k/text.py
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 | |
Offline ResNet18 training and inference for AGENT-K vision tasks.
(c) Mike Casale 2025. Licensed under the MIT License.
describe_hyperparameters
describe_hyperparameters() -> str
Describe the hyperparameters the ResNet18 engine accepts, for evolution prompts.
Source code in agent_k/vision.py
98 99 100 | |
run_candidate
run_candidate(spec: CandidateSpec, input_root: Path, output_root: Path) -> CandidateResult
Fine-tune an actual ResNet18 and emit trusted-contract predictions.
Source code in agent_k/vision.py
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 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 | |