Skip to main content

A batch effect correction method for subregional radiomics dataset

Project description

if name == "main": # 示例用法 dataA = pd.read_csv('./dataA.csv', header=None).values dataB = pd.read_csv('./dataB.csv', header=None).values

aligner = BatchAlignerAdvanced(
    pca_components=0.99,
    init_strategy='mi_based',
    noise_scale='auto',
    max_iter=30,
    verbose_changes=True
)

batch1 = dataA[:, :-1].astype(np.float64)
batch2 = dataB[:, :-1].astype(np.float64)
final_weights, final_pairs = aligner.fit(batch1, batch2)
adjusted_B, used_pairs = aligner.adjust_batch(batch1, batch2)

print("\n=== 最终结果 ===")
print(f"匹配对数: {len(final_pairs)}")
print(f"权重范围: {np.min(final_weights):.2f}-{np.max(final_weights):.2f}")
print(f"权重中位数: {np.median(final_weights):.2f}")
print("前10个特征权重:", np.round(final_weights[:10], 2))
print(final_pairs)
pd.DataFrame(adjusted_B).to_csv('corrected_B02.csv', index=False, header=False)

Project details


Download files

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

Source Distribution

besmnncorrect-0.1.1.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

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

besmnncorrect-0.1.1-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file besmnncorrect-0.1.1.tar.gz.

File metadata

  • Download URL: besmnncorrect-0.1.1.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.13

File hashes

Hashes for besmnncorrect-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ddeedc27baaea845141a675389a2739dc82ae39560280d0ffa0ce8027303528f
MD5 391535ca6a2fe795253b2bbd54f313db
BLAKE2b-256 24d9592ed9e1c047b9db52e8c18ab0047bc71da997d5837310c99d65526ec5ff

See more details on using hashes here.

File details

Details for the file besmnncorrect-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: besmnncorrect-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.13

File hashes

Hashes for besmnncorrect-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5ec3402e2d88f763c244193e69d0ca8138959e0e879ba524a3f8468aaeb8fc87
MD5 9abb1320b24bdff04f26e3ce550e5a14
BLAKE2b-256 7d9dfd7690f24caa00420e235e622d6fe194f8210b8a66b9a005049e79c40847

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