Breast and ovarian cancers harboring homologous recombination deficiency (HRD) are sensitive to PARP inhibitors and platinum chemotherapy. Conventionally, detecting HRD involves screening for defects in BRCA1, BRCA2, and other relevant genes. Recent analyses have shown that HRD cancers exhibit characteristic mutational signatures due to the activities of HRD-associated mutational processes. At least three machine learning tools exist for detecting HRD based on mutational patterns. Here, using sequencing data from 1,043 breast and 182 ovarian cancers, we trained Homologous Recombination Proficiency Profiler (HRProfiler), a machine learning method for detecting HRD using six mutational features. The performance of HRProfiler was assessed against prior approaches using additional independent datasets of 417 breast and 115 ovarian cancers, including retrospective data from a clinical trial involving patients treated with PARP inhibitors. Individual HRD-associated mutational signatures alone did not consistently detect HRD or predict clinical response across datasets. Notably, while all tools performed comparably for whole-genome sequenced cancers, HRProfiler was the only approach that consistently identified HRD in whole-exome sequenced breast and ovarian cancers, offering clinically relevant insights. Retrospective analyses provided strong evidence that HRProfiler could serve as a valuable tool for predicting HRD and clinical response in breast and ovarian cancers. This study provides the rational for large-scale prospective clinical trials to validate the potential of HRProfiler as a routine predictive and/or prognostic HRD biomarker to guide clinical decision-making.