How to install & import Auto Gluon with Google Colaboratory

Introduction

I usually use Google Colaboratory (Colaboratory) [^ Google Colaboratory], but install AutoGluon [^ AutoGluon] [Introduction of machine learning framework AutoGluon for AutoML] which is AutoML on Colaboratory. I once thought about importing and using it. However, there were times when I stumbled upon the solution. I wrote this article because I thought that some people would give up the experience of AutoML after having a similar experience. Write the procedure as carefully as possible so that even an unfamiliar person can reproduce it. (Information on January 20, 2021. If the situation changes, please let us know in the comments etc.)

Conclusion

Execute the following command referring to the information described in the README [^ AutoGluon (GitHub)] published on GitHub.


!pip install --upgrade pip
!pip install --upgrade setuptools
!pip install --upgrade "mxnet<2.0.0"
!pip install --pre autogluon

The disturbing execution result is displayed. Press "RESTART RUNTIME" at the bottom left to restart the runtime.

Press "Yes".

Then, the following import statement can be executed.


from autogluon.tabular import TabularDataset, TabularPredictor

Of course, you can also run the sample code in the README.


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)

You can see very interesting execution results!


(abridgement)

Fitting model: WeightedEnsemble_L1 ... Training model for up to 59.61s of the -10.88s of remaining time.
	0.8848	 = Validation accuracy score
	1.07s	 = Training runtime
	0.01s	 = Validation runtime
AutoGluon training complete, total runtime = 72.03s ...
TabularPredictor saved. To load, use: TabularPredictor.load("AutogluonModels/ag-20210118_155144/")
                 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_L1    0.873989     0.8848        1.739362       0.587412  29.211715                 0.025570                0.005142           1.072552            1       True         10
1             LightGBM    0.873375     0.8800        0.101678       0.042709   1.115279                 0.101678                0.042709           1.115279            0       True          7
2             CatBoost    0.872761     0.8804        0.032807       0.020380  14.926486                 0.032807                0.020380          14.926486            0       True          9
3           LightGBMXT    0.870202     0.8756        0.245106       0.078389   1.704540                 0.245106                0.078389           1.704540            0       True          8
4     RandomForestGini    0.859863     0.8600        0.821455       0.215100   9.762229                 0.821455                0.215100           9.762229            0       True          1
5     RandomForestEntr    0.858225     0.8612        0.805670       0.315070  12.275200                 0.805670                0.315070          12.275200            0       True          2
6       ExtraTreesGini    0.845839     0.8468        1.188539       0.315290   9.466483                 1.188539                0.315290           9.466483            0       True          3
7       ExtraTreesEntr    0.845737     0.8432        1.195231       0.316842   8.752100                 1.195231                0.316842           8.752100            0       True          4
8       KNeighborsUnif    0.773365     0.7752        0.108888       0.116532   0.319212                 0.108888                0.116532           0.319212            0       True          5
9       KNeighborsDist    0.762514     0.7660        0.403860       0.109161   0.311418                 0.403860                0.109161           0.311418            0       True          6

Summary

I introduced how to install & import AutoGluon in Colaboratory. Let's experience AutoML including AutoGluon more and more!

bonus

---> 32 from dask.utils import ensure_dict, format_bytes, funcname, stringify
ImportError: cannot import name 'stringify'

I personally often encountered this error statement. I wrote it because I want it to reach such a person. (Scratched by search!)

Recommended Posts

How to install & import Auto Gluon with Google Colaboratory
# Scala: vol2: [How to import google / protobuf / *. Proto with akka-grpc]
How to install Docker
How to install docker-machine
How to install MySQL
How to install ngrok
How to install Gradle and Kotlin with SDKMAN (Mac)
[Rails] How to install devise
How to install Boots Faces
How to number (number) with html.erb
How to update with activerecord-import
[Rails] How to install simple_calendar
[Rails] How to install reCAPTCHA
How to install JDK8-10 (Mac)
How to scroll horizontally with ScrollView
[Rails] How to install Font Awesome
How to install JMeter for Mac
How to install ImageMagick on Windows 10
How to install ruby through rbenv
How to enclose any character with "~"
[How to install Spring Data Jpa]
mysql2 fails to install with bundle install
Super rough! How to install Dagger2
How to install Bootstrap in Ruby
How to install Pry after building Rails development environment with Docker
How to use mssql-tools with alpine
How to install MariaDB 10.4 on CentOS 8
[Rails] How to install ImageMagick (RMajick)
[Rails] How to install Font Awesome
How to install WildFly on Ubuntu 18.04
How to install Adopt OpenJDK on Debian, Ubuntu with apt (-get)
How to get along with Rails
How to start Camunda with Docker
How to install Swiper in Rails
How to crop an image with libGDX
How to share files with Docker Toolbox
How to install Play Framework 2.6 for Mac
[Java] How to compare with equals method
[Android] How to deal with dark themes
How to use BootStrap with Play Framework
[Rails] How to use rails console with docker
How to switch thumbnail images with JavaScript
How to install Eclipse (Photon) on Mac
[Note] How to get started with Rspec
How to install production Metabase on Ubuntu
How to install beta php8.0 on CentOS8
How to do API-based control with cancancan
How to achieve file download with Feign
How to update related models with accepts_nested_attributes_for
How to use Java classes, definitions, import
How to set JAVA_HOME with Maven appassembler-maven-plugin
How to install the legacy version [Java]
How to implement TextInputLayout with validation function
How to handle sign-in errors with devise
How to delete data with foreign key
How to test private scope with JUnit
How to monitor nginx with docker-compose with datadog
How to install kafkacat on Amazon Linux2
How to deal with Precompiling assets failed.
How to achieve file upload with Feign
How to run Blazor (C #) with Docker