EpistasisLab / EpistasisLab/tpot

(with h2o4gpu) ImportError: cannot import name 'PCA'

Open
#1,022 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
10.1k
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

Not sure if this is a bug with TPOT or h2o4gpu or just how the two interact with sklearn?

## Context of the issue

Platform: Ubuntu 18.04.3 LTS x86_64
Python: Pyrthon 3.6.9 :: Anaconda
Relevant Python packages
- scikit-learn==0.20.2
- TPOT==0.10.2
- h2o4gpu==0.3.2 (for [CUDA10.0 - linux_x86_64](https://s3.amazonaws.com/h2o-release/h2o4gpu/releases/stable/ai/h2o/h2o4gpu/0.3-cuda10/h2o4gpu-0.3.2-cp36-cp36m-linux_x86_64.whl))

## Process to reproduce the issue

1. Install [tpot](http://epistasislab.github.io/tpot/installing/)
2. Install H2Oai GPU Edition ([github](https://github.com/h2oai/h2o4gpu)) into a new conda environment and activate the environment
3. run the tpot command

## Expected result

tpot initialises successfully, displaying usage info

usage: tpot [-h] [-is INPUT_SEPARATOR] [-target TARGET_NAME]
[-mode {classification,regression}] [-o OUTPUT_FILE]
[-g GENERATIONS] [-p POPULATION_SIZE] [-os OFFSPRING_SIZE]
[-mr MUTATION_RATE] [-xr CROSSOVER_RATE] [-scoring SCORING_FN]
[-cv NUM_CV_FOLDS] [-sub SUBSAMPLE] [-njobs NUM_JOBS]
[-maxtime MAX_TIME_MINS] [-maxeval MAX_EVAL_MINS]
[-s RANDOM_STATE] [-config CONFIG_FILE] [-template TEMPLATE]
[-memory MEMORY] [-cf CHECKPOINT_FOLDER] [-es EARLY_STOP]
[-v {0,1,2,3}] [--no-update-check] [--version]
INPUT_FILE
tpot: error: the following arguments are required: INPUT_FILE

## Current result

tpot command always throws this error on initialisation:

(h2o4gpuenv) ~/$ tpot
Traceback (most recent call last):
File "/usr/local/bin/tpot", line 5, in
from tpot import main
File "/usr/local/lib/python3.6/site-packages/tpot/__init__.py", line 27, in
from .tpot import TPOTClassifier, TPOTRegressor
File "/usr/local/lib/python3.6/site-packages/tpot/tpot.py", line 26, in
from .base import TPOTBase
File "/usr/local/lib/python3.6/site-packages/tpot/base.py", line 64, in
from .builtins import CombineDFs, StackingEstimator
File "/usr/local/lib/python3.6/site-packages/tpot/builtins/__init__.py", line 30, in
from .feature_transformers import CategoricalSelector, ContinuousSelector
File "/usr/local/lib/python3.6/site-packages/tpot/builtins/feature_transformers.py", line 25, in
from sklearn.decomposition import PCA
ImportError: cannot import name 'PCA'

## Possible fix

Changing import name PCA on line 25 of `tpot/builtins/feature_transformers.py` to PCASklearn seems to workaround the error.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.