I have already saved a model as my_model.h5
. I have 7
classes in it which are
array(['Drums Beating', 'Machine Digging', 'Man Movement',
'Manual Digging', 'Manual Digging - Deeper (1.5 to 3 feets)',
'Normal', 'Tunneling'], dtype=object)
Now I have to train a model with only one class(suppose 'drums beating')
. So i will initialise weights of the new training model with old weights. So when I need to encode my label (say drums beating
), How can I encode it such that it has a dummy value([0,0,0,1,0,0,0])
as when I trained previously.
To make it clear, earlier dummy value of drums beating is [0,0,0,1,0,0,0]
.But when I load encoder as follows
with open('/home/ANN_Unrolled_30_sample_7_class/ANN_UNrolled_sample_30_7_class.pkl', 'rb') as f:
encoder = pkl.load(f)
and apply encode.transform
,it becomes [0]
only as there is only one class in new training model.What can I do to get the previous dummy itself([0,0,0,1,0,0,0]]
If I have over emphasised or under emphasised sth,please let me know in the comments.