The heterogeneity of technologies that operate over the unlicensed 5 GHz spectrum, such as LTE-Licensed-Assisted-Access (LAA), 5G New Radio Unlicensed (NR-U), and Wi-Fi, calls for more intelligent and efficient techniques to coordinate channel access beyond what current standards offer. Wi-Fi standards require nodes to adopt a fixed value for the minimum contention window (CW min ), which prohibits a node from reacting to aggressive nodes that set their CW min to small values. To address this problem, we propose a framework called Intelligent-CW (ICW) that allows nodes to adapt their CW min values based on observed transmissions, ensuring they receive their fair share of the channel airtime. The CW min value at a node is set based on a random forest, a machine learning model that includes a large number of decision trees. We train the random forest in a supervised manner over a large number of WLAN scenarios, including different misbehaving and aggressive scenarios. Under aggressive scenarios, our simulation results reveal that ICW provides nodes with higher throughput (153.9% gain) and 64% lower frame latency than standard techniques. In order to measure the fairness contribution of individual nodes, we introduce a new fairness metric. Based on this metric, ICW is shown to provide 10.89× improvement in fairness in aggressive scenarios compared to standard techniques.