A quantum error mitigation technique based on machine learning is proposed, which learns how to adjust the probabilities estimated by measurement in the computational basis. Neural networks in two different designs are trained with random quantum circuits consisting of a set of one- and two-qubit unitary gates whose measurement statistics in the ideal (noiseless) and real (noisy) cases are known. Once the neural networks are trained, they infer the amount of probability adjustment to be made on the measurement obtained from executing an unseen quantum circuit to reduce the error. The proposed schemes are tested with two-, three-, five-, and seven-qubit quantum circuits of depth up to 20 by computer simulations with realistic error models and experiments using the IBM quantum cloud platform. In all test cases, the proposed mitigation technique reduces the error effectively. Our method can be used to improve the accuracy of noisy intermediate-scale quantum (NISQ) algorithms without relying on extensive error characterization or quantum error correction.