affinity_search/ga_addrequests.py
def mutateIndividual(ind, indpb=0.05):
    '''for each param, with prob indpb randomly sample another choice'''
    options = makemodel.getoptions()
    for (param,choices) in options.items():
        if np.random.rand() < indpb:
            ind[param] = randParam(param, choices)
    return (ind,)
for each param, with prob indpb randomly sample another choice
for each param, with prob indpb randomly sample another choice
for each param with prob indpb randomly sample another choice
def mutateIndividual(ind, indpb=0.05):
    options = makemodel.getoptions()
    for (param,choices) in options.items():
        if np.random.rand() < indpb:
            ind[param] = randParam(param, choices)
    return (ind,)
def mutateIndividual ( ind , indpb = 0.05 ) : options = makemodel . getoptions ( ) for ( param , choices ) in options . items ( ) : if np . random . rand ( ) < indpb : ind [ param ] = randParam ( param , choices ) return ( ind , )
for each param, with prob indpb randomly sample another choice
for each param with prob indpb randomly sample another choice
'''for each param, with prob indpb randomly sample another choice'''
ind
indpb