ad_hoc_data(…) resulting in test_input as an array instead of a dictionary

Solution for ad_hoc_data(…) resulting in test_input as an array instead of a dictionary
is Given Below:

  • qiskit version : 0.18.0
  • numpy version : 1.21.1
  • qiskit_machine_learning version : 0.2.0
  • qiskit.aqua version : 0.9.4

I am trying to run a simple code as described in Qiskit’s tutorial on Machine Learning.

feature_dim=2
training_dataset_size=20
testing_dataset_size=10
random_seed=10598
shots=10000

sample_Total,training_input,test_input,class_labels = 
ad_hoc_data(training_size=training_dataset_size,
                                                               test_size=testing_dataset_size,
                                                               gap=0.3,
                                                               n=feature_dim,
                                                               plot_data=True)
datapoints,class_to_label=split_dataset_to_data_and_labels(test_input)

But I receive the error

AttributeError                            Traceback (most recent call last)
<ipython-input-11-f11e4f763266> in <module>
     10                                                                n=feature_dim,
     11                                                                plot_data=True)
---> 12 datapoints,class_to_label=split_dataset_to_data_and_labels(test_input)
   

~anaconda3libsite-packagesqiskitaquautilsdataset_helper.py in split_dataset_to_data_and_labels(dataset, class_names)
     83     labels = []
     84     if class_names is None:
---> 85         sorted_classes_name = sorted(list(dataset.keys()))
     86         class_to_label = {k: idx for idx, k in enumerate(sorted_classes_name)}
     87     else:

AttributeError: 'numpy.ndarray' object has no attribute 'keys'

By which I assume (and checked by printing it) that ad_hoc_data(...) is resulting in test_input in numpy.ndarray type as opposed to the expected dict type.

Is there something trivial I’m missing here or is there an actual issue with the code?

Thanks in advance