dimanche 18 juin 2017

Select data based on the previous random iteration in Python

I have an arranged dataset, and I need to generate randomly new document based on this dataset. Dataset looks like this:

Name        Find           Parameter       50   30    1
Mammography Mass           Shape           Oval Round Irregular       
Mammography Calcification  Distribution    High Low   None
US          Mass           Shape           Round
US          Lymph          Lymph nodes     None
US          Special Cases  Ignore          None

And if, for example, I choose randomly Mammography, next iteration should go through Mass and Calcification, and if randomly Mass have been chosen, then I need to take corresponding parameter (Shape). Numbers above representing probabilities (not normalized, but if we are continue with this example, probability of Oval Shape is 50/(50+30+1) and it's also a question how to combine all this requirements altogether.

For now I can normalize integer values and randomly choose any value, but I need to understand how I can go along with the previous iteration result.




Aucun commentaire:

Enregistrer un commentaire