Accurate occupancy prediction can improve facility control and energy efficiency of buildings. In recent years, buildings' exiting WiFi infrastructures have been widely studied in the research of occupancy and energy conservation. However, using WiFi to assess occupancy is challenging due to that occupancy information is often characterized stochastically and varies with time and easily disturbed by building components. To overcome such limitations, this study utilizes WiFi probe technology to actively scan WiFi connection requests and responses between access points and network devices of building occupants. With captured signals, this study proposed a Markov based feedback recurrent neural network (M-FRNN) algorithm to model and predict the occupancy profiles. One on-site experiment was conducted to collect ground truth data using camera-based video analysis and the results 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 accuracies can reach 80.9%, 89.6%, and 93.9% with a tolerance of 2, 3, and 4 occupants respectively. This study demonstrated that WiFi data coupled with stochastic machine learning system can provide a viable alternative to determine a building's occupancy profile.