ChilliPeep commited on
Commit
266c8df
·
verified ·
1 Parent(s): 8f15b1f

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +74 -0
README.md CHANGED
@@ -1,3 +1,77 @@
1
  ---
2
  license: cc-by-4.0
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: cc-by-4.0
3
+ task_categories:
4
+ - tabular-classification
5
+ tags:
6
+ - technical-debt
7
+ - code-quality
8
+ - software-engineering
9
+ size_categories:
10
+ - 1K<n<10K
11
  ---
12
+
13
+ # TechDebt ML Dataset
14
+
15
+ Features extracted from 22 public Python repositories, used to train a Random Forest
16
+ classifier that predicts technical debt risk per file. Companion dataset to the
17
+ [TechDebt ML](https://github.com/Chillipeeper1/techdebt-ml) project.
18
+
19
+ ## Content
20
+
21
+ Each row is one Python file. Columns include:
22
+
23
+ - **Code-quality metrics** (via [Radon](https://radon.readthedocs.io/)): `loc`, `sloc`,
24
+ `comment_ratio`, `blank_ratio`, `cyclomatic_complexity`, `max_complexity`,
25
+ `maintainability_index`, `halstead_effort`, `num_functions`, `avg_function_len`
26
+ - **Structural metrics** (via Python's `ast`): `dependency_count`, `max_nesting_depth`,
27
+ `is_tested`
28
+ - **Git activity** (normalized relative to each file's own repo — see Preprocessing below):
29
+ `commit_count`, `author_count`, `churn_rate`, `days_since_change`
30
+ - **Metadata**: `file name`, `repo`
31
+ - **`label`**: 1 if the file had 2+ bug-fix commits in its git history, 0 otherwise
32
+ - `bug_fix_commits`, `refactor_commits`: kept for reference only — **do not use these as
33
+ model features**, they were excluded from training due to label leakage (see below)
34
+
35
+ 2,503 rows total. Label balance: 62% (0) / 38% (1).
36
+
37
+ ## Preprocessing applied
38
+
39
+ Git-activity features (`commit_count`, `author_count`, `churn_rate`, `days_since_change`)
40
+ were normalized relative to each file's own repository (divided by that repo's median),
41
+ since their absolute values are not comparable across repos with different overall
42
+ activity levels.
43
+
44
+ Three columns were additionally clipped at the 99th percentile to control extreme outliers:
45
+ - `max_complexity`: clipped at 42.98
46
+ - `churn_rate`: clipped at 27.05
47
+ - `commit_count`: clipped at 20.97
48
+
49
+ ## Known limitations
50
+
51
+ This dataset inherits every limitation already documented in the source project:
52
+
53
+ - **Label leakage (resolved):** an early version leaked the label into the features via
54
+ `bug_fix_commits`/`refactor_commits`. [Details](https://github.com/Chillipeeper1/techdebt-ml/blob/main/docs/descisions/001-data-leakage.md)
55
+ - **No temporal split:** features and label are both computed from a file's entire git
56
+ history, without a strict past-predicts-future split. [Details](https://github.com/Chillipeeper1/techdebt-ml/blob/main/docs/descisions/002-limitations-temporal-cut.md)
57
+ - **Git-activity bias (partially mitigated):** earlier model versions over-relied on commit
58
+ and author counts rather than actual code complexity. Relative normalization improved
59
+ this substantially but did not fully resolve it. [Details](https://github.com/Chillipeeper1/techdebt-ml/blob/main/docs/descisions/003-model-bias-git-activity.md)
60
+ - **Small-sample repos:** three of the 22 source repos have very few files (`flow`: 2,
61
+ `Discord-OTP-Forcer`: 11, `ibet-Network`: 12). Per-repo medians used for git-activity
62
+ normalization are less reliable for these repos. They were kept rather than excluded,
63
+ given the small number of files affected.
64
+ - **Median computed pre-split:** per-repo medians for normalization were computed over the
65
+ full dataset (train + test combined) rather than fit only on the training partition.
66
+ Likely low impact, but a known methodological gap.
67
+
68
+ ## Source repositories
69
+
70
+ See [`source_repos.csv`](./source_repos.csv) for the full list of the 22 public GitHub
71
+ repositories this dataset was derived from, with their URLs. Only aggregate numeric metrics
72
+ are included here — no source code, commit messages, or author names are redistributed.
73
+
74
+ ## License
75
+
76
+ The derived metrics in this dataset are released under CC-BY 4.0. The original source code
77
+ of each repository remains under its own respective license.