Package: vulpes
VulpesVulpes: Test many classification, regression models and clustering algorithms to see which one is most suitable for your dataset.Vulpes 🦊 is a Python package that allows you to test many models, whether you want to do classification, regression or clustering in your projects. It calculates many metrics for each model to compare them. It is highly customizable and it contains many features to save time building robust ML models.If you like this project, please leave a star ⭐ on GitHub !Alpha version.Author & Maintainer: Adrien Carrel.InstallationUsing pip:pipinstallvulpesDependenciesvulpes requires:Python (>= 3.7)numpy (>= 1.22)pandas (>= 1.3.5)scikit-learn (>= 1.0.2)tqdm (>= 4.64.0)xgboost (>= 1.6.1)lightgbm (>= 3.3.2)DocumentationLink to the documentation:https://vulpes.readthedocs.io/en/latest/ExamplesGeneral case, import one of the classes Classifiers, Regressions, Clustering from vulpes.automl, add some parameters to the object (optional), fit your dataset:fromvulpes.automlimportClassifiersclassifiers=Classifiers()classifiers.fit(X,y)More examples below and in notebooks in the folterexamples.ClassificationFit many classification algorithms on the iris dataset from scikit-learn:importpandasaspdfromsklearn.datasetsimportload_irisfromvulpes.automlimportClassifiersdataset=load_iris()X=pd.DataFrame(dataset["data"],columns=dataset["feature_names"])y=dataset["target"]classifiers=Classifiers(preprocessing="default")df_models=classifiers.fit(X,y)df_modelsAnalysis of each model using different metrics and repeated cross-validation by K-fold:ModelBalanced AccuracyAccuracyPrecisionRecallF1 ScoreAUROCAUPRCMicro avg PrecisionRunning timeLinearDiscriminantAnalysis0.9776250.9773330.9780240.9776250.9769330.9981610.9968910.9969404.372556QuadraticDiscriminantAnalysis0.9732190.9733330.9754600.9732190.9731620.9990630.9975950.9976344.470590LogisticRegressionCV0.9616090.9613330.9641010.9616090.9606680.9972180.9932640.99337512.895212SVC0.9612870.9600000.9620450.9612870.9599600.9968250.9944210.9945104.437862RandomForestClassifier0.9572200.9560000.9599820.9572200.9553940.9934730.9903670.98995810.645725GaussianNB0.9571690.9546670.9561880.9571690.9545210.9938250.9904630.9906194.345500ExtraTreesClassifier0.9564380.9560000.9586650.9564380.9551570.9951560.9917950.99170410.440453LogisticRegression0.9560940.9546670.9572730.9560940.9544270.9977260.9947650.9948485.691309GradientBoostingClassifier0.9558710.9533330.9569840.9558710.9533640.9832210.9671450.9713179.005045XGBClassifier0.9528460.9506670.9527450.9528460.9503240.9858920.9690830.9728534.802282BaggingClassifier0.9527120.9506670.9552140.9527120.9505810.9852950.9823120.9717428.354026KNeighborsClassifier0.9526990.9506670.9515860.9526990.9506830.9908420.9867160.9802626.960091AdaBoostClassifier0.9504320.9466670.9492500.9504320.9471140.9882020.9818890.9779998.127254LGBMClassifier0.9500090.9480000.9504260.9500090.9475220.9917210.9854830.9857045.063474LabelSpreading0.9487570.9453330.9479600.9487570.9460910.9888270.9811770.9815524.332253HistGradientBoostingClassifier0.9481950.9453330.9492600.9481950.9453520.9882120.9763750.9768667.706454LabelPropagation0.9460910.9440000.9463730.9460910.9442500.9903410.9840980.9843734.406253MLPClassifier0.9447730.9413330.9453360.9447730.9423140.9920750.9855160.9857627.662322DecisionTreeClassifier0.9426810.9413330.9444930.9426810.9401830.9570110.9511110.9080004.367503LinearSVC0.9367130.9360000.9375480.9367130.9339290.9896480.9832510.9835394.474272ExtraTreeClassifier0.9339640.9320000.9349670.9339640.9311370.9504730.9433330.8932894.336813SGDClassifier0.9225810.9186670.9275930.9225810.9196510.9819400.9628390.9634845.666082CalibratedClassifierCV0.8948600.8880000.8966160.8948600.8873970.9722310.9576430.9583325.699280Perceptron0.8735810.8653330.8877990.8735810.8641720.9760690.9457890.9466954.482433NearestCentroid0.8545660.8546670.8547070.8545660.8493410.9732140.9636770.9642575.783815RidgeClassifier0.8437430.8346670.8488790.8437430.8313100.9451480.9209050.9222194.415888RidgeClassifierCV0.8410490.8320000.8464980.8410490.8285920.9444210.9194600.9208164.484041BernoulliNB0.7574250.7586670.7718670.7574250.7288470.8835420.8393970.8238344.479535DummyClassifier0.3333330.2493330.0831110.3333330.1324520.5000000.3791000.2994444.396426Here, the "default" preprocessing pipeline has been used. It consists of SimpleImputer (median strategy) with a StandardScaler for the features and a OneHotEncoder for the categorical features.RegressionsFit many regression algorithms:fromsklearn.datasetsimportmake_regressionfromvulpes.automlimportRegressionsX,y=make_regression(n_samples=100,n_features=4,random_state=42,noise=4.0,bias=100.0)regressions=Regressions()df_models=regressions.fit(X,y)df_modelsClusteringFit many clustering algorithms on the iris dataset from scikit-learn:importpandasaspdfromsklearn.datasetsimportload_irisfromvulpes.automlimportClusteringdataset=load_iris()X=pd.DataFrame(dataset["data"],columns=dataset["feature_names"])clustering=Clustering()df_models=clustering.fit(X)df_modelsFit a "best model"We can automatically build a VotingClassifier or a VotingRegressor using the build_best_models method once the models are fitted.df_best=classifiers.build_best_models(X,y,nb_models=3)df_bestModelBalanced AccuracyAccuracyPrecisionRecallF1 ScoreRunning timeVoting (3-best)0.975080.9746670.9760340.975080.97444711.82946Check missing dataimportpandasaspdimportnumpyasnpdf=pd.DataFrame([["a","x"],[np.nan,"y"],["a",np.nan],["b",np.nan]],dtype="category",columns=["feature1","feature2"])classifiers.missing_data(df)Total MissingPercentage (%)Accuracyfeature2250.0feature1125.0TestingIf you want to submit a pull request or if you want to test in local the package, you can run some tests with the library pytest by running the following command:pytestvulpes/tests/Why Vulpes?Vulpes stands for:Vector (Un)supervisedLearningProgramEstimationSystem.Nah, I'm kidding, I just love foxes, they are cute! The most common and widespread species of fox is the red fox (Vulpes vulpes).AcknowledgmentShankar Rao Pandala (and some contributors). Their package (Lazy Predict) has been an inspiration.LicenseMITChangelog0.2.0 (2022/07/05)More documentation, add the ability to modify hyperparameters for different pipeline elements.0.1.0 (2022/07/01)Version 1 of the Vulpes python package.