Skip to content

Prediction crashes for 100 random if no. of genes in smaller than 100 #31

@SMZmk

Description

@SMZmk

Like the title - see error:

ValueError: Cannot take a larger sample than population when 'replace=False'
Traceback:
File "/root/.local/share/mamba/envs/deepCRE_CPU/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/exec_code.py", line 85, in exec_func_with_error_handling
result = func()
File "/root/.local/share/mamba/envs/deepCRE_CPU/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 576, in code_to_exec
exec(code, module.dict)
File "/app/app.py", line 173, in
main()
File "/app/app.py", line 58, in main
x, gene_ids, gene_chroms, gene_starts, gene_ends, gene_size, gene_gc_cont, gene_strands = getDataset()
File "/app/lib/storage.py", line 40, in getDataset
st.session_state.dataset = prepare_dataset(genome=st.session_state.current_genome, annot=st.session_state.current_annotation,
File "/app/lib/utils.py", line 48, in prepare_dataset
gene_models_overlap = gene_models.sample(n=100)
File "/root/.local/share/mamba/envs/deepCRE_CPU/lib/python3.9/site-packages/pandas/core/generic.py", line 6118, in sample
sampled_indices = sample.sample(obj_len, size, replace, weights, rs)
File "/root/.local/share/mamba/envs/deepCRE_CPU/lib/python3.9/site-packages/pandas/core/sample.py", line 152, in sample
return random_state.choice(obj_len, size=size, replace=replace, p=weights).astype(
File "numpy/random/mtrand.pyx", line 1001, in numpy.random.mtrand.RandomState.choice

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions