Statistical inference for sketching algorithms