This could be implemented as (untested):

```python
if all(isinstance(c, int) for c in classes):
    dtype = np.int
else:
    dtype = object
self.classes_ = np.asarray(classes, dtype=dtype)
```