This paper aims to solve machine learning optimization problem by using quantum circuit. Two approaches, namely the average approach and the Partial Swap Test Cut-off method (PSTC) was proposed to search for the global minimum/maximum of two different objective functions. The current cost is $O(\sqrt{|\Theta|} N)$, but there is potential to improve PSTC further to $O(\sqrt{|\Theta|} \cdot sublinear \ N)$ by enhancing the checking process.