|
1 | | -from typing import Final, Optional |
2 | | - |
3 | | -import pandas as pd |
| 1 | +from typing import Final |
4 | 2 |
|
5 | 3 | from moddata.extractor.bankchurn_extractor import BankchurnExtractor |
6 | 4 | from moddata.transformer.bankchurn_transformer import BankchurnTransformer |
7 | | -from moddata.src.constants import EncodingAndScalingModelType |
| 5 | +from moddata.src.constants import TrainTestXyDataFrames |
| 6 | +from moddata.src.config import BankchurnPipelineConfig |
8 | 7 |
|
9 | 8 |
|
10 | 9 | class BankchurnPipeline: |
11 | 10 |
|
12 | | - def __init__( |
13 | | - self, |
14 | | - train_size: float | int, |
15 | | - random_state: Optional[int] = None, |
16 | | - encoding_and_scaling_model_type: Optional[EncodingAndScalingModelType] = None |
17 | | - ): |
18 | | - self._random_state: Optional[int] = random_state |
19 | | - self._encoding_and_scaling_model_type: Optional[EncodingAndScalingModelType] = encoding_and_scaling_model_type |
| 11 | + def __init__(self, config: BankchurnPipelineConfig): |
| 12 | + self._config: Final[BankchurnPipelineConfig] = config |
20 | 13 | self._transformer: Final[BankchurnTransformer] = ( |
21 | | - BankchurnTransformer( |
22 | | - train_size=train_size, |
23 | | - random_state=random_state, |
24 | | - encoding_and_scaling_model_type=self._encoding_and_scaling_model_type |
25 | | - ) |
| 14 | + BankchurnTransformer(config=self._config) |
26 | 15 | ) |
27 | 16 |
|
28 | | - def run(self) -> tuple[pd.DataFrame, pd.DataFrame, pd.DataFrame, pd.DataFrame]: |
| 17 | + def run(self) -> TrainTestXyDataFrames: |
29 | 18 | x, y = BankchurnExtractor().extract() |
30 | 19 | return self._transformer.transform(data=(x, y)) |
0 commit comments