Neyman's smooth test for testing uniformity is a recognized goodness-o
f-fit procedure. As stated by LaRiccia, the test can be viewed as a co
mpromise between omnibus test procedures, with generally low power in
all directions, and procedures whose power is focused in the direction
of a specific alternative. The basic idea behind this test is to embe
d the null density into, say, a k-dimensional exponential family and t
hen to construct an asymptotically optimal test for the parametric tes
ting problem. The resulting procedure is Neyman's test with k componen
ts. The most difficult problem related with using this test is the cho
ice of k. Recommendations in statistical literature are sometimes conf
using. Some authors advocate a small number of components, whereas oth
ers show that in some situations a larger number of components is prof
itable. All existing suggestions concerning how to select k exploit in
fact some preliminary knowledge about a possible alternative. In this
article, a new data-driven method for selecting the number of compone
nts in Neyman's test is proposed. The method consists of using Schwarz
's BIC procedure to choose the dimension of the exponential model for
the data and then using the chosen dimension as the number of componen
ts. So this novel procedure relies on fitting the model to the data an
d verifying whether the difference between the model and the uniform d
istribution is significant. Consistency of the method is proved. Prese
nted simulations show that the test adapts well to the alternative at
hand. Simulated power of the data-driven version of Neyman's test also
performs well in comparison with that of other tests.