I am trying to get a LinearRegressor
to work and I get an error for which there doesn't seem to be much documentation about.
When I do:
regressor = tf.contrib.learn.LinearRegressor(feature_columns=linear_features)
regressor.fit(input_fn=training_input_fn, steps=10000)
regressor.evaluate(input_fn=eval_input_fn)
I get the error:
Instructions for updating: Please switch to tf.train.get_global_step
I am not sure how to proceed.
I read from the docs:
SOME ARGUMENTS ARE DEPRECATED. They will be removed after 2016-12-01. Instructions for updating: Estimator is decoupled from Scikit Learn interface by moving into separate class SKCompat. Arguments x, y and batch_size are only available in the SKCompat class, Estimator will only accept input_fn. Example conversion: est = Estimator(...) -> est = SKCompat(Estimator(...))
But I'm not sure to what I should change to, or how to switch to the global step.
I tried using tf.estimator.LinearRegressor
mainly because I'm out of ideas, and did something like this:
estimator = tf.estimator.LinearRegressor(feature_columns=linear_features)
estimator.train(input_fn=training_input_fn)
estimator.evaluate(input_fn=eval_input_fn)
estimator.predict(input_fn=eval_input_fn)
But got no output at all.