The Lovasz theta function is a semidefinite programming (SDP) relaxation for the maximum weighted stable set problem, which is tight for perfect graphs. However, even for perfect graphs, there is no known rounding method guaranteed to extract a maximum weighted stable set from the SDP solution. In this paper, we develop a novel rounding scheme for the theta function that constructs a value function approximation from the SDP solution and then generates a stable set using dynamic programming. Our method provably recovers a maximum weighted stable set in several sub-classes of perfect graphs, including generalized split graphs, which asymptotically cover almost all perfect graphs. To the best of our knowledge, this is the only known rounding strategy for the theta function that recovers a maximum weighted stable set for large classes of perfect graphs. Our rounding scheme relies on simple linear algebra computations; we only solve one SDP. In contrast, existing methods that leverage the theta function require solving multiple SDPs. Computational experiments show that our method produces good solutions even on imperfect graphs.