evaluate_splits¶
The train/test leakage evaluation. Needs MMseqs2 on PATH; see the
installation notes.
evaluate_splits
¶
Detect data leakage between the train and test halves of a dataset split.
Stages both halves to FASTA, runs an MMseqs2 easy-search of test against
train, and reports how much of the test set has a near-identical counterpart in
training - sequences a model can score correctly by memorisation alone.
run is the entry point; the CLI is a thin wrapper around it. The report layout
is defined in genomic_benchmarks_qc.utils.naming.
run
¶
run(
train_files,
test_files,
format,
out_folder='.',
sequence_column=None,
report_types=None,
similarity_threshold=90.0,
threads=None,
split_memory_limit=None,
keep_tmp_files=False,
log_level='INFO',
log_file=None,
)
Search the test half of a split against the train half and report the leakage.
Reports go to 'out_folder.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
train_files
|
list[str]
|
Paths to the training files. |
required |
test_files
|
list[str]
|
Paths to the testing files. |
required |
format
|
str
|
Format of the input files (fasta, csv, csv.gz, tsv, tsv.gz). |
required |
out_folder
|
str | None
|
Path to the output folder; reports go into ' |
'.'
|
sequence_column
|
list[str] | None
|
Columns holding the sequences, for CSV/TSV input. Several
columns are concatenated per row and searched together.
Default: |
None
|
report_types
|
list[str] | None
|
Types of reports to generate, from
REPORT_TYPES.
Default: |
None
|
similarity_threshold
|
float | None
|
Percent similarity at which a test sequence counts as
leaked. Similarity is |
90.0
|
threads
|
int | None
|
Maximum number of threads MMseqs2 will use. Default: |
None
|
split_memory_limit
|
str | None
|
Upper RAM limit for MMseqs2 prefilter structures (e.g., 10G,
1T). Default: |
None
|
keep_tmp_files
|
bool | None
|
Keep the MMseqs2 scratch files instead of deleting them.
Default: |
False
|
log_level
|
str | None
|
Logging level. Default: |
'INFO'
|
log_file
|
str | None
|
Path to a log file. Logs go to the console either way. |
None
|
Source code in src/genomic_benchmarks_qc/evaluate_splits.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 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 356 357 358 359 360 361 362 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 | |