Comments (2)
Hi Sebastian, val_num and test_num are supposed to be tuples (or arrays) of integers representing the number of WSIs (or cases) you want to sample into the validation set and test set respectively, for each class you have. e.g. if you have 3 classes, val_num = (8, 5, 20) means you want to draw 8 WSIs (or cases) from the 1st class into the validations et, 5 from the 2nd class and 20 from the 3rd class.
I say WSIs or cases because if you set patient_strat = True in the dataset constructor, the splits are created at a patient/case-level instead of the WSI-level, and all WSIs from the same case are drawn together if that case is drawn (if you have multiple WSIs for that case). If patient_strat = False, then each WSI is treated as a single case.
You can also automatically calculate the number of cases to draw if you want lets say, 10% of cases in the validation set and 10% of cases in the test set. This can be done by using for example:
num_slides_cls = np.array([len(cls_ids) for cls_ids in dataset.patient_cls_ids])
val_num = np.floor(num_slides_cls * 0.1).astype(int)
test_num = np.floor(num_slides_cls * 0.1).astype(int)
after the dataset construction and before the if name == 'main' body of the code.
and you should check the partitions after they're created, in the splits folder. There should also be a description file, letting you know how many cases from each class were sampled into each split.
from clam.
Perfect, this is clear now, Thanks!
from clam.
Related Issues (20)
- Questions about threshold parameters
- Datasets in configuration file and GPU Training Step
- KeyError: "Unable to synchronously open attribute (can't locate attribute: 'patch_level')" HOT 1
- Adapting data loader to multi class & multi label
- Problem running split in CONCH/CLAM environment
- expand sdpc format HOT 3
- vsi format
- Color Issue in Heatmap File C3L-01663-21_0.75_roi_0_blur_0_rs_1_bc_0_a_0.4_l_1_bi_0_0.2.jpg in heatmap_production_results\HEATMAP_OUTPUT\LSCC Folder
- heatmap HOT 1
- Poor removal of small holes in pathological tissue, how should the parameters be adjusted
- Heatmaps are patchy and not smooth HOT 1
- Extracting Raw Patches (.jpg / ./png)
- Attention maps for multiple predictions
- The first step to get the segment , the margin is too large
- About the custom_downsample parameter in extract_feature_fp.py
- openslide.lowlevel.OpenSlideUnsupportedFormatError: Unsupported or missing image file
- 1 to 1 correspondence between slide (*.svs) and patches/stitches??? HOT 1
- model types 'clam_sb', 'clam_mb', 'mil'
- Identify tumor regions
- Heatmaps visualization
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clam.