How did we decide that the number of units in the layer? People will tell you it is an art and it comes with experience and expertise. A simple way for a beginner is to add the total number of columns in X and y and divide by 2. (30+1)/2 = 15.5 ~ 16. hence ,
units = 16.