Pseudolikelihood Decimation Algorithm Improving the Inference of the Interaction Network in a General Class of Ising Models