Skip to content

Commit

Permalink
Simplify testing file
Browse files Browse the repository at this point in the history
  • Loading branch information
teobucci committed Mar 27, 2024
1 parent 9f228e7 commit c4be4e2
Showing 1 changed file with 8 additions and 33 deletions.
41 changes: 8 additions & 33 deletions hawk/processes/simulation_interactive.py
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit c4be4e2

Please sign in to comment.