Pythonにてデータサイエンスの勉強をしているのですが、
決定木モデル作成のコードがエラーになり対処に困っております。
尚、そこに至るまでのデータの前処理は問題なく完了している状況です。
ちなみに、データはkaggleのものを活用しています。
入力したコードと返ってきたエラーは以下のとおりです。
前段階のmaleのデータ処理に何らかの問題があるのでしょうか?
【入力したコード】
Python
1model.fit(x_train, y_train)
【返ってきたエラー】
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-62-5a1c83c51f6b> in <module>() 1# 決定木モデルの作成 ----> 2 model.fit(x_train, y_train) 4 frames /usr/local/lib/python3.7/dist-packages/pandas/core/generic.py in __array__(self, dtype) 1991 1992 def __array__(self, dtype: NpDtype | None = None) -> np.ndarray: -> 1993 return np.asarray(self._values, dtype=dtype) 1994 1995 def __array_wrap__( ValueError: could not convert string to float: 'male'
以上になります。
恐れ入りますが、よろしくお願いいたします。