Tensorflow: tf.contrib.DNNClassifier(..) or tf.estimator.DNNClassifier(..)
Programming questions are a bit out of scope of this site, but it's a more generic one. For some reason the developers didn't specify it in code, but everything in contrib is experimental. From this discussion:

The distinction between core and contrib is really in core things don't change. Things are backward compatible until release 2.0, and nobody's thinking about that right now.
If you have something in core, it's stable, you should use it. If you have something in contrib, the API may change and depending on your needs you may or may not want to use it.

When a particular class or function is only in contrib, there's basically no choice. But for classes that have &quot;graduated&quot; to the core, contrib version gets deprecated automatically. So you want to use tf.estimator.DNNClassifier.