# Path: babyai/plotting.py
# def load_log(dir_):
# def load_multiphase_log(dir_):
# def load_logs(root, multiphase=False):
# def plot_average_impl(df, regexps, y_value='return_mean', window=1, agg='mean',
#                       x_value='frames'):
# def plot_average(*args, **kwargs):
# def plot_all_runs(df, regex, quantity='return_mean', x_axis='frames', window=1, color=None):
# def model_num_samples(model):
# def get_fps(df):
# def best_within_normal_time(df, regex, patience, limit='epochs', window=1, normal_time=None, summary_path=None):
# def estimate_sample_efficiency(df, visualize=False, figure_path=None):


import argparse
import pandas
import os
import json
import re
import numpy as np
from scipy import stats
from babyai import plotting as bp
#!/usr/bin/env python3



parser = argparse.ArgumentParser("Analyze performance of imitation learning")
parser.add_argument("--path", default='.',
    help="path to model logs")
parser.add_argument("--regex", default='.*',
    help="filter out some logs")
parser.add_argument("--other", default=None,
    help="path to model logs for ttest comparison")
parser.add_argument("--other_regex", default='.*',
    help="filter out some logs from comparison")
parser.add_argument("--window", type=int, default=100,
    help="size of sliding window average, 10 for GoToRedBallGrey, 100 otherwise")
args = parser.parse_args()


def get_data(path, regex):
    df = pandas.concat(bp.load_logs(path), sort=True)

# Path: babyai/plotting.py
# def load_log(dir_):
# def load_multiphase_log(dir_):
# def load_logs(root, multiphase=False):
# def plot_average_impl(df, regexps, y_value='return_mean', window=1, agg='mean',
#                       x_value='frames'):
# def plot_average(*args, **kwargs):
# def plot_all_runs(df, regex, quantity='return_mean', x_axis='frames', window=1, color=None):
# def model_num_samples(model):
# def get_fps(df):
# def best_within_normal_time(df, regex, patience, limit='epochs', window=1, normal_time=None, summary_path=None):
# def estimate_sample_efficiency(df, visualize=False, figure_path=None):


# Path: scripts/il_perf.py
import argparse
import pandas
import os
import json
import re
import numpy as np
from scipy import stats
from babyai import plotting as bp

#!/usr/bin/env python3



parser = argparse.ArgumentParser("Analyze performance of imitation learning")
parser.add_argument("--path", default='.',
    help="path to model logs")
parser.add_argument("--regex", default='.*',
    help="filter out some logs")
parser.add_argument("--other", default=None,
    help="path to model logs for ttest comparison")
parser.add_argument("--other_regex", default='.*',
    help="filter out some logs from comparison")
parser.add_argument("--window", type=int, default=100,
    help="size of sliding window average, 10 for GoToRedBallGrey, 100 otherwise")
args = parser.parse_args()


def get_data(path, regex):
    df = pandas.concat(bp.load_logs(path), sort=True)

    fps = bp.get_fps(df)