Skip to content

support human shape annotation in meta column info #137

Description

@yupbank
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...

Activity

  1. changed the title [-]support array of array aggregation[/-] [+]support human annotation in meta column info[/+] on Jan 23, 2018
  2. changed the title [-]support human annotation in meta column info[/-] [+]support human shape annotation in meta column info[/+] on Jan 23, 2018
  3. yupbank commented on Jan 23, 2018

    @yupbank
    ContributorAuthor

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

  4. thunterdb commented on Jan 26, 2018

    @thunterdb
    Contributor
  5. thunterdb commented on Jan 26, 2018

    @thunterdb
    Contributor
  6. yupbank commented on Jan 26, 2018

    @yupbank
    ContributorAuthor

    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

  7. thunterdb commented on Feb 8, 2018

    @thunterdb
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions