-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
32 lines (24 loc) · 987 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import hydra
import numpy as np
import pandas as pd
from hydra import compose, initialize_config_dir
from omegaconf import DictConfig, OmegaConf
from datasets.openpower import OpenPowerDataset
from datasets.pecanstreet import PecanStreetDataset
from datasets.timeseries_dataset import TimeSeriesDataset
from eval.evaluator import Evaluator
from generator.data_generator import DataGenerator
def evaluate_single_dataset_model(cfg: DictConfig):
if cfg.dataset.name == "pecanstreet":
dataset = PecanStreetDataset(cfg.dataset)
elif cfg.dataset.name == "openpower":
dataset = OpenPowerDataset(cfg.dataset)
non_pv_user_evaluator = Evaluator(cfg, dataset)
non_pv_user_evaluator.evaluate_model()
@hydra.main(version_base=None, config_path="config", config_name="config")
def main(cfg: DictConfig):
evaluate_single_dataset_model(cfg=cfg)
with open("config_used.yaml", "w") as f:
OmegaConf.save(cfg, f)
if __name__ == "__main__":
main()