def get_titanic_clean(return_xy=False): df = pd.read_csv(path.join(_here, 'titanic.csv'), encoding='latin1') df.Fare = df.Fare.astype(float) df.Age.fillna(df.Age.median(), inplace=True) df.Cabin.fillna('-', inplace=True) df.Embarked.fillna('-', inplace=True) return split_xy(df, 'Survived') if return_xy else df
def get_house_prices(return_xy=False): df = pd.read_csv(path.join(_here, 'house_prices.zip'), encoding='latin1') return split_xy(df, 'SalePrice') if return_xy else df
def get_titanic(return_xy=False): df = pd.read_csv(path.join(_here, 'titanic.csv'), encoding='latin1') df.Fare = df.Fare.astype(float) return split_xy(df, 'Survived') if return_xy else df