示例#1
0
##############################################################################
##############################################################################

csv_path = "../csv/"
in_csv_names = [
    "r125-density-iter" + str(i) + "-results.csv"
    for i in range(1, iternum + 1)
]

# Read files
df_csvs = [
    pd.read_csv(csv_path + in_csv_name, index_col=0)
    for in_csv_name in in_csv_names
]
dfs = [
    prepare_df_density(df_csv, R125, liquid_density_threshold)[0]
    for df_csv in df_csvs
]


def main():

    #seaborn.set_palette("Set2")
    seaborn.set_palette("colorblind")
    # Create a dataframe with one row per parameter set
    dfs_paramsets = [prepare_df_density_errors(df, R125) for df in dfs]

    name = "mape_liq_density"
    fig, ax = plt.subplots()
    axins = inset_axes(ax,
                       width="100%",
示例#2
0
]
df_csv = pd.concat(df_csvs)
df_vle = prepare_df_vle(df_csv, R125)

# Read liquid density files
max_density_iter = 4
in_csv_names = [
    "r125-density-iter" + str(i) + "-results.csv"
    for i in range(1, max_density_iter + 1)
]
df_csvs = [
    pd.read_csv(csv_path + in_csv_name, index_col=0)
    for in_csv_name in in_csv_names
]
df_csv = pd.concat(df_csvs)
df_all, df_liquid, df_vapor = prepare_df_density(df_csv, R125,
                                                 liquid_density_threshold)

### Fit GP models to VLE data
# Create training/test set
param_names = list(R125.param_names) + ["temperature"]
property_names = ["sim_liq_density", "sim_vap_density", "sim_Pvap", "sim_Hvap"]

vle_models = {}
for property_name in property_names:
    # Get train/test
    x_train, y_train, x_test, y_test = shuffle_and_split(
        df_vle, param_names, property_name, shuffle_seed=gp_shuffle_seed)

    # Fit model
    vle_models[property_name] = run_gpflow_scipy(
        x_train,