#scaled the data
x = cleaned_df.drop('Churn', axis=1 ) #feature data set
y = cleaned_df['Churn']
x = StandardScaler().fit_transform(x)
ValueError Traceback (most recent call last)
<ipython-input-66-5cd9d7ec56d3> in <module>
3 y = cleaned_df['Churn']
4
----> 5 x = StandardScaler().fit_transform(x)
C:\ProgramData\Anaconda3\lib\site-packages\sklearn\base.py in fit_transform(self, X, y, **fit_params)
569 if y is None:
570 # fit method of arity 1 (unsupervised transformation)
--> 571 return self.fit(X, **fit_params).transform(X)
572 else:
573 # fit method of arity 2 (supervised transformation)
C:\ProgramData\Anaconda3\lib\site-packages\sklearn\preprocessing\_data.py in fit(self, X, y)
667 # Reset internal state before fitting
668 self._reset()
--> 669 return self.partial_fit(X, y)
670
671 def partial_fit(self, X, y=None):
C:\ProgramData\Anaconda3\lib\site-packages\sklearn\preprocessing\_data.py in partial_fit(self, X, y)
698 X = check_array(X, accept_sparse=('csr', 'csc'),
699 estimator=self, dtype=FLOAT_DTYPES,
--> 700 force_all_finite='allow-nan')
701
702 # Even in the case of `with_mean=False`, we update the mean anyway
C:\ProgramData\Anaconda3\lib\site-packages\sklearn\utils\validation.py in check_array(array, accept_sparse, accept_large_sparse, dtype, order, copy, force_all_finite, ensure_2d, allow_nd, ensure_min_samples, ensure_min_features, warn_on_dtype, estimator)
513 array = array.astype(dtype, casting="unsafe", copy=False)
514 else:
--> 515 array = np.asarray(array, order=order, dtype=dtype)
516 except ComplexWarning:
517 raise ValueError("Complex data not supported\n"
C:\ProgramData\Anaconda3\lib\site-packages\numpy\core\numeric.py in asarray(a, dtype, order)
536
537 """
--> 538 return array(a, dtype, copy=False, order=order)
539
540
ValueError: could not convert string to float: 'Female'