dd1575073ca40d69c9d9f5f0d64e7517e23eba8a,framework/Optimizers/parentSelectors/parentSelectors.py,,rankSelection,#Any#,118

Before Change


  nParents= kwargs["nParents"]
  pop = population.copy()
  
  selectedParent = xr.DataArray(
      np.zeros((nParents,np.shape(pop)[1])),
      dims=["chromosome","Gene"],
      coords={"chromosome":np.arange(nParents),
              "Gene": kwargs["variables"]})
  
  return selectedParent

After Change


  index = np.arange(0,pop.shape[0])
  rank = np.arange(0,pop.shape[0])
  
  data = np.vstack((fitness,index))
  dataOrderedByDecreasingFitness = data[:,(-data[0]).argsort()]
  dataOrderedByDecreasingFitness[0,:] = rank
  dataOrderedByIncreasingPos = dataOrderedByDecreasingFitness[:,dataOrderedByDecreasingFitness[1].argsort()]
  orderedRank = dataOrderedByIncreasingPos[0,:]
  
  selectedParent = rouletteWheel(population, fitness=orderedRank , nParents=kwargs["nParents"])
  
  return selectedParent
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: idaholab/raven
Commit Name: dd1575073ca40d69c9d9f5f0d64e7517e23eba8a
Time: 2020-07-06
Author: diego.mandelli@inl.gov
File Name: framework/Optimizers/parentSelectors/parentSelectors.py
Class Name:
Method Name: rankSelection


Project Name: fmfn/BayesianOptimization
Commit Name: a676a50e99e489bbd5ee0ed7af9a50a02c074931
Time: 2017-10-11
Author: ajnisbet@gmail.com
File Name: bayes_opt/bayesian_optimization.py
Class Name: BayesianOptimization
Method Name: init


Project Name: markovmodel/PyEMMA
Commit Name: 5cf06ef5ec5a70d2796f3a07cdd1e2cb7932ff66
Time: 2017-08-01
Author: m.scherer@fu-berlin.de
File Name: pyemma/coordinates/clustering/kmeans.py
Class Name: KmeansClustering
Method Name: _initialize_centers