We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4e259a0 commit 4c9c682Copy full SHA for 4c9c682
data_generator.py
@@ -0,0 +1,27 @@
1
+import numpy as np
2
+import pandas as pd
3
+
4
+def generate_multivariate_timeseries(n_samples=1500, n_features=5):
5
+ time = np.arange(n_samples)
6
7
+ data = {}
8
+ for i in range(n_features):
9
+ data[f"feature_{i+1}"] = (
10
+ np.sin(0.02 * time + i) +
11
+ np.cos(0.01 * time) +
12
+ np.random.normal(0, 0.1, n_samples)
13
+ )
14
15
+ df = pd.DataFrame(data)
16
+ df["target"] = (
17
+ df["feature_1"] * 0.4 +
18
+ df["feature_2"] * 0.3 +
19
+ df["feature_3"] * 0.2 +
20
+ np.random.normal(0, 0.05, n_samples)
21
22
+ return df
23
24
+if __name__ == "__main__":
25
+ df = generate_multivariate_timeseries()
26
+ df.to_csv("data.csv", index=False)
27
+ print("Data generated and saved as data.csv")
0 commit comments