Giter Site home page Giter Site logo

Comments (2)

fedshyvana avatar fedshyvana commented on August 17, 2024 1

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.

sebastianffx avatar sebastianffx commented on August 17, 2024

Perfect, this is clear now, Thanks!

from clam.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.