Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support human shape annotation in meta column info #137

Open
yupbank opened this issue Jan 22, 2018 · 5 comments
Open

support human shape annotation in meta column info #137

yupbank opened this issue Jan 22, 2018 · 5 comments

Comments

@yupbank
Copy link
Contributor

yupbank commented Jan 22, 2018

data = [Row(x=[float(x), float(2 * x)], key=str(x % 2)) for x in range(1, 6)]
df_analyzed = tfs.analyze(sqlContext.createDataFrame(data))
df = sqlContext.createDataFrame(data)

# this would work
grouped_df_analyzed = df_analyzed.groupby('key')

In [79]: with tf.Graph().as_default() as g:
    ...:     x = tf.placeholder(tf.double, [None, 2], name='x_input')
    ...:     y = tf.reduce_mean(x, 0, name='x')
    ...:     df_1 = tfs.aggregate(y, grouped_df_analyzed)

#while this would fail..

grouped_df  = df.groupby('key')

In [80]: with tf.Graph().as_default() as g:
    ...:     x = tf.placeholder(tf.double, [None, 2], name='x_input')
    ...:     y = tf.reduce_mean(x, 0, name='x')
    ...:     df_1 = tfs.aggregate(y, grouped_df)

# with reason

java.lang.Exception: The data column 'x' has shape [?,?], not compatible with shape [?,2] requested by the TF graph

which would be useful if there is a function the take human input into the meta data...

@yupbank yupbank changed the title support array of array aggregation support human annotation in meta column info Jan 23, 2018
@yupbank yupbank changed the title support human annotation in meta column info support human shape annotation in meta column info Jan 23, 2018
@yupbank
Copy link
Contributor Author

yupbank commented Jan 23, 2018

@tjhunter would builder or experiment operator a good place to append human annotation?

@thunterdb
Copy link
Contributor

thunterdb commented Jan 26, 2018 via email

@thunterdb
Copy link
Contributor

thunterdb commented Jan 26, 2018 via email

@yupbank
Copy link
Contributor Author

yupbank commented Jan 26, 2018

Hi, I was referring to whether we should provide a interface let user pass in the shape of the dataframe columns. In my example, if I can add shape=(None,2) to column x's meta data, I don't need to analyze the whole dataframe, which have expensive cost

@thunterdb
Copy link
Contributor

@yupbank sorry I missed your response. There is a workaround documented there that should do the trick for your use case:
https://groups.google.com/forum/#!topic/tensorframes/g3Dm97oFvVw
It would be great to add this functionality into tensorframes. If it works for you, you should feel free to open a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants