-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbinary_classification.py
More file actions
40 lines (30 loc) · 1.18 KB
/
binary_classification.py
File metadata and controls
40 lines (30 loc) · 1.18 KB
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
from os import path
from configs import DATASETS, RESULTS_DIR_PATH, Level
from ml.models.builder import build_models
from ml.pipelines.binary import BinaryClassificationPipeline
from ml.refactoring import build_refactorings
from utils.log import log, log_init
"""
The main entrypoint for the binary classification procedure.
This procedure will:
1. Fetch the data for all specified refactorings and levels, see Level and
Refactorings in config.
2. Setup the models specified models, see models/ for the model
configuration and MODELS in config.
3. Push the data through the pre-processing pipeline, initialize the
classifier training, evaluate the models and store them with relevant
describing data. See ml/pipelines/binary for more details.
"""
def main():
log_init(path.join(RESULTS_DIR_PATH, "log", "classifier_training_.txt"))
log("ML4Refactoring: Binary classification")
refactorings = build_refactorings(Level)
# Run models
models = build_models()
pipeline = None
pipeline = BinaryClassificationPipeline(
models, refactorings, DATASETS)
results = pipeline.run()
return results
if __name__ == "__main__":
main()