/
__init__.py
43 lines (32 loc) · 921 Bytes
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import pandas as pd
from os.path import dirname, join
def load_ames():
"""Load ames housing dataset.
Returns
-------
data : DataFrame
DataFrame containing the ames housing dataset.
"""
module_path = dirname(__file__)
return pd.read_pickle(join(module_path, 'ames_housing.pkl.bz2'))
def load_titanic():
"""Load titanic dataset.
Returns
-------
data : DataFrame
DataFrame containing the titanic dataset.
"""
module_path = dirname(__file__)
return pd.read_csv(join(module_path, 'titanic.csv'))
def load_adult():
"""Load adult census dataset.
Returns
-------
data : DataFrame
DataFrame containing the adult dataset.
"""
module_path = dirname(__file__)
return pd.read_csv(join(module_path, 'adult.csv.gz'))
def data_path(filename):
module_path = dirname(__file__)
return join(module_path, filename)