def test_padding_fill_value_transformer(): """Test full fill padding.""" # load data X_train, y_train = load_basic_motions(split="train", return_X_y=True) padding_transformer = PaddingTransformer(pad_length=120, fill_value=1) Xt = padding_transformer.fit_transform(X_train) # when we tabularize the data it has 6 dimensions # and we've padded them all to 120 long. data = from_nested_to_2d_array(Xt) assert len(data.columns) == 120 * 6
def test_padding_fill_value_transformer(): # load data name = "JapaneseVowels" X_train, y_train = _load_dataset(name, split="train", return_X_y=True) X_test, y_test = _load_dataset(name, split="test", return_X_y=True) # print(X_train) padding_transformer = PaddingTransformer(pad_length=40, fill_value=1) Xt = padding_transformer.fit_transform(X_train) # when we tabulrize the data it has 12 dimensions # and we've truncated them all to (10-2) long. data = from_nested_to_2d_array(Xt) assert len(data.columns) == 40 * 12
def test_padding_transformer(): # load data name = "JapaneseVowels" X_train, y_train = _load_dataset(name, split="train", return_X_y=True) X_test, y_test = _load_dataset(name, split="test", return_X_y=True) # print(X_train) padding_transformer = PaddingTransformer() Xt = padding_transformer.fit_transform(X_train) # when we tabulrize the data it has 12 dimensions # and we've padded them to there normal length of 29 data = from_nested_to_2d_array(Xt) assert len(data.columns) == 29 * 12
def test_missing_unequal_tag_inference(): """Test that ClassifierPipeline infers missing/unequal tags correctly.""" c = KNeighborsTimeSeriesClassifier() c1 = ExponentTransformer() * PaddingTransformer() * ExponentTransformer( ) * c c2 = ExponentTransformer() * ExponentTransformer() * c c3 = Imputer() * ExponentTransformer() * c c4 = ExponentTransformer() * Imputer() * c assert c1.get_tag("capability:unequal_length") assert not c2.get_tag("capability:unequal_length") assert c3.get_tag("capability:missing_values") assert not c4.get_tag("capability:missing_values")
def test_missing_unequal_tag_inference(): """Test that TransformerPipeline infers missing/unequal tags correctly.""" t1 = ExponentTransformer() * PaddingTransformer() * ExponentTransformer() t2 = ExponentTransformer() * ExponentTransformer() t3 = Imputer() * ExponentTransformer() t4 = ExponentTransformer() * Imputer() assert t1.get_tag("capability:unequal_length") assert t1.get_tag("capability:unequal_length:removes") assert not t2.get_tag("capability:unequal_length:removes") assert t3.get_tag("handles-missing-data") assert t3.get_tag("capability:missing_values:removes") assert not t4.get_tag("handles-missing-data") assert not t4.get_tag("capability:missing_values:removes")