ç®æšïŒAutoGluonã詊ããŠã¿ãïŒ ä»åã¯è¿å¹Žè©±é¡ã«ãªã£ãŠããAutoMLã®äžã€ã§ããAutoGluonã®ã¯ã€ãã¯ã¹ã¿ãŒãã詊ããŠã¿ãŠãå®éã«ã©ã®ãããªããšãã§ããã®ããçè§£ããããšæããŸãïŒ ãªããã®ãã£ã¬ã³ãžãããã®ã è¿å¹ŽãçæAIãããŒã¿ãµã€ãšã³ã¹æ¥çã®çºå±ã«ãããåŠçã®ããŒã¿ãµã€ãšã³ã¹åã幎ã
åäžããŠããŸãããã®åœ±é¿ããããæ¯å¹Žéå¬ããŠããããŒã¿ãµã€ãšã³ãã£ã¹ãã³ãŒã¹ã®ã€ã³ã¿ãŒã³ã·ããã§ã¯ãæš¡ç¯è§£çã®ç²ŸåºŠãåŠçã®ç²ŸåºŠãããäœããšããçµæã«ãªã£ãŠããŸã£ãããšãâŠã ããã¯ãŸãããšããããšã§ãAutoMLãäºæž¬ç²ŸåºŠåäžã«åœ¹ç«ã€ã®ã§ã¯ãªãããšæãã詊ããŠã¿ãããšã«ããŸããïŒ AutoMLïŒèªåæ©æ¢°åŠç¿ïŒã¯ãæ©æ¢°åŠç¿ã¢ãã«ã®æ§ç¯ããã»ã¹ãç°¡çŽ åããå°éç¥èããªããŠãé«ç²ŸåºŠãªã¢ãã«ãäœæã§ããããã«ããæè¡ã§ããAutoGluonã¯ãã®äžã§ãç¹ã«äœ¿ããããã匷åãªããŒã«ãšããŠæ³šç®ãããŠããŸãã ç§ã¯AutoMLã¯å
šãè§Šã£ãããšããªãåå¿è
ã§ããããã®ãã£ã¬ã³ãžãéããŠAutoGluonã®åºæ¬çãªäœ¿ãæ¹ãåŠã³ãå®éã®ããŒã¿ã»ããã§è©ŠããŠã¿ãããšã§ããã®å©äŸ¿æ§ãšæ§èœãäœæããããšæããŸãïŒ AutoGluonãšã¯ AutoGluonã¯ãAmazonãéçºãããªãŒãã³ãœãŒã¹ã®AutoMLãã¬ãŒã ã¯ãŒã¯ã§ãã以äžã®ç¹åŸŽããããŸãã ç°¡åãªã€ã³ã¹ããŒã«ãšäœ¿çš ïŒæ°è¡ã®ã³ãŒãã§ã¢ãã«ã®ãã¬ãŒãã³ã°ãšäºæž¬ãå¯èœã§ãã 倿§ãªããŒã¿åœ¢åŒã«å¯Ÿå¿ ïŒè¡šåœ¢åŒããŒã¿ãç»åãããã¹ããæç³»åããŒã¿ãªã©ãããŸããŸãªããŒã¿ã¿ã€ãããµããŒãããŸãã èªååãããããã»ã¹ ïŒç¹åŸŽéãšã³ãžãã¢ãªã³ã°ãã¢ãã«éžæããã€ããŒãã©ã¡ãŒã¿èª¿æŽãªã©ãå€ãã®ã¹ããããèªååãããŠããŸãã AutoGluon Tabular - ã¯ã€ãã¯ã¹ã¿ãŒã è±èªã®ã¯ã€ãã¯ã¹ã¿ãŒãã翻蚳ããŠããã®ã§ãå€å°ã®æ¥æ¬èªã®å€ãªãšããã¯ã¹ã«ãŒããŠããã ãããšå©ãããŸãã å®éã«å®è¡ãããæ¹ã¯ãã¡ãã®ãªã³ã¯ããå®è¡ã§ããŸãïŒ ã€ã³ã¹ããŒã« ãŸãã¯ãAutoGluonã® TabularDataset ãš TabularPredictor ãã€ã³ããŒãããŸãã TabularDataset ïŒããŒã¿ãããŒãããéã«å©çš TabularPredictor ïŒã¢ãã«ããã¬ãŒãã³ã°ãšäºæž¬ã«å©çš ! python - m pip install -- upgrade pip ! python - m pip install autogluon from autogluon . tabular import TabularDataset , TabularPredictor ãµã³ãã«ããŒã¿ 䜿çšããããŒã¿ã»ããïŒ Nature issue 7887 ãã®ããŒã¿ã»ããã®ç®çã¯ãçµã³ç®ã®ç¹æ§ã«åºã¥ããŠãã®ã·ã°ããã£ãäºæž¬ããããšã§ãã å
ã®ããŒã¿ãã10,000ã®ãã¬ãŒãã³ã°äŸãš5,000ã®ãã¹ãäŸããµã³ããªã³ã°ããŠããŸãïŒ ãªãªãžãã«ããŒã¿ ïŒã ãµã³ããªã³ã°ãããããŒã¿ã»ããã«ããããã®ãã¥ãŒããªã¢ã«ã¯è¿
éã«å®è¡ã§ããŸãããå¿
èŠã«å¿ããŠAutoGluonã¯ãã«ããŒã¿ã»ãããåŠçããããšãã§ããŸãã data_url = ' https://raw.githubusercontent.com/mli/ag-docs/main/knot_theory/ ' train_data = TabularDataset ( f ' { data_url } train.csv' ) train_data . head () Unnamed: 0 chern_simons cusp_volume hyperbolic_adjoint_torsion_degree hyperbolic_torsion_degree injectivity_radius longitudinal_translation meridinal_translation_imag meridinal_translation_real short_geodesic_imag_part short_geodesic_real_part Symmetry_0 Symmetry_D3 Symmetry_D4 Symmetry_D6 Symmetry_D8 Symmetry_Z/2 + Z/2 volume signature 0 70746 0.090530 12.226322 0 10 0.507756 10.685555 1.144192 -0.519157 -2.760601 1.015512 0 0 0 0 1.0 11.393225 -2 1 240827 0.232453 13.800773 0 14 0.413645 10.453156 1.320249 -0.158522 -3.013258 0.827289 0 0 0 0 1.0 12.742782 0 2 155659 -0.144099 14.761030 0 14 0.436928 13.405199 1.101142 0.768894 2.233106 0.873856 0 0 0 0 0 15.236505 2 3 239963 -0.171668 13.738019 0 22 0.249481 27.819496 0.493827 -1.188718 -2.042771 0.498961 0 0 0 0 0 17.279890 -8 4 90504 0.235188 15.896359 0 10 0.389329 15.330971 1.036879 0.722828 -3.056138 0.778658 0 0 0 0 0 16.749298 4 ç®ç倿°ã¯ãsignatureãåã«æ ŒçŽãããŠããã18çš®é¡ã®ãŠããŒã¯ãªæŽæ°ãå«ãŸããŠããŸããpandasã¯ãã®ããŒã¿åãã«ããŽãªã«ã«ãšããŠæ£ããèªèããŸããã§ããããAutoGluonããã®åé¡ãä¿®æ£ããŠãããŸãã label = ' signature ' train_data [ label ]. describe () å®è¡çµæ count 10000.000000 mean - 0.022000 std 3.025166 min - 12.000000 25 % - 2.000000 50 % 0.000000 75 % 2.000000 max 12.000000 Name : signature , dtype : float64 åŠç¿ predictor = TabularPredictor ( label = label ). fit ( train_data ) å®è¡çµæ No path specified . Models will be saved in : " AutogluonModels/ag-20241205_012036 " Verbosity : 2 ( Standard Logging ) =================== System Info =================== AutoGluon Version : 1.2 Python Version : 3.10 . 12 Operating System : Linux Platform Machine : x86_64 Platform Version : #1 SMP PREEMPT_DYNAMIC Thu Jun 27 21:05:47 UTC 2024 CPU Count : 2 Memory Avail : 11.57 GB / 12.67 GB ( 91.3 % ) Disk Space Avail : 74.20 GB / 107.72 GB ( 68.9 % ) =================================================== No presets specified! To achieve strong results with AutoGluon , it is recommended to use the available presets . Defaulting to ` ' medium ' ` ... Recommended Presets ( For more details refer to https : // auto . gluon . ai / stable / tutorials / tabular / tabular - essentials . html #presets): presets = ' experimental ' : New in v1 . 2 : Pre - trained foundation model + parallel fits . The absolute best accuracy without consideration for inference speed . Does not support GPU . presets = ' best ' : Maximize accuracy . Recommended for most users . Use in competitions and benchmarks . presets = ' high ' : Strong accuracy with fast inference speed . presets = ' good ' : Good accuracy with very fast inference speed . presets = ' medium ' : Fast training time , ideal for initial prototyping . Beginning AutoGluon training ... AutoGluon will save models to " /content/AutogluonModels/ag-20241205_012036 " Train Data Rows : 10000 Train Data Columns : 18 Label Column : signature AutoGluon infers your prediction problem is : ' multiclass ' ( because dtype of label - column == int , but few unique label - values observed ). First 10 ( of 13 ) unique label values : [ - 2 , 0 , 2 , - 8 , 4 , - 4 , - 6 , 8 , 6 , 10 ] If ' multiclass ' is not the correct problem_type , please manually specify the problem_type parameter during Predictor init ( You may specify problem_type as one of : [ ' binary ' , ' multiclass ' , ' regression ' , ' quantile ' ]) Problem Type : multiclass Preprocessing data ... Warning : Some classes in the training set have fewer than 10 examples . AutoGluon will only keep 9 out of 13 classes for training and will not try to predict the rare classes . To keep more classes , increase the number of datapoints from these rare classes in the training data or reduce label_count_threshold . Fraction of data from classes with at least 10 examples that will be kept for training models : 0.9984 Train Data Class Count : 9 Using Feature Generators to preprocess the data ... Fitting AutoMLPipelineFeatureGenerator... Available Memory : 11841.83 MB Train Data ( Original ) Memory Usage : 1.37 MB ( 0.0 % of available memory ) Inferring data type of each feature based on column values . Set feature_metadata_in to manually specify special dtypes of the features . Stage 1 Generators : Fitting AsTypeFeatureGenerator... Note : Converting 5 features to boolean dtype as they only contain 2 unique values . Stage 2 Generators : Fitting FillNaFeatureGenerator... Stage 3 Generators : Fitting IdentityFeatureGenerator... Stage 4 Generators : Fitting DropUniqueFeatureGenerator... Stage 5 Generators : Fitting DropDuplicatesFeatureGenerator... Useless Original Features ( Count : 1 ): [ ' Symmetry_D8 ' ] These features carry no predictive signal and should be manually investigated . This is typically a feature which has the same value for all rows . These features do not need to be present at inference time . Types of features in original data ( raw dtype , special dtypes ): ( ' float ' , []) : 14 | [ ' chern_simons ' , ' cusp_volume ' , ' injectivity_radius ' , ' longitudinal_translation ' , ' meridinal_translation_imag ' , ... ] ( ' int ' , []) : 3 | [ ' Unnamed: 0 ' , ' hyperbolic_adjoint_torsion_degree ' , ' hyperbolic_torsion_degree ' ] Types of features in processed data ( raw dtype , special dtypes ): ( ' float ' , []) : 9 | [ ' chern_simons ' , ' cusp_volume ' , ' injectivity_radius ' , ' longitudinal_translation ' , ' meridinal_translation_imag ' , ... ] ( ' int ' , []) : 3 | [ ' Unnamed: 0 ' , ' hyperbolic_adjoint_torsion_degree ' , ' hyperbolic_torsion_degree ' ] ( ' int ' , [ ' bool ' ]) : 5 | [ ' Symmetry_0 ' , ' Symmetry_D3 ' , ' Symmetry_D4 ' , ' Symmetry_D6 ' , ' Symmetry_Z/2 + Z/2 ' ] 0. 3s = Fit runtime 17 features in original data used to generate 17 features in processed data . Train Data ( Processed ) Memory Usage : 0.96 MB ( 0.0 % of available memory ) Data preprocessing and feature engineering runtime = 0. 42s ... AutoGluon will gauge predictive performance using evaluation metric : ' accuracy ' To change this , specify the eval_metric parameter of Predictor () Automatically generating train / validation split with holdout_frac = 0.1 , Train Rows : 8985 , Val Rows : 999 User - specified model hyperparameters to be fit : { ' NN_TORCH ' : [{}], ' GBM ' : [{ ' extra_trees ' : True , ' ag_args ' : { ' name_suffix ' : ' XT ' }}, {}, { ' learning_rate ' : 0.03 , ' num_leaves ' : 128 , ' feature_fraction ' : 0.9 , ' min_data_in_leaf ' : 3 , ' ag_args ' : { ' name_suffix ' : ' Large ' , ' priority ' : 0 , ' hyperparameter_tune_kwargs ' : None }}], ' CAT ' : [{}], ' XGB ' : [{}], ' FASTAI ' : [{}], ' RF ' : [{ ' criterion ' : ' gini ' , ' ag_args ' : { ' name_suffix ' : ' Gini ' , ' problem_types ' : [ ' binary ' , ' multiclass ' ]}}, { ' criterion ' : ' entropy ' , ' ag_args ' : { ' name_suffix ' : ' Entr ' , ' problem_types ' : [ ' binary ' , ' multiclass ' ]}}, { ' criterion ' : ' squared_error ' , ' ag_args ' : { ' name_suffix ' : ' MSE ' , ' problem_types ' : [ ' regression ' , ' quantile ' ]}}], ' XT ' : [{ ' criterion ' : ' gini ' , ' ag_args ' : { ' name_suffix ' : ' Gini ' , ' problem_types ' : [ ' binary ' , ' multiclass ' ]}}, { ' criterion ' : ' entropy ' , ' ag_args ' : { ' name_suffix ' : ' Entr ' , ' problem_types ' : [ ' binary ' , ' multiclass ' ]}}, { ' criterion ' : ' squared_error ' , ' ag_args ' : { ' name_suffix ' : ' MSE ' , ' problem_types ' : [ ' regression ' , ' quantile ' ]}}], ' KNN ' : [{ ' weights ' : ' uniform ' , ' ag_args ' : { ' name_suffix ' : ' Unif ' }}, { ' weights ' : ' distance ' , ' ag_args ' : { ' name_suffix ' : ' Dist ' }}], } Fitting 13 L1 models , fit_strategy = " sequential " ... Fitting model : KNeighborsUnif ... 0.2232 = Validation score ( accuracy ) 9. 92s = Training runtime 0. 02s = Validation runtime Fitting model : KNeighborsDist ... 0.2132 = Validation score ( accuracy ) 0. 05s = Training runtime 0. 02s = Validation runtime Fitting model : NeuralNetFastAI ... 0.9409 = Validation score ( accuracy ) 16. 79s = Training runtime 0. 04s = Validation runtime Fitting model : LightGBMXT ... / usr / local / lib / python3 . 10 / dist - packages / dask / dataframe / __init__ . py : 42 : FutureWarning : Dask dataframe query planning is disabled because dask - expr is not installed . You can install it with `pip install dask [ dataframe ] ` or `conda install dask` . This will raise in a future version . warnings . warn ( msg , FutureWarning ) 0.9459 = Validation score ( accuracy ) 10. 69s = Training runtime 0. 24s = Validation runtime Fitting model : LightGBM ... 0.956 = Validation score ( accuracy ) 9. 71s = Training runtime 0. 33s = Validation runtime Fitting model : RandomForestGini ... 0.9449 = Validation score ( accuracy ) 8. 86s = Training runtime 0. 12s = Validation runtime Fitting model : RandomForestEntr ... 0.9499 = Validation score ( accuracy ) 10. 04s = Training runtime 0. 11s = Validation runtime Fitting model : CatBoost ... 0.956 = Validation score ( accuracy ) 73. 03s = Training runtime 0. 01s = Validation runtime Fitting model : ExtraTreesGini ... 0.9469 = Validation score ( accuracy ) 4. 42s = Training runtime 0. 13s = Validation runtime Fitting model : ExtraTreesEntr ... 0.9429 = Validation score ( accuracy ) 2. 84s = Training runtime 0. 13s = Validation runtime Fitting model : XGBoost ... 0.957 = Validation score ( accuracy ) 16. 0s = Training runtime 0. 35s = Validation runtime Fitting model : NeuralNetTorch ... 0.9419 = Validation score ( accuracy ) 79. 07s = Training runtime 0. 01s = Validation runtime Fitting model : LightGBMLarge ... 0.9499 = Validation score ( accuracy ) 16. 1s = Training runtime 0. 42s = Validation runtime Fitting model : WeightedEnsemble_L2 ... Ensemble Weights : { ' RandomForestEntr ' : 0.25 , ' ExtraTreesGini ' : 0.25 , ' KNeighborsUnif ' : 0.167 , ' NeuralNetFastAI ' : 0.167 , ' XGBoost ' : 0.083 , ' NeuralNetTorch ' : 0.083 } 0.965 = Validation score ( accuracy ) 0. 25s = Training runtime 0. 0s = Validation runtime AutoGluon training complete , total runtime = 264. 38s ... Best model : WeightedEnsemble_L2 | Estimated inference throughput : 1512.1 rows / s ( 999 batch size ) TabularPredictor saved . To load , use : predictor = TabularPredictor . load ( " /content/AutogluonModels/ag-20241205_012036 " ) äºæž¬ test_data = TabularDataset ( f ' { data_url } test.csv' ) y_pred = predictor . predict ( test_data . drop ( columns = [ label ])) è©äŸ¡ predictor . evaluate ( test_data , silent =True ) å®è¡çµæ { ' accuracy ' : 0.9478 , ' balanced_accuracy ' : 0.754478262473782 , ' mcc ' : 0.9360368834449522 } AutoGluonã®TabularPredictorã¯ã leaderboard() 颿°ãæäŸããŠãããããã䜿çšããŠåãã¬ãŒãã³ã°æžã¿ã¢ãã«ã®ãã¹ãããŒã¿ã«å¯Ÿããæ§èœãè©äŸ¡ããããšãã§ããŸãã predictor . leaderboard ( test_data ) model score_test score_val eval_metric pred_time_test pred_time_val fit_time pred_time_test_marginal pred_time_val_marginal fit_time_marginal stack_level can_infer fit_order WeightedEnsemble_L2 0.9478 0.964965 accuracy 2.777582 0.660655 136.499218 0.025436 0.001888 0.246331 2 True 14 LightGBM 0.9456 0.955956 accuracy 0.704927 0.331303 9.709910 0.704927 0.331303 9.709910 1 True 5 XGBoost 0.9448 0.956957 accuracy 1.877720 0.350646 16.003580 1.877720 0.350646 16.003580 1 True 11 LightGBMLarge 0.9444 0.949950 accuracy 3.199392 0.421252 16.101254 3.199392 0.421252 16.101254 1 True 13 CatBoost 0.9432 0.955956 accuracy 0.065079 0.011186 73.033620 0.065079 0.011186 73.033620 1 True 8 RandomForestEntr 0.9384 0.949950 accuracy 0.284559 0.108530 10.044177 0.284559 0.108530 10.044177 1 True 7 NeuralNetFastAI 0.9364 0.940941 accuracy 0.102912 0.041506 16.789817 0.102912 0.041506 16.789817 1 True 3 ExtraTreesGini 0.9360 0.946947 accuracy 0.413286 0.126837 4.417963 0.413286 0.126837 4.417963 1 True 9 ExtraTreesEntr 0.9358 0.942943 accuracy 0.434792 0.127124 2.836171 0.434792 0.127124 2.836171 1 True 10 RandomForestGini 0.9352 0.944945 accuracy 0.266627 0.117757 8.860353 0.266627 0.117757 8.860353 1 True 6 NeuralNetTorch 0.9320 0.941942 accuracy 0.035788 0.012760 79.072856 0.035788 0.012760 79.072856 1 True 12 LightGBMXT 0.9320 0.945946 accuracy 1.222842 0.243437 10.694745 1.222842 0.243437 10.694745 1 True 4 KNeighborsDist 0.2210 0.213213 accuracy 0.038112 0.016588 0.045746 0.038112 0.016588 0.045746 1 True 2 KNeighborsUnif 0.2180 0.223223 accuracy 0.037879 0.018488 9.924494 0.037879 0.018488 9.924494 1 True 1 çµè« ãã®ã¯ã€ãã¯ã¹ã¿ãŒããã¥ãŒããªã¢ã«ã§ã¯ã TabularDataset ãš TabularPredictor ã䜿çšããŠAutoGluonã®åºæ¬çãªãã£ããããã³äºæž¬æ©èœãèŠãŠããŸããã AutoGluonã¯ãç¹åŸŽéãšã³ãžãã¢ãªã³ã°ãã¢ãã«ã®ãã€ããŒãã©ã¡ãŒã¿èª¿æŽãå¿
èŠãšããã«ãã¢ãã«ã®ãã¬ãŒãã³ã°ããã»ã¹ãç°¡çŽ åããŸãã ãã¬ãŒãã³ã°ãäºæž¬ã¹ãããã®ã«ã¹ã¿ãã€ãºãã«ã¹ã¿ã ç¹åŸŽéçæåšãã¢ãã«ãã¡ããªã¯ã¹ã®æ¡åŒµãªã©ãAutoGluonã®ä»ã®æ©èœã«ã€ããŠè©³ããåŠã¶ã«ã¯è©³çްãªãã¥ãŒããªã¢ã«ããã§ãã¯ããŠãã ããã ãŸãšã ãããã ã£ãã§ããããïŒ æåŸã®è¡šã«ããéããå€ãã®ã¢ãã«ãæ°å°ãªãã³ãŒãã§æ¯èŒããŠãããŸããïŒïŒ è²ã
ãªã¢ãã«ã詊ãããåŠç¿æéã¯å€ããªã£ãŠããŸããŸãããã©ã®ã¢ãã«ã䜿çšããã®ããæ€èšããéã«AutoGluonã¯ãšãŠã䜿ããã®ã§ã¯ãªãã§ããããïŒ ããŒã¿ååŠçããã€ããŒãã©ã¡ãŒã¿æé©åãã¢ãŒããã¯ãã£ãŒæé©åãã¢ãã«ã¢ã³ãµã³ãã«ïŒã¹ã¿ããã³ã°ïŒãŸã§ãäžåºŠã«è¡ã£ãŠãããAutoGluonã¯ä»åŸãç®ãé¢ããŸããïŒ ãŸããä»åã®è¡šããŒã¿ã ãã§ãªããç»ååé¡ã»ç»åã»ã°ã¡ã³ããŒã·ã§ã³ã»ç©äœæ€åºã»èªç¶èšèªã»ãã«ãã¢ãŒãã«äºæž¬ãªã©æ§ã
ãªåéã«å¯Ÿå¿ããŠãããããæ°ã«ãªã£ãæ¹ã¯ãã²ããããã®ã¯ã€ãã¯ã¹ã¿ãŒãã詊ããŠã¿ãŠãã ããïŒ åèãªã³ã¯ https://atmarkit.itmedia.co.jp/ait/articles/2203/24/news004.html https://auto.gluon.ai/stable/index.html https://pages.awscloud.com/rs/112-TZM-766/images/1.AWS_AutoML_AutoGluon.pdf