  We present the first unsupervised classification of spaxels in hyperspectral
images of individual galaxies. Classes identify regions by spectral similarity
and thus take all the information into account that is contained in the data
cubes (spatial and spectral).We used Gaussian mixture models in a latent
discriminant subspace to find clusters of spaxels. The spectra were corrected
for small-scale motions within the galaxy based on emission lines with an
automatic algorithm. Our data consist of two MUSE/VLT data cubes of JKB 18 and
NGC 1068 and one NIRSpec/JWST data cube of NGC 4151.Our classes identify many
regions that are most often easily interpreted. Most of the 11 classes that we
find for JKB 18 are identified as photoionised by stars. Some of them are known
HII regions, but we mapped them as extended, with gradients of ionisation
intensities. One compact structure has not been reported before, and according
to diagnostic diagrams, it might be a planetary nebula or a denser HII region.
For NGC 1068, our 16 classes are of active galactic nucleus-type (AGN) or
star-forming regions. Their spatial distribution corresponds perfectly to
well-known structures such as spiral arms and a ring with giant molecular
clouds. A subclassification in the nuclear region reveals several structures
and gradients in the AGN spectra. Our unsupervised classification of the MUSE
data of NGC 1068 helps visualise the complex interaction of the AGN and the jet
with the interstellar medium in a single map. The centre of NGC 4151 is very
complex, but our classes can easily be related to ionisation cones, the jet, or
H2 emission. We find a new elongated structure that is ionised by the AGN along
the N-S axis perpendicular to the jet direction. It is rotated counterclockwise
with respect to the axis of the H2 emission. Our work shows that the
unsupervised classification of spaxels takes full advantage of the richness of
the information in the data cubes by presenting the spectral and spatial
information in a combined and synthetic way.
