|
a |
|
b/tests/test_data_preparation.py |
|
|
1 |
import sys |
|
|
2 |
import os |
|
|
3 |
import pandas as pd |
|
|
4 |
|
|
|
5 |
# Add the '/scripts' directory to the Python path |
|
|
6 |
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../scripts'))) |
|
|
7 |
|
|
|
8 |
from data.preparation import feature_selection |
|
|
9 |
from data.preparation import data_split |
|
|
10 |
|
|
|
11 |
# Test feature selection function |
|
|
12 |
def test_feature_selection(): |
|
|
13 |
for features in feature_selection().items(): |
|
|
14 |
assert features |
|
|
15 |
|
|
|
16 |
# Test data split function |
|
|
17 |
def test_data_split(): |
|
|
18 |
os.makedirs('../../data/input', exist_ok=True) |
|
|
19 |
|
|
|
20 |
assert data_split(feature_selection().drop('LUNG_CANCER', axis='columns'), feature_selection()['LUNG_CANCER']) |