This article investigates a Denial-of-Service (DoS) attack problem for nonlinear unknown discrete-time multiagent systems (MASs) to implement bipartite consensus tracking tasks with fixed and switching topologies. Firstly, an equivalent linearization data model of each agent is constructed using a pseudo partial derivative approach, where only one parameter needs to be estimated using input/output data of the controlled MASs. Meanwhile, the DoS attack behavior is described by a Bernoulli distribution process, and both cooperative and competitive relationships among agents are investigated. Moreover, an increment prediction compensator is designed to reduce the effect of DoS attacks. A data-based adaptive predictive bipartite consensus control algorithm is formulated. The corresponding theoretical analysis indicates that tracking errors of MASs with fixed and switching topologies converge to a small range around zero. Finally, several simulations and hardware tests further verify the proposed scheme’s effectiveness.