I will present a new automated procedure that simultaneously derives the effective temperature Teff , surface gravity log g, metallicity [F e/H], and equatorial projected rotational velocity for stars. It is based on a combination of the principal component analysis (PCA) inversion and the Slice inverse regression method (SIR). The efficiency and accuracy of this procedure have been tested for FGK, A , and late type dwarf stars of K and M spectral types. The learning databases are generated from observed and/or synthetic data. The synthetic spectra are calculated using SYNSPEC48 code and based on ATLAS9 model atmospheres. This technique helped us to detect many peculiar stars such as Am, Ap, HgMn, SiEuCr and binaries.