Metadata-Version: 2.4 Name: GA_HW Version: 0.0.1 Project-URL: Homepage, https://github.com/JorgePiquerasMarques Project-URL: Orcid, https://orcid.org/0000-0002-6812-2106 Author-email: Jorge Piqueras-Marqués License-File: LICENSE.txt Requires-Python: >=3.0 Description-Content-Type: text/markdown # Genetic Algorithm - Hamming Weight (GA_HW) # Description Python implementation of the GA_HW algorithm. The GA_HW is a Genetic Algorithm-based method which can be used for variable selection, or more specifically for the abbreviation of a categorical interview. In the context of psychiatric interviews, it can be applied to obtain optimal screeners for the disorder of interest. The method considers a set of m variables, and obtains the subset of n\100, the population size should not be lower than 1000. As for the cross-over probability, `cr_prob`=0.6 is a sensible value which has shown good results in test data. However, we encourage the user to experiment with different values to explore convergence. ------------------------------------------------------------------------ **Q: What does the `thr_search` parameter do? When should I turn it `True`?** A: In the GA_HW, the screeners in the population are evaluated by training a prediction model (`DecisionTreeClassifier`) and calculating the fitness metric on the resulting classification using 10-fold Cross-validation. A prediction model assigns a probability of positivity to each instance of the dataset. By default, this probability is transformed into a binary classification using a threshold of 0.5. However, the threshold 0.5 for a given prediction model might not be the one which maximizes the fitness metric. When the parameter `thr_search`= `True`, the GA_HW performs a grid search on each evaluation of the fitness to find the optimal value of the classification threshold which maximizes the fitness metric for that specific prediction model. This parameter is irrelevant in the case of selecting the 'auc' as fitness, since no specific classification threshold is used in its evaluation. In other cases, activating the grid search might result in a more optimal solution found by the algorithm, since a optimal screener with a classification threshold different than 0.5 might outperform the more simple solution. In any case, the grid search feature will never provide a worst solution, since the value 0.5 is included on the searched interval. The user should be aware that turning this parameter `True` will considerably increase computation time, since the number of evaluations of the fitness function is multiplied by 10 for each screener.