0

I try to use neurolab to classyfing dataset, but I got error 'AssertionError', for now my code is

names = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k']
dataset = pandas.read_csv('./glass.data', sep= ',', names = names)
# dataset = np.genfromtxt('./glass.data', delimiter=',')
Y = np.array(dataset['k'].values)
del dataset['k']
del dataset['a']
X = np.array(dataset.values)
multilayer = neuro.net.newff([[1, 7]], [10, 1])
multilayer.trainf = neuro.train.train_gd

error = multilayer.train(X, Y, epochs = 1000, show = 100, goal = 0.01)

where Y is class and X is attributes (I would split into train and test later). my X contain data:

[[ 1.52101 13.64     4.49    ...  8.75     0.       0.     ]
 [ 1.51761 13.89     3.6     ...  7.83     0.       0.     ]
 [ 1.51618 13.53     3.55    ...  7.78     0.       0.     ]
 ...
 [ 1.52065 14.36     0.      ...  8.44     1.64     0.     ]
 [ 1.51651 14.38     0.      ...  8.48     1.57     0.     ]
 [ 1.51711 14.23     0.      ...  8.62     1.67     0.     ]]

I tried also with reshape on X and Y and this also doesn't working, if someone want to look on whole dataset here is link: https://archive.ics.uci.edu/ml/machine-learning-databases/glass/

Lukasz
  • 63
  • 8
  • Can you post the full stack trace? That way it's clear to see where `AssertionError` is being raised – C.Nivs Jan 26 '20 at 18:40
  • `Y = np.array(dataset['k'].values)` ? Just use `dataset['k'].to_numpy()` or `np.array(dataset['k'])? – AMC Jan 26 '20 at 20:46
  • check the shape of `X` maybe doing `X=np.array(dataset.values)` don't produce the shape you are looking for – Shubham Shaswat Jan 27 '20 at 18:28

0 Answers0