The problem that you are describing can be solved by *latent class regression*, or *cluster-wise regression*, or it's extension *mixture of generalized linear models* that are all members of a wider family of *finite mixture models*, or *latent class models*. It's not a combination of classification (supervised learning) and regression *per se*, but rather of clustering (unsupervised learning) and regression. The basic approach can be extended so that you predict the class membership using concomitant variables, what makes it even closer to what you are looking for. In fact, using latent class models for classification was described by Vermunt and Magidson (2003) who recommend it for such pourpose. ### Latent class regression This approach is basically a [*finite mixture model*][1] (or *latent class analysis*) in form $$ f(y \mid x, \psi) = \sum^K_{k=1} \pi_k \, f_k(y \mid x, \vartheta_k) $$ where $\psi = (\boldsymbol{\pi}, \boldsymbol{\vartheta})$ is a vector of all parameters and $f_k$ are mixture components parametrized by $\vartheta_k$, and each component appears with latent proportions $\pi_k$. So the idea is that the distribution of your data is a mixture of $K$ components, each that can be described by a regression model $f_k$ appearing with probability $\pi_k$. Finite mixture models are very flexible in the choice of $f_k$ components and can be extended to other forms and mixtures of different classes of models (e.g. mixtures of factor analyzers). ### Predicting probability of class memberships based on concomitant variables The simple *latent class regression* model can be extended to include concomitant variables that predict the class memberships (Dayton and Macready, 1998; see also: Linzer and Lewis, 2011; Grun and Leisch, 2008; McCutcheon, 1987; Hagenaars and McCutcheon, 2009), in such case the model becomes $$ f(y \mid x, w, \psi) = \sum^K_{k=1} \pi_k(w, \alpha) \, f_k(y \mid x, \vartheta_k) $$ where again $\psi$ is a vector of all parameters, but we include also concomitant variables $w$ and a function $\pi_k(w, \alpha)$ (e.g. logistic) that is used to predict the latent proportions based on the concomitant variables. So you can first predict the probability of class memberships and estimate the cluster-wise regression within a single model. ### Pros and cons What is nice about it, is that it is a *model-based clustering* technique, what means that you fit models to your data, and such models can be compared using different methods for model comparison (likelihood-ratio tests, BIC, AIC etc.), so the choice of final model is not that subjective as with cluster analysis in general. Braking the problem into two independent problems of clustering and then applying regression can lead to biased results and estimating everything within a single model enables you to use your data more efficiently. The downside is that you need to make a number of assumptions about your model and have some thought about it, so it's not a black-box method that will simply take the data and return some result without bothering you about it. With noisy data and complicated models you can also have model identifability issues. Also since such models are not that popular, there are not widely implemented (you can check great R packages `flexmix` and `poLCA`, as far as I know it is also implemented in SAS and Mplus to some extent), what makes you software-dependent. ### Example Below you can see example of such model from [`flexmix` library][2] (Leisch, 2004; Grun and Leisch, 2008) vignette fitting mixture of two regression models to made-up data. <!-- language-all: lang-r --> library("flexmix") data("NPreg") m1 <- flexmix(yn ~ x + I(x^2), data = NPreg, k = 2) summary(m1) ## ## Call: ## flexmix(formula = yn ~ x + I(x^2), data = NPreg, k = 2) ## ## prior size post>0 ratio ## Comp.1 0.506 100 141 0.709 ## Comp.2 0.494 100 145 0.690 ## ## 'log Lik.' -642.5452 (df=9) ## AIC: 1303.09 BIC: 1332.775 parameters(m1, component = 1) ## Comp.1 ## coef.(Intercept) 14.7171662 ## coef.x 9.8458171 ## coef.I(x^2) -0.9682602 ## sigma 3.4808332 parameters(m1, component = 2) ## Comp.2 ## coef.(Intercept) -0.20910955 ## coef.x 4.81646040 ## coef.I(x^2) 0.03629501 ## sigma 3.47505076 It is visualized on the following plots (points shapes are the true classes, colors are the classifications). [![Example of latent class regression][3]][3] ### References and additional resources For further details you can check the following books and papers: > Wedel, M. and DeSarbo, W.S. (1995). [A Mixture Likelihood Approach for > Generalized Linear Models.][4] *Journal of Classification , 12*, > 21–55. > > Wedel, M. and Kamakura, W.A. (2001). *Market Segmentation – Conceptual > and Methodological Foundations.* Kluwer Academic Publishers. > > Leisch, F. (2004). [Flexmix: A general framework for finite mixture > models and latent glass regression in R.][5] *Journal of Statistical > Software, 11(8)*, 1-18. > > Grun, B. and Leisch, F. (2008). [FlexMix version 2: finite mixtures > with concomitant variables and varying and constant parameters.][6] > *Journal of Statistical Software, 28(1)*, 1-35. > > McLachlan, G. and Peel, D. (2000). *Finite Mixture Models.* John Wiley & Sons. > > Dayton, C.M. and Macready, G.B. (1988). Concomitant-Variable > Latent-Class Models. *Journal of the American Statistical Association, > 83*(401), 173-178. > > Linzer, D.A. and Lewis, J.B. (2011). [poLCA: An R package for > polytomous variable latent class analysis.][7] *Journal of Statistical > Software, 42*(10), 1-29. > > McCutcheon, A.L. (1987). *Latent Class Analysis.* Sage. > > Hagenaars J.A. and McCutcheon, A.L. (2009). *Applied Latent Class > Analysis.* Cambridge University Press. > > Vermunt, J.K., and Magidson, J. (2003). [Latent class models for > classification.][8] *Computational Statistics & Data Analysis, 41*(3), > 531-537. > > Grün, B. and Leisch, F. (2007). [Applications of finite mixtures of > regression models.][9] flexmix package vignette. > > Grün, B., & Leisch, F. (2007). [Fitting finite mixtures of generalized > linear regressions in R.][10] Computational Statistics & Data > Analysis, 51(11), 5247-5252. [1]: http://stats.stackexchange.com/questions/130805/are-there-any-non-distance-based-clustering-algorithms/130810#130810 [2]: https://cran.r-project.org/package=flexmix [3]: https://i.sstatic.net/ntC6i.png [4]: https://www.researchgate.net/profile/Wayne_Desarbo/publication/226342466_A_mixture_likelihood_approach_for_generalized_linear_models/links/0deec51a7c223876e0000000.pdf [5]: https://www.jstatsoft.org/article/view/v011i08 [6]: https://www.jstatsoft.org/article/view/v028i04 [7]: https://www.jstatsoft.org/article/view/v042i10 [8]: https://www.statisticalinnovations.com/wp-content/uploads/Vermunt2003_csda.pdf [9]: https://cran.r-project.org/web/packages/flexmix/vignettes/regression-examples.pdf [10]: https://pdfs.semanticscholar.org/be32/9f22cb7425a4fa7126bc3fc6296914a1dcf7.pdf