Esempio n. 1
0
def setup_test_df():
    """Create a dataframe populated with some test columns."""
    df = learn.DataFrame()
    df["a"] = learn.TransformedSeries([mocks.MockSeries("foobar", [])],
                                      mocks.MockTwoOutputTransform(
                                          "iue", "eui", "snt"), "out1")
    df["b"] = learn.TransformedSeries([mocks.MockSeries("foobar", [])],
                                      mocks.MockTwoOutputTransform(
                                          "iue", "eui", "snt"), "out2")
    df["c"] = learn.TransformedSeries([mocks.MockSeries("foobar", [])],
                                      mocks.MockTwoOutputTransform(
                                          "iue", "eui", "snt"), "out1")
    return df
def setup_test_df_3layer():
  """Create a dataframe populated with some test columns."""
  df = learn.DataFrame()

  df["a"] = mocks.MockSeries("a_series", mocks.MockTensor("Tensor a", tf.int32))
  df["b"] = mocks.MockSeries("b_series",
                             mocks.MockSparseTensor("SparseTensor b", tf.int32))
  df["c"] = mocks.MockSeries("c_series", mocks.MockTensor("Tensor c", tf.int32))
  df["d"] = mocks.MockSeries("d_series",
                             mocks.MockSparseTensor("SparseTensor d", tf.int32))

  df["e"] = learn.TransformedSeries([df["a"], df["b"]],
                                    mocks.Mock2x2Transform("iue", "eui", "snt"),
                                    "out1")
  df["f"] = learn.TransformedSeries([df["c"], df["d"]],
                                    mocks.Mock2x2Transform("iue", "eui", "snt"),
                                    "out2")
  df["g"] = learn.TransformedSeries([df["e"], df["f"]],
                                    mocks.Mock2x2Transform("iue", "eui", "snt"),
                                    "out1")
  return df