From c4be4e24cc408eb86667d253155b2d342a18e9a1 Mon Sep 17 00:00:00 2001 From: Teo Bucci Date: Wed, 27 Mar 2024 20:32:38 +0100 Subject: [PATCH] Simplify testing file --- hawk/processes/simulation_interactive.py | 41 +++++------------------- 1 file changed, 8 insertions(+), 33 deletions(-) diff --git a/hawk/processes/simulation_interactive.py b/hawk/processes/simulation_interactive.py index e189b3e..2d3bd68 100644 --- a/hawk/processes/simulation_interactive.py +++ b/hawk/processes/simulation_interactive.py @@ -1,46 +1,21 @@ -import numpy as np -import pandas as pd from birdy import WPSClient -# ----------- Generate some data ----------- -np.random.seed(0) -n = 1000 # number of samples -m = 15 # number of features - -data = {} -for i in range(1, m + 1): - data[f"x{i}"] = np.random.normal(size=n) - -target_name = "target" -data[target_name] = sum(data.values()) + np.random.normal(size=n) - -data = pd.DataFrame(data) - -n_test = int(0.20 * n) -n_train = n - n_test -data_test = data[n_train:] -data = data[:n_train] - -data.head() - - -train_file_path = "./train_dataset.csv" -test_file_path = "./test_dataset.csv" -data.to_csv(train_file_path, index=False) -data_test.to_csv(test_file_path, index=False) +train_file_path = "Emiliani1_train.csv" +test_file_path = "Emiliani1_test.csv" +target_column_name = "cyclostationary_mean_rr_4w_1" # ----------------- WPS ----------------- -wps = WPSClient("http://localhost:5000/wps", verify=False) +wps = WPSClient("http://localhost:5002/wps", verify=False) help(wps) # Input some data for the causal process resp = wps.causal( - dataset_train=train_file_path, - dataset_test=test_file_path, - target_column_name=target_name, + dataset_train=open(train_file_path), + dataset_test=open(test_file_path), + target_column_name=target_column_name, pcmci_test_choice="ParCorr", - pcmci_max_lag="1", + pcmci_max_lag="0", tefs_direction="both", tefs_use_contemporary_features="Yes", tefs_max_lag_features="1",