In this paper, we consider the problem of efficiently estimating a conditional expectation. By formulating the conditional expectation as a ratio of two derivatives, we can apply the generalized likelihood ratio method to express the conditional expectation using ordinary expectations with indicator functions, which generalizes the conditional density method. Based on an empirical distribution estimated from simulation, we provide guidance on selecting the appropriate formulation of the derivatives to reduce the variance of the estimator.