  Frustration driven quantum fluctuation leads to many exotic phases in the
ground state and study of these quantum phase transitions is one of the most
challenging areas of research in condensed matter physics. Here, a frustrated
Heisenberg $J_1-J_2$ model of spin-1/2 chain with nearest exchange interaction
$J_1$ and next nearest exchange interaction $J_2$ is studied using the
principal component analysis (PCA) which is an unsupervised machine learning
technique. In this method most probable spin configurations (MPSC) of
ground-state (GS) and first excited state (FES) for different $J_2/J_1$ are
used as the input in PCA to construct the co-variance matrix. The `quantified
principal component' of the largest eigenvalue of co-variance matrix
$p_1(J_2/J_1)$ is calculated and it is shown that the nature and variation of
$p_1(J_2/J_1)$ can accurately predict the phase transitions and degeneracies in
the GS. The $p_1(J_2/J_1)$ calculated from the MPSC of GS can only exhibit the
signature of degeneracies in the GS, whereas, $p_1(J_2/J_1)$ calculated from
MPSC of FES captures the gapless spin liquid (GSL)-dimer phase transition as
well as all the degeneracies of the model system. We show that jump in
$p_1(J_2/J_1)$ of FES at $J_2/J_1 \approx 0.241$, indicates the GSL-dimer phase
transition, whereas its kinks give the signature of the GS degeneracies. The
scatter plot of first two principal components of FES shows distinct band
formation for different phases.
