Package: jostar
Feature Selection Module for Data Sciences in PythonJostar, from the Farsi wordØ¬Ø³ØªØ§Ø±meaningfinder, is a Python-based feature selection module comprised of nine different feature selection approaches from single objective to multi-objective methods, for regression and classification tasks. The algorithms, to this date, are:Ant Colony Optimization (ACO)Differential Evolution (DE)Genetic Algorithm (GA)Plus-L Minus-R (LRS)Non-dominated Sorting Genetic Algorithm (NSGAII)Particle Swarm Optimization (PSO)Simulated Annealing (SA)Sequential Forward Selection (SFS)Sequential Backward Selection (SBS)FeaturesUser-friendly, Sklearn-like interface (just callfit)Thorough documentation and explanation of hyperparameters and their rangesTune hyperparameters easilyGenerate rankings of the selected featuresDisplay the results of your classification or regression taskExampleWith only few lines of code:fromsklearn.cross_decompositionimportPLSRegressionfromjostar.algorithmsimportACOfromsklearn.metricsimportr2_scoreimportpandasaspddata=pd.read_csv(r"F:\SnapbeanSummer2020\regression_data_v2.csv").to_numpy()x=data[:,1:]y=data[:,0]model=PLSRegression()# # optimizingaco=ACO(model=model,n_f=5,weight=1,scoring=r2_score,n_iter=30)aco.fit(x,y,decor=0.95,scale=True)Evolution of created pareto front via NSGAII:InstallationUse pip as below to install jostar.pipinstalljostarto test if your installation was successful, change path to the directory and run pytest.pytestDocumentationJostar comes with a powerful documentation. Below is the in-line documentation for Genetic Algorithm.classGA(BaseFeatureSelector):def__init__(self,model,n_f,weight,scoring,n_gen=1000,n_pop=20,cv=None,cross_perc=0.5,mut_perc=0.3,mut_rate=0.02,beta=5,verbose=True,random_state=None,**kwargs):"""Genetic Algorithms or GA is a widely used global optimization algorithmwhich was first introduced by Holland. GA is based on the natural selectionin the evolution theory. Properties of GA such as probability of mutation andcross over determines the specifics of the search done in each iteration.Additionally, we can also set the proportion of the population we want toperform cross over or mutation for.Parameters----------model : classInstantiated Sklearn regression or classification estimator.n_f : intNumber of features needed to be extracted.weight : intMaximization or minimization objective, for maximization use +1and for mimization use -1.scoring : callableCallable sklearn score or customized score function that takes in y_pred and y_truen_gen : int, optionalMaximum number of generations or iterations. For more complexproblems it is better to set this parameter larger.The default is 1000.n_pop : int, optionalNumber of population size at each iteration. Typically, thisparameter is set to be 10*n_f, but it is dependent on the complexityof the model and it is advised that user tune this parameter basedon their problem. The default is 20.cv : class, optionalInstantiated sklearn cross-validation class. The default is None.cross_perc : float,The percentage of the population to perform cross over on. A commonchoice for this parameter is 0.5. The larger cross_perc is chosen,the more exploition of the current population. The default is 0.5.mut_perc : float, optionalThe percentage of the population to perform mutation on. This isusually chosen a small percentage (smaller than cross_perc). Asmut_perc is set larger, the model explorates more.The default is 0.1.mut_rate : float, optionalThe mutation rate. This parameter determines the probability ofmutation for each individual in a population. It is often chosena small number to maintain the current good solutions.The default is 0.1.beta : int, optionalSelection Pressure for cross-over. The higher this parameter thestricter the selection of parents for cross-over. This valuecould be an integer [1,10]. The default valueis 5.verbose : bool, optionalWether to print out progress messages. The default is True.random_state : int, optionalDetermines the random state for random number generation,cross-validation, and classifier/regression model setting.The default is None.Returns-------Instantiated Optimziation model class."""Developing JostarIf you would like to develop and run tests for Jostar, run the following command in you virtual environment to install dev dependencies:$pipinstall-e.[dev]Acknowledgement and ReferencesJostar is an extended Python version ofYPEAdeveloped in MATALB.
If you found this project useful in your research, pelase consider citing our paper.@article{Hassanzadeh_2021, title={Broadacre Crop Yield Estimation Using Imaging Spectroscopy from 
Unmanned Aerial Systems (UAS): A Field-Based Case Study with Snap Bean}, volume={13}, 
ISSN={2072-4292}, url={http://dx.doi.org/10.3390/rs13163241}, DOI={10.3390/rs13163241}, 
number={16}, journal={Remote Sensing}, publisher={MDPI AG}, 
author={Hassanzadeh, Amirhossein and Zhang, Fei and van Aardt, Jan and Murphy, 
Sean P. and Pethybridge, Sarah J.}, year={2021}, month={Aug}, pages={3241}}