Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbinary_classification.py
More file actions
Latest commit
40 lines (30 loc) · 1.18 KB
/
Copy pathbinary_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
fromosimportpath
fromconfigsimportDATASETS, RESULTS_DIR_PATH, Level
fromml.models.builderimportbuild_models
fromml.pipelines.binaryimportBinaryClassificationPipeline
fromml.refactoringimportbuild_refactorings
fromutils.logimportlog, 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.
"""
defmain():
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()
returnresults
if__name__=="__main__":
main()