This is my first post at Cross Validated. I was having a doubt and hoped it can be cleared instead of stackoverflow.

Currently I'm working on a Predictive Model, which takes in server performance and classifies them weather there is an error in server or not. (Using RandomForest. Planning to change to NN).

My data is timeseries. Let us say our model predicts an error at t1 hours. When error is predicted, I take our feature score for that predictor. The top features are largest influencer for prediction. So, when error is predicted since I've to send out alert to support teams, I needed some more information for them to work on.

I was thinking of implementing something like this: Lets say when error is predicted, (Label = 1), we take out top 3 features (x, y, z). We then make it blank(consider missing). I've a trained RF model which was used to make predictions. Is it possible in any way to calculate expected values of x,y,z from trained model, if Label was specified?

It is something like backpropogation. Estimating values of missing features (x,y,z) if Label is given(=0. i.e. expected value for no error) and some features are given? (n:total features. Given : n-3 features).

I was thinking of implementing Regression separately on each feature, but that seems like tedious work, plus every feature fitting into regressor isnt a guarantee.

It is something like this following equation in lay man words.: eqn : 2a+3b+c+9x+10y+30z^2 = output. Given : a, b, c, output. Given : Trained model Calculate : x, y, z.

Equation, of algorithms, or anything to guide me in right way will be really helpful. I'm working on python. Any help will be greatly appreciated. Thanks in advance,

PS : If any doubt, or any issues with question, kindly post it in comments, so that I can edit the question. This is my 1st post here. Thanks.


1 Answer 1


I think you're asking for a conditional expectation of your label as a function of the features. In any classic regression framework this would be a reasonably straightforward exercise using the model coefficients and whether or not a feature was "on" or "off." In the context of RFs, since the predictions aren't based on a single "model" but represent an aggregated value over many, many "mini-models" -- in other words, the label prediction's relationship with a feature is no longer a simple 0, 1. Your description of a possible solution sounds like it is based on an unconditional arithmetic average and ranking of the "importance" of the features given the prediction, which isn't terribly insightful.

You didn't say it, but I think I understand why you're using RFs -- you have too many features to fit into a reductionistic, statistical model.

My opinion is that you're going to have to switch out of RFs to a different modeling framework to do what you want to do, but I could be wrong and would be interested in hearing other posters workarounds to an RF-based solution to the OPs question.

  • $\begingroup$ Hi, Something of that sort. I m expecting expected value of feature so that I get a particular label as output. In my case, if label classified is 1, what should be values of top features so that my label will be 0, and not 1. I meant that. Regarding RF, I have unbalanced dataset. (1:110 initially. Now 1:20). Though I'm open to other models, and I am currently playing around with NN. Any model which can help me find expected value of missing features, I'm open to implementing those. $\endgroup$ Oct 29, 2015 at 13:36
  • $\begingroup$ So, you have 1 observation for 20 features? How big is nxp, in total? $\endgroup$ Oct 29, 2015 at 13:52
  • $\begingroup$ No, I meant class ratio in dataset. Current dataset: Features : 66 Rows : 14k approx. Class 1 Label : 500 Class 0 Label : 13.5k. Class ratio : 1:27. $\endgroup$ Oct 29, 2015 at 14:02
  • $\begingroup$ Check out David Dunson's paper on Bayesian Tensor Regression on his website at Duke... researchgate.net/profile/David_Dunson/publications He's developed an approach designed for genome mapping when n is small and p is massive. $\endgroup$ Oct 29, 2015 at 14:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.