Skip to main content

Batch Effect Removal Neural Networks for Tandem Mass Spectrometry

Project description

BERNN-MSMS

Minimal README for quick usage.

Longer historical content is kept in LEGACY_README.md.

Install

pip install bernn

Basic usage

from bernn import TrainAEClassifierHoldout

trainer_cls = TrainAEClassifierHoldout
trainer = trainer_cls(config=bernn_config, log_metrics=True, keep_models=False)

# Train and predict in one call
preds_encoded = trainer.fit_predict(
    X_train,
    y_train,
    X_test=X_test,
    y_test=y_test,
    groups_train=batches_train,
    groups_test=batches_test,
    cross_validation=False,
    cross_test=False,
)

# Decode predictions back to original labels
preds = trainer.predict(X_test)

Important runtime contract:

  • groups_train is mandatory.
  • If X_test is provided, groups_test is mandatory.

Important parameters

Focus on these first:

  • optimize_hyperparams: enable/disable Ax optimization.
  • n_trials: number of optimization trials.
  • fixed_hyperparams: force values and remove them from search.
  • n_repeats: number of holdout repeats.
  • n_layers, layer1: classifier depth and width seed.
  • dloss: domain loss mode.
  • warmup, n_epochs: core training schedule.
  • device: cpu/cuda target.
  • scaler, bs: preprocessing and batch size.

Official documentation

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bernn-0.4.8.tar.gz (275.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bernn-0.4.8-py3-none-any.whl (292.9 kB view details)

Uploaded Python 3

File details

Details for the file bernn-0.4.8.tar.gz.

File metadata

  • Download URL: bernn-0.4.8.tar.gz
  • Upload date:
  • Size: 275.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for bernn-0.4.8.tar.gz
Algorithm Hash digest
SHA256 d66de4d20defc8e2ccfd28b1ebb61a103fcddb63cf3867c2be339d1f054016f2
MD5 52a4d99c21ebb9ea8cd9998c7aeb7b19
BLAKE2b-256 158f8a6cc8a5bd1da6b6b5382390d256cf9b96d58075fb1477a62297ff2cf9ee

See more details on using hashes here.

File details

Details for the file bernn-0.4.8-py3-none-any.whl.

File metadata

  • Download URL: bernn-0.4.8-py3-none-any.whl
  • Upload date:
  • Size: 292.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for bernn-0.4.8-py3-none-any.whl
Algorithm Hash digest
SHA256 23f3b5d93550b2c0946ea2a52f0a765b271ea43cc65e43be6225d21d51797891
MD5 846b3739c676a3b1f8f8ecd3193a63d3
BLAKE2b-256 d627bf656131299484f8273589560e78d3460be13fb7c3a35f1f1e94f1414384

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page