I'm trying to use FeatureUnion
to extract different features from a datastructure, but it fails due to different dimensions: ValueError: blocks[0,:] has incompatible row dimensions
Implementaion
My FeatureUnion
is built the following way:
features = FeatureUnion([
('f1', Pipeline([
('get', GetItemTransformer('f1')),
('transform', vectorizer_f1)
])),
('f2', Pipeline([
('get', GetItemTransformer('f2')),
('transform', vectorizer_f1)
]))
])
GetItemTransformer
is used to get different parts of data out of the same structure. The Idea is described here in the scikit-learn issue-tracker.
The Structure itself is stored as {'f1': data_f1, 'f2': data_f2}
where data_f1
are different lists with different lengths.
Question
Since the Y-Vector is different to the Data-Fields I assume that the error occurs, but how can I scale the vector to fit in both cases?
data_f1
anddata_f2
to the lenght ofdata_f2
and set the length of the Y-Vector todata_f2
– Goldsworthy