Accurate occupancy prediction can improve building control and energy efficiency. In recent years, WiFi signals inside buildings have been widely adopted in occupancy and building energy studies. However, WiFi signals are easily disturbed by building components and the connections between users and WiFi signals are unstable. Meanwhile, occupancy information is often characterized stochastically and varies with time. To overcome such limitations, this study utilizes WiFi probe technology to actively scan the WiFi connection request and response between WiFi signal and smart devices in existing network infrastructures. The Markov based feedback recurrent neural network (M-FRNN) algorithm is proposed in modeling and predicting the occupancy profiles. One on-site experiment was conducted to collect ground truth data using camera-based occupancy sensors, which were used to validate the M-FRNN occupancy prediction model over a 9-day measurement period. From the results, the M-FRNN based occupancy model using WiFi probes shows best accuracy with a tolerance of 2, 3, and 4 occupants can reach 80.9%, 89.6%, and 93.9%, respectively. This study demonstrated WiFi data coupled with machine learning methods can provide valuable people count information to building control systems and thus improve building energy efficiency.