Answered step by step
Verified Expert Solution
Question
1 Approved Answer
ValueError Traceback ( most recent call last ) Cell In [ 1 8 9 ] , line 1 - - - - > 1 X
ValueError Traceback most recent call last
Cell In line
Xresample, yresample smote.fitresampleXy
File ~AppDataLocalanacondaLibsitepackagesimblearnbasepy: in BaseSampler.fitresampleself X y
Resample the dataset.
Parameters
The corresponding label of Xresampled
self.validateparams
return superfitresampleX y
File ~AppDataLocalanacondaLibsitepackagesimblearnbasepy: in SamplerMixin.fitresampleself X y
checkclassificationtargetsy
arraystransformer ArraysTransformerX y
X y binarizey self.checkXyX y
self.samplingstrategy checksamplingstrategy
self.samplingstrategy, y self.samplingtype
output self.fitresampleX y
File ~AppDataLocalanacondaLibsitepackagesimblearnbasepy: in BaseSampler.checkXyself X y acceptsparse
acceptsparse csrcsc
y binarizey checktargettypey indicateonevsallTrue
X y self.validatedataX y resetTrue, acceptsparseacceptsparse
return X y binarizey
File ~AppDataLocalanacondaLibsitepackagessklearnbasepy: in BaseEstimator.validatedataself X y reset, validateseparately, checkparams
y checkarrayy inputnameycheckyparams
else:
X y checkXyX ycheckparams
out X y
if not novalX and checkparams.getensured True:
File ~AppDataLocalanacondaLibsitepackagessklearnutilsvalidationpy: in checkXyX y acceptsparse, acceptlargesparse, dtype, order, copy, forceallfinite, ensured allownd multioutput, ensureminsamples, ensureminfeatures, ynumeric, estimator
estimatorname checkestimatornameestimator
raise ValueError
festimatorname requires y to be passed, but the target y is None"
X checkarray
X
acceptsparseacceptsparse,
acceptlargesparseacceptlargesparse,
dtypedtype,
orderorder,
copycopy,
forceallfiniteforceallfinite,
ensuredensured
allowndallownd
ensureminsamplesensureminsamples,
ensureminfeaturesensureminfeatures,
estimatorestimator,
inputnameX
y checkyy multioutputmultioutput, ynumericynumeric, estimatorestimator
checkconsistentlengthX y
File ~AppDataLocalanacondaLibsitepackagessklearnutilsvalidationpy: in checkarrayarray acceptsparse, acceptlargesparse, dtype, order, copy, forceallfinite, ensured allownd ensureminsamples, ensureminfeatures, estimator, inputname
array xpastypearray dtype, copyFalse
else:
array asarraywithorderarray orderorder, dtypedtype, xpxp
except ComplexWarning as complexwarning:
raise ValueError
"Complex data not supported
formatarray
from complexwarning
File ~AppDataLocalanacondaLibsitepackagessklearnutilsarrayapi.py: in asarraywithorderarray dtype, order, copy, xp
xp getnamespacearray
if xpname in numpy "numpy.arrayapi":
# Use NumPy API to support order
array numpy.asarrayarray orderorder, dtypedtype
return xpasarrayarray copycopy
else:
File ~AppDataLocalanacondaLibsitepackagespandascoregenericpy: in NDFrame.arrayself dtype
def arrayself dtype: nptDTypeLike None None npndarray:
return npasarrayselfvalues, dtypedtype
ValueError: could not convert string to float:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started