해결된 질문
작성
·
334
0
import numpy as np
import pandas as pd
df = pd.read_csv("titanic_train.csv", index_col = 0)
df
x_data = df.drop(['Survived', 'Name', 'Ticket', 'Cabin', 'Embarked','SibSp','Parch','Pclass'],axis=1)
x_data
x_data['Sex_Con'] = x_data['Sex'].apply(lambda x: 0 if x == 'male' else 1)
x_data = x_data.drop('Sex', axis=1)
x_data[['Age']] = x_data[['Age']].fillna(value=x_data[['Age']].mean())
x_data
x_data[['Age']].isnull().sum()
x_data[['Fare']].isnull().sum()
y_data = df['Survived']
y_data
y_data.isnull().sum()
from sklearn.model_selection import train_test_split
from sklearn.tree import DecisionTreeClassifier
X_train, Y_train, X_test,Y_test = train_test_split(x_data, y_data, test_size=0.2, random_state=11)
dt_clf = DecisionTreeClassifier(random_state=11)
dt_clf.fit(X_train,Y_train)
df_pred = dt_clf.predict(X_test)
이렇게 했을시 ValueError: Unknown label type: 'continuous-multioutput'
라는 에러가 나는데요 도통 어디서 나는지를 모르겠네요;;