I'm new to using Tensorflow/SkFlow, and I'm trying to figure out if it is possible to use multiple target columns and produce multiple output predictions.
I tried the code below, but this doesn't seem to be acceptable input:
import numpy as np
import tensorflow.contrib.learn as skflow
# Sample data (obviously actual data would contain a lot more rows)
training_data = np.asarray( [
np.asarray( [ 215.0, 5.0], dtype=np.float64 ),
np.asarray( [ 283.0, 2.0], dtype=np.float64 )
], dtype=np.float64 )
training_target = np.asarray( [
np.asarray( [ 220.0, 210.0], dtype=np.float64 ),
np.asarray( [ 285.0, 281.0], dtype=np.float64 )
], dtype=np.float64 )
regressor = skflow.TensorFlowDNNRegressor( hidden_units=[2,4,2] )
regressor.fit( x=training_data, y=training_target, steps=2000 )
print( regressor.predict( training_set.data )[0] )
When I run this code, I get the following error:
File "/some/path/anaconda/anaconda/lib/python2.7/site-packages/tensorflow/python/framework/tensor_shape.py", line 741, in assert_is_compatible_with
raise ValueError("Shapes %s and %s are incompatible" % (self, other))
ValueError: Shapes (?, 1) and (?, 2) are incompatible
Is it possible to make something like this work using SkFlow?