Federal Reserve Chairwoman Janet Yellen talks with Ed Wasserman, dean of UC Berkeley’s journalism school, at the Commonwealth Club event. Photo: Liz Hafalia, The Chronicle

Days before Donald Trump will be sworn in as president, Federal Reserve Chairwoman Janet Yellen started and ended a speech in San Francisco Wednesday by saying that the central bank does not favor one party over another.

Speaking before a packed house at the Herbst Theater, Yellen said the Fed is “nonpartisan and focused squarely on the public interest.”

During the campaign, Trump made comments suggesting that Yellen and the Fed were trying to make President Obama look good by keeping interest rates artificially low.

Yellen did not address such comments directly, but in a question-and-answer session said, “I have never had a situation where a member of the administration has tried in any way to pressure me for any reason about the stance of monetary policy.” She does, however, have breakfast or lunch almost weekly with Treasury Secretary Jack Lew to discuss areas where they share a common interest, such as banking regulation and the success of the U.S. economy.

She ended her speech, sponsored by the Commonwealth Club, by saying that the Fed’s structure “insulates us from short-term political pressures so we can focus on what’s best for the American economy in the longer run.”

Trump and his transition team have threatened to “dismantle Dodd-Frank,” the law that imposed sweeping regulations on U.S. banks after the financial crisis.

In response to audience questions, Yellen defended the need for heightened regulation, especially the stepped-up capital and liquidity requirements of banks deemed too…