sklearn datasets

Creating

here I have 2 data items, both numpy arrays. Itherefore join the two values together and apped them all into 1 list

#Make a list of the PixelData, and then cast back to np array
#Cast to float32 for keras
#However extend the Image array by 1, by adding a column in this column we will store the letter_number

DATA=[]
for  k in sorted(list(data.keys())):
    grey=np.array(data[k]['data'])
    lc=data[k]['letter_val']
    grey2=np.insert(grey, 0, values=[lc], axis=1)  
    DATA.append(grey2)

Or

```python num_classes = 26 from sklearn.model_selection import train_test_split

Make a list of the PixelData, and then cast back to np array

Cast to float32 for keras

DATA=np.array([ data[k]['data'] for k in sorted(list(data.keys()))]).astype('float32') TARGET=np.array([ data[k]['letter_val'] for k in sorted(list(data.keys()))]).astype('float32')

letter_data1, letter_data2, letter_target1, letter_target2 =train_test_split( DATA, TARGET, test_size=0.4, random_state=415) ```