1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

autogluon.tabularのTabularDatasetによるデータの取得ができなくなってしまった件と解決方法について(2021/02/25に検知)

Last updated at Posted at 2021-02-25

はじめに

先月、以下の記事を書きました。

しかし、改めてAutoGluon1を実行しようとしたところ以下のようなエラーが出てしまいました(2021/02/25)。具体的には、autogluon.tabularTabularDatasetによるデータの取得ができなくなってしましました。

from autogluon.tabular import TabularDataset, TabularPredictor

train_data = TabularDataset(file_path='https://autogluon.s3.amazonaws.com/datasets/Inc/train.csv')
test_data = TabularDataset(file_path='https://autogluon.s3.amazonaws.com/datasets/Inc/test.csv')
predictor = TabularPredictor(label='class').fit(train_data, time_limit=60)  # Fit models for 60s
leaderboard = predictor.leaderboard(test_data)

※一部マスク済み

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-1-XXXXXXXXXXXX> in <module>()
      1 from autogluon.tabular import TabularDataset, TabularPredictor
      2 
----> 3 train_data = TabularDataset(file_path='https://autogluon.s3.amazonaws.com/datasets/Inc/train.csv')
      4 test_data = TabularDataset(file_path='https://autogluon.s3.amazonaws.com/datasets/Inc/test.csv')
      5 predictor = TabularPredictor(label='class').fit(train_data, time_limit=60)  # Fit models for 60s

TypeError: __init__() missing 1 required positional argument: 'data'

結論

引数のfile_path=が不要になったようです。README2も気が付いたら更新されていたみたいです。

from autogluon.tabular import TabularDataset, TabularPredictor

train_data = TabularDataset('https://autogluon.s3.amazonaws.com/datasets/Inc/train.csv')
test_data = TabularDataset('https://autogluon.s3.amazonaws.com/datasets/Inc/test.csv')
predictor = TabularPredictor(label='class').fit(train_data, time_limit=60)  # Fit models for 60s
leaderboard = predictor.leaderboard(test_data)
(省略)

AutoGluon training complete, total runtime = 64.75s ...
TabularPredictor saved. To load, use: TabularPredictor.load("AutogluonModels/ag-20210225_133323/")
                  model  score_test  score_val  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
0   WeightedEnsemble_L2    0.874706     0.8848        3.773335       1.229578  44.071734                 0.014430                0.005951           1.228042            2       True         11
1              LightGBM    0.873375     0.8800        0.076524       0.041000   1.121325                 0.076524                0.041000           1.121325            1       True          7
2              CatBoost    0.872351     0.8768        0.026494       0.017763   5.229808                 0.026494                0.017763           5.229808            1       True          9
3               XGBoost    0.870713     0.8756        0.131061       0.035778   1.921347                 0.131061                0.035778           1.921347            1       True         10
4            LightGBMXT    0.870202     0.8756        0.166172       0.062271   1.544986                 0.166172                0.062271           1.544986            1       True          8
5      RandomForestGini    0.859863     0.8600        0.830060       0.215768  10.372102                 0.830060                0.215768          10.372102            1       True          1
6      RandomForestEntr    0.858225     0.8612        0.820438       0.315851  12.771529                 0.820438                0.315851          12.771529            1       True          2
7        ExtraTreesGini    0.845839     0.8468        1.310977       0.315492   9.186114                 1.310977                0.315492           9.186114            1       True          3
8        ExtraTreesEntr    0.845737     0.8432        1.312058       0.315819   9.196487                 1.312058                0.315819           9.196487            1       True          4
9        KNeighborsUnif    0.773365     0.7752        0.108653       0.109507   0.389895                 0.108653                0.109507           0.389895            1       True          5
10       KNeighborsDist    0.762514     0.7660        0.288525       0.110196   0.306585                 0.288525                0.110196           0.306585            1       True          6

まとめ

autogluon.tabularTabularDatasetによるデータの取得ができなくなってしまった件と解決方法について紹介しました。引き続きAutoGluonをはじめとするAutoMLをどんどん体験していきましょう!

  1. https://auto.gluon.ai/

  2. https://github.com/awslabs/autogluon/commit/18fb70631778879b24e6e48369fa334656772c31

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?