```
def classify(self, texts):
vectors = self.dictionary.feature_vectors(texts)
predictions = self.svm.decision_function(vectors)
predictions = np.transpose(predictions)[0]
predictions = predictions / 2 + 0.5
predictions[predictions > 1] = 1
predictions[predictions < 0] = 0
return predictions
```

The error:

```
TypeError: 'numpy.float64' object does not support item assignment
```

occurs on the following line:

```
predictions[predictions > 1] = 1
```

Does anyone has an idea of solving this problem? Thanks!

## Best Solution

Try this testing code and pay attention to

`np.array([1,2,3], dtype=np.float64)`

. It seems self.svm.decision_function(vectors) returns1darray instead of 2d. If you replace [1,2,3] to [[1,2,3], [4,5,6]] everything will be ok.Output:

So, what your vectors are?