I’m asssuming the number of sts in the cable pattern is 6? Cast on the number of sts used in the pattern repeat X4, plus 12. In other words: 6 sts, the pattern repeat of 6 X 4, which is 24, and then another 6. That’s 36 sts. Work 6 sts in reverse stockinette st (the purl bumps on the outside), then the cable pattern 4 times, then 6 sts in reverse stockinette st. So this for about 4 inches and then you’ll really know your gauge. It’s a lot, but if you do less than that, you won’t really get a good idea and then may have to rip out the whole hat and start over.
The reason you’re doing the 6 sts of reverse stockinette on either side is that you’ll have easy, distinct borders from which to measure. If you don’t get gauge, just do a ridge of garter st and keep going. You can measure the new needle size from the garter ridge, instead of ripping out and re-casting on and starting from scratch.