|
6 | 6 | import pandas as pd
|
7 | 7 | from sklearn.utils.validation import check_random_state
|
8 | 8 |
|
9 |
| -from aeon.utils.validation.collection import convert_collection |
| 9 | +from aeon.utils.conversion import convert_collection |
10 | 10 |
|
11 | 11 |
|
12 | 12 | def make_example_3d_numpy(
|
@@ -457,3 +457,71 @@ def _make_nested_from_array(array, n_instances=20, n_columns=1):
|
457 | 457 | [[pd.Series(array) for _ in range(n_columns)] for _ in range(n_instances)],
|
458 | 458 | columns=[f"col{c}" for c in range(n_columns)],
|
459 | 459 | )
|
| 460 | + |
| 461 | + |
| 462 | +np_list = [] |
| 463 | +for _ in range(10): |
| 464 | + np_list.append(np.random.random(size=(1, 20))) |
| 465 | +df_list = [] |
| 466 | +for _ in range(10): |
| 467 | + df_list.append(pd.DataFrame(np.random.random(size=(20, 1)))) |
| 468 | +nested, _ = make_example_nested_dataframe(n_cases=10) |
| 469 | +multiindex = make_example_multi_index_dataframe( |
| 470 | + n_instances=10, n_channels=1, n_timepoints=20 |
| 471 | +) |
| 472 | + |
| 473 | +EQUAL_LENGTH_UNIVARIATE = { |
| 474 | + "numpy3D": np.random.random(size=(10, 1, 20)), |
| 475 | + "np-list": np_list, |
| 476 | + "df-list": df_list, |
| 477 | + "numpy2D": np.zeros(shape=(10, 20)), |
| 478 | + "pd-wide": pd.DataFrame(np.zeros(shape=(10, 20))), |
| 479 | + "nested_univ": nested, |
| 480 | + "pd-multiindex": multiindex, |
| 481 | +} |
| 482 | +np_list_uneq = [] |
| 483 | +for i in range(10): |
| 484 | + np_list_uneq.append(np.random.random(size=(1, 20 + i))) |
| 485 | +df_list_uneq = [] |
| 486 | +for i in range(10): |
| 487 | + df_list_uneq.append(pd.DataFrame(np.random.random(size=(20 + i, 1)))) |
| 488 | + |
| 489 | +nested_univ_uneq = pd.DataFrame(dtype=float) |
| 490 | +instance_list = [] |
| 491 | +for i in range(0, 10): |
| 492 | + instance_list.append(pd.Series(np.random.randn(20 + i))) |
| 493 | +nested_univ_uneq["channel0"] = instance_list |
| 494 | + |
| 495 | +UNEQUAL_LENGTH_UNIVARIATE = { |
| 496 | + "np-list": np_list_uneq, |
| 497 | + "df-list": df_list_uneq, |
| 498 | + "nested_univ": nested_univ_uneq, |
| 499 | +} |
| 500 | +np_list_multi = [] |
| 501 | +for _ in range(10): |
| 502 | + np_list_multi.append(np.random.random(size=(2, 20))) |
| 503 | +df_list_multi = [] |
| 504 | +for _ in range(10): |
| 505 | + df_list_multi.append(pd.DataFrame(np.random.random(size=(20, 2)))) |
| 506 | +multi = make_example_multi_index_dataframe( |
| 507 | + n_instances=10, n_channels=2, n_timepoints=20 |
| 508 | +) |
| 509 | + |
| 510 | +nested_univ_multi = pd.DataFrame(dtype=float) |
| 511 | +instance_list = [] |
| 512 | +for _ in range(0, 10): |
| 513 | + instance_list.append(pd.Series(np.random.randn(20))) |
| 514 | +nested_univ_multi["channel0"] = instance_list |
| 515 | +instance_list = [] |
| 516 | +for _ in range(0, 10): |
| 517 | + instance_list.append(pd.Series(np.random.randn(20))) |
| 518 | +nested_univ_multi["channel1"] = instance_list |
| 519 | + |
| 520 | + |
| 521 | +EQUAL_LENGTH_MULTIVARIATE = { |
| 522 | + "numpy3D": np.random.random(size=(10, 2, 20)), |
| 523 | + "np-list": np_list_multi, |
| 524 | + "df-list": df_list_multi, |
| 525 | + "nested_univ": nested_univ_multi, |
| 526 | + "pd-multiindex": multi, |
| 527 | +} |
0 commit comments