If the unit worked well on a hot summers day, when it was near new...and cools but frosts after a period of operation now, the culprit is probably one of the following:
They're set too cold: AC units not suitable for meat or beer aging...
There's not enough air flow; and besides the filters, return air grille, supply air obstructions and so on, the other check is on fan condition, speed and similar.
The condensing temperature is too low, which happens to quite a few heat pumps in places like Boston: in effect, the capillary tube cannot pass refrigerant fast enough at the reduced inlet pressure; the suction pressure goes low and refrigerant backs up in the condensing coil until some portion of heat exchanger is crippled, raises condensing pressure but low side is now short on liquid refrigerant.
A blocked liquid line drier, causes same effects as above.
A shortage of refrigerant charge.
There are a couple of others, including poor air distribution...