"# of steps in Evolutionary Weighting"

keithkeith Member Posts: 157 Maven
edited May 2019 in Help
If I have an Evolutionary Weighting node, how can I calculate how many times the inner operators will be executed?  It doesn't appear to be a straight product of population_size and maximum_number_of_generations, which would have been my naive guess.  What other parameters would affect it?
Tagged:

Answers

  • TobiasMalbrechtTobiasMalbrecht Moderator, Employee, Member Posts: 294 RM Product Management
    Hi Keith,

    if I do not completely miss something, the number of applications of the inner operators should be indeed equal to the product of population size and max number of generations if [tt]generations_without_improval[/tt] is set to -1. Did you set this parameter to another value?

    Regards,
    Tobias
  • keithkeith Member Posts: 157 Maven
    No, I didn't change the value of that parameter.  What seems to be happening is that the # of iterations is greater than population*generation.  I'll see if I can construct a simple example that shows it, and will post here.
  • TobiasMalbrechtTobiasMalbrecht Moderator, Employee, Member Posts: 294 RM Product Management
    Hi,

    Ok, that would be great.

    Tobias
  • keithkeith Member Posts: 157 Maven
    Here's an example.  There are 10 generations of population 5, so I would expect 50 total calls to XValidation, but the model run is showing 77.  If I turn off keep_best_individual, that drops to 75, but it still higher than I expect.

    <operator name="Root" class="Process" expanded="yes">
        <operator name="ExampleSetGenerator" class="ExampleSetGenerator">
            <parameter key="target_function" value="polynomial"/>
        </operator>
        <operator name="EvolutionaryWeighting" class="EvolutionaryWeighting" expanded="yes">
            <parameter key="keep_best_individual" value="true"/>
            <parameter key="maximum_number_of_generations" value="10"/>
            <parameter key="p_crossover" value="0.5"/>
            <parameter key="tournament_size" value="0.5"/>
            <operator name="XValidation" class="XValidation" expanded="yes">
                <parameter key="create_complete_model" value="true"/>
                <parameter key="sampling_type" value="shuffled sampling"/>
                <operator name="WeightLearner" class="NearestNeighbors">
                    <parameter key="k" value="5"/>
                    <parameter key="weighted_vote" value="true"/>
                </operator>
                <operator name="OperatorChain" class="OperatorChain" expanded="yes">
                    <operator name="ModelApplier" class="ModelApplier">
                        <list key="application_parameters">
                        </list>
                    </operator>
                    <operator name="Performance" class="Performance">
                    </operator>
                </operator>
            </operator>
        </operator>
    </operator>
  • IngoRMIngoRM Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, Community Manager, RMResearcher, Member, University Professor Posts: 1,751 RM Founder
    Hi,

    the reason for this is the way how evolutionary algorithms work:

    1. pairs of individuals are randomly selected and crossover is performed with a certain probability --> depending on this probabbility a random number of additional individuals (children) will be produced and have to be evaluted
    2. on those children mutations might be applied which again will deliver some additional individuals (since RM keeps both the original and the mutated search point) --> again some more individuals to evalute
    3. on the other hand, individuals which did not change will not be re-evaluated --> this can even drop the number of evalutions

    Since all those things happen randomly, it is hard to say how many evaluations will exactly be performed beforehand.

    Cheers,
    Ingo
Sign In or Register to comment.