Method implemented to transform data from db to feature vector. Also method to query data from db edited