Json encoding for weighted classifier