question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use AutoGluon in Kaggle Kernels

See original GitHub issue

A majority of recent Kaggle competitions require to submit via notebooks.

We could use !pip install autogluon, but got the a bunch of errors, even just importing the tabular task. For example

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-17-6f7d1b4fed2f> in <module>
----> 1 from autogluon import TabularPrediction as task

/opt/conda/lib/python3.7/site-packages/autogluon/__init__.py in <module>
     15 logger.setLevel(logging.ERROR)
     16 
---> 17 from .utils.try_import import *
     18 try_import_mxnet()
     19 

/opt/conda/lib/python3.7/site-packages/autogluon/utils/__init__.py in <module>
     18 from .util_decorator import classproperty
     19 from .custom_process import CustomProcess
---> 20 from .openml_download import *
     21 

/opt/conda/lib/python3.7/site-packages/autogluon/utils/openml_download.py in <module>
      1 import os
      2 import numpy as np
----> 3 from sklearn.impute import SimpleImputer
      4 from sklearn.model_selection import train_test_split
      5 

/opt/conda/lib/python3.7/site-packages/sklearn/impute/__init__.py in <module>
      2 
      3 from ._base import MissingIndicator, SimpleImputer
----> 4 from ._knn import KNNImputer
      5 
      6 __all__ = [

/opt/conda/lib/python3.7/site-packages/sklearn/impute/_knn.py in <module>
      7 from ._base import _BaseImputer
      8 from ..utils.validation import FLOAT_DTYPES
----> 9 from ..metrics import pairwise_distances_chunked
     10 from ..metrics.pairwise import _NAN_METRICS
     11 from ..neighbors._base import _get_weights

/opt/conda/lib/python3.7/site-packages/sklearn/metrics/__init__.py in <module>
      5 
      6 
----> 7 from ._ranking import auc
      8 from ._ranking import average_precision_score
      9 from ._ranking import coverage_error

/opt/conda/lib/python3.7/site-packages/sklearn/metrics/_ranking.py in <module>
     33 from ..utils.sparsefuncs import count_nonzero
     34 from ..exceptions import UndefinedMetricWarning
---> 35 from ..preprocessing import label_binarize
     36 from ..preprocessing._label import _encode
     37 

/opt/conda/lib/python3.7/site-packages/sklearn/preprocessing/__init__.py in <module>
      6 from ._function_transformer import FunctionTransformer
      7 
----> 8 from ._data import Binarizer
      9 from ._data import KernelCenterer
     10 from ._data import MinMaxScaler

/opt/conda/lib/python3.7/site-packages/sklearn/preprocessing/_data.py in <module>
     34 from ._csr_polynomial_expansion import _csr_polynomial_expansion
     35 
---> 36 from ._encoders import OneHotEncoder
     37 
     38 BOUNDS_THRESHOLD = 1e-7

/opt/conda/lib/python3.7/site-packages/sklearn/preprocessing/_encoders.py in <module>
      8 from ..base import BaseEstimator, TransformerMixin
      9 from ..utils import check_array
---> 10 from ..utils.fixes import _argmax
     11 from ..utils.validation import check_is_fitted
     12 

ImportError: cannot import name '_argmax' from 'sklearn.utils.fixes' (/opt/conda/lib/python3.7/site-packages/sklearn/utils/fixes.py)

Several competitions don’t allow use Internet, which means we cannot pip install. Instead, we should submit a PR to add autogluon at https://github.com/Kaggle/docker-python/blob/master/Dockerfile#L129 and

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
Innixmacommented, Mar 10, 2021

For your reference.

I was also in trouble with a similar problem. The following is one example of the solution.

https://www.kaggle.com/daikikatsuragawa/a-beginner-s-guide-to-autogluon

Awesome! Thanks for giving an example.

One note (and unfortunately I expect this is going to happen a lot, so is the way of optional dependencies in python…):

!pip install autogluon.tabular only installs a minimal install of Tabular, with most of the models missing.

You’ll want to do !pip install autogluon.tabular[all] to get all the models.

1reaction
Innixmacommented, May 4, 2021

Closing as it appears there are no issues with installing AutoGluon on Kaggle as of v0.1 and v0.2.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use AutoGluon in Kaggle Kernels · Issue #596 - GitHub
I was able to use kaggle kernels with multiple older versions of autogluon, c.f. https://www.kaggle.com/jonaswm/covid-ag
Read more >
Using feature engineering with AutoGluon - Kaggle
Explore and run machine learning code with Kaggle Notebooks | Using data from Titanic - Machine Learning from ... Using feature engineering with...
Read more >
How to use AutoGluon for Kaggle competitions
We first outline the general steps to use AutoGluon in Kaggle contests. Here, we assume the competition involves tabular data which are stored...
Read more >
Kaggle Kernels that use AutoML and Intel® Extension for ...
AutoML MultiClass Classification (Gradient Boosting, Random Forest, kNN) using AutoGluon with Intel® Extension for Scikit-learn*. Data: [TPS Jun 2021] Synthetic ...
Read more >
AutoGluon-Tabular - Amazon SageMaker - AWS Documentation
You can use AutoGluon-Tabular as an Amazon SageMaker built-in algorithm. ... available in the InstanceType ) must be able to hold the training...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found