Let G be a group, and let M = (µn) ∞ n=1 be a sequence of finitely supported probability measures on G. Consider the probability that two elements chosen independently according to µn commute. Antolín, Martino and Ventura define the degree of commutativity dcM (G) of G with respect to this sequence to be the lim sup of this probability. The main results of the present paper give quantitative algebraic consequences of the degree of commutativity being above certain thresholds. For example, if µn is the distribution of the nth step of a symmetric random walk on G, or if G is amenable and (µn) is a sequence of almost-invariant measures on G, we show that if dcM (G) > 5 8 then G is abelian; if dcM (G) ≥ 1 2 + ε then the centre of G has index at most ε −1 ; and if dcM (G) ≥ α > 0 then G contains a normal subgroup Γ of index at most ⌈α −1 ⌉ and a normal subgroup H of cardinality at most exp(O(α −O(1) )) such that H ⊂ Γ and Γ/H is abelian. We also describe some general conditions on (µn) under which such theorems hold. These results generalise results for finite groups due to Gustafson and P. M. Neumann, and generalise and quantify a result for certain residually finite groups of subexponential growth due to Antolín, Martino and Ventura. We also present an application to conjugacy ratios, showing that if the sequence of word-metric balls in a finitely generated group is both left-and right-Følner then the conjugacy ratio is equal to the degree of commutativity. Combined with our main results, this generalises a result of Ciobanu, Cox and Martino.