You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to run this following code from my SPYDER
from tpot import TPOTClassifier
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
import numpy as np
iris = load_iris()
X_train, X_test, y_train, y_test = train_test_split(iris.data.astype(np.float64),
iris.target.astype(np.float64), train_size=0.75, test_size=0.25)
tpot = TPOTClassifier(generations=5, population_size=50, verbosity=2)
tpot.fit(X_train, y_train)
print(tpot.score(X_test, y_test))
tpot.export('tpot_iris_pipeline.py')
I'm getting this error
WHEN I RUN
C:\Anaconda3\lib\importlib_bootstrap.py:219: ImportWarning: can't resolve package from spec or package, falling back on name and path
return f(*args, **kwds)
Traceback (most recent call last):
File "", line 1, in
tpot.fit(X_train, y_train)
File "C:\Anaconda3\lib\site-packages\tpot\base.py", line 577, in fit
self._fit_init()
File "C:\Anaconda3\lib\site-packages\tpot\base.py", line 485, in _fit_init
ArgBaseClass=ARGType
File "C:\Anaconda3\lib\site-packages\tpot\operator_utils.py", line 159, in TPOTOperatorClassFactory
import_str, op_str, op_obj = source_decode(opsourse)
File "C:\Anaconda3\lib\site-packages\tpot\operator_utils.py", line 72, in source_decode
exec('from {} import {}'.format(import_str, op_str))
File "", line 1, in
File "", line 971, in _find_and_load
File "", line 951, in _find_and_load_unlocked
File "", line 890, in _find_spec
File "", line 864, in _find_spec_legacy
File "C:\Anaconda3\lib\site-packages\pyximport\pyximport.py", line 253, in find_module
fp, pathname, (ext,mode,ty) = imp.find_module(fullname,package_path)
File "C:\Anaconda3\lib\imp.py", line 271, in find_module
"not {}".format(type(path)))
RuntimeError: 'path' must be None or a list, not <class '_frozen_importlib_external._NamespacePath'>
Please, I need urgent help... I 've tried to search online for the past 2 days, I can't find the solution.
I want to use tpot to classifier my dataset, but I'm just running this example first to see how to work.
The text was updated successfully, but these errors were encountered:
Thanks so much.... It's working on ipython.
Please, I want to ask if I can turn my result into a model and use it at API on Flask to build an application for my web? or I can only use the exported (tpot.export) for API?
Can I apply Feature Scaling and Feature Selection using PCA/LDA before training my data?
I'm trying to run this following code from my SPYDER
from tpot import TPOTClassifier
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
import numpy as np
iris = load_iris()
X_train, X_test, y_train, y_test = train_test_split(iris.data.astype(np.float64),
iris.target.astype(np.float64), train_size=0.75, test_size=0.25)
tpot = TPOTClassifier(generations=5, population_size=50, verbosity=2)
tpot.fit(X_train, y_train)
print(tpot.score(X_test, y_test))
tpot.export('tpot_iris_pipeline.py')
I'm getting this error
WHEN I RUN
File "C:\Anaconda3\lib\site-packages\tpot\base.py", line 577, in fit
self._fit_init()
File "C:\Anaconda3\lib\site-packages\tpot\base.py", line 485, in _fit_init
ArgBaseClass=ARGType
File "C:\Anaconda3\lib\site-packages\tpot\operator_utils.py", line 159, in TPOTOperatorClassFactory
import_str, op_str, op_obj = source_decode(opsourse)
File "C:\Anaconda3\lib\site-packages\tpot\operator_utils.py", line 72, in source_decode
exec('from {} import {}'.format(import_str, op_str))
File "", line 1, in
File "", line 971, in _find_and_load
File "", line 951, in _find_and_load_unlocked
File "", line 890, in _find_spec
File "", line 864, in _find_spec_legacy
File "C:\Anaconda3\lib\site-packages\pyximport\pyximport.py", line 253, in find_module
fp, pathname, (ext,mode,ty) = imp.find_module(fullname,package_path)
File "C:\Anaconda3\lib\imp.py", line 271, in find_module
"not {}".format(type(path)))
RuntimeError: 'path' must be None or a list, not <class '_frozen_importlib_external._NamespacePath'>
Please, I need urgent help... I 've tried to search online for the past 2 days, I can't find the solution.
I want to use tpot to classifier my dataset, but I'm just running this example first to see how to work.
The text was updated successfully, but these errors were encountered: