Exemplo n.º 1
0
    def __load_peripheral_tables(self, peripheral_tables, s):

        peripheral_data_frames = []

        for i, peripheral_table in enumerate(peripheral_tables):

            if type(peripheral_table) == engine.DataFrame:

                peripheral_data_frames.append(peripheral_table)

            else:

                categorical_peripheral = [
                    per.thisptr["categorical_"]
                    for per in self.params["peripheral"]
                ]

                discrete_peripheral = [
                    per.thisptr["discrete_"]
                    for per in self.params["peripheral"]
                ]

                numerical_peripheral = [
                    per.thisptr["numerical_"]
                    for per in self.params["peripheral"]
                ]

                join_keys_peripheral = [
                    per.thisptr["join_keys_"]
                    for per in self.params["peripheral"]
                ]

                names_peripheral = [
                    per.thisptr["name_"] for per in self.params["peripheral"]
                ]

                time_stamps_peripheral = [
                    per.thisptr["time_stamps_"]
                    for per in self.params["peripheral"]
                ]

                peripheral_data_frames.append(
                    engine.DataFrame(name=self.__make_random_name(),
                                     join_keys=join_keys_peripheral[i],
                                     time_stamps=time_stamps_peripheral[i],
                                     categorical=categorical_peripheral[i],
                                     discrete=discrete_peripheral[i],
                                     numerical=numerical_peripheral[i],
                                     targets=[],
                                     units=self.params['units']))

                peripheral_data_frames[i].send(data_frame=peripheral_table,
                                               sock=s)

        return peripheral_data_frames
Exemplo n.º 2
0
    def __load_population_table(self, population_table, targets, s):

        if type(population_table) == engine.DataFrame:

            population_data_frame = population_table

        else:

            population_data_frame = engine.DataFrame(
                name=self.__make_random_name(),
                join_keys=self.params["population"].thisptr["join_keys_"],
                time_stamps=self.params["population"].thisptr["time_stamps_"],
                categorical=self.params["population"].thisptr["categorical_"],
                discrete=self.params["population"].thisptr["discrete_"],
                numerical=self.params["population"].thisptr["numerical_"],
                targets=targets,
                units=self.params["units"])

            population_data_frame.send(data_frame=population_table, sock=s)

        return population_data_frame
Exemplo n.º 3
0

# With this additional information in place we can construct
# the `DataFrame`s, which will serve as our handles for the tables
# stored in the engine. Using the `.send()` method we upload the
# provided data to the engine and `.save()` ensures the `DataFrame` will
# persist.

# In[ ]:


df_population_training = engine.DataFrame(
    "POPULATION_TRAINING",
    join_keys=JOIN_KEYS,
    time_stamps=TIME_STAMPS,
    categorical=CATEGORICAL,
    discrete=DISCRETE,
    numerical=NUMERICAL,
    targets=TARGETS,
    units=units
).send(CE_population_training)
df_population_training.save()

df_population_validation = engine.DataFrame(
    "POPULATION_VALIDATION",
    join_keys=JOIN_KEYS,
    time_stamps=TIME_STAMPS,
    categorical=CATEGORICAL,
    discrete=DISCRETE,
    numerical=NUMERICAL,
    targets=TARGETS,
    units=units