Hierarchical in-network attribute compression via importance sampling