It certainly looks like a yucca and if so it definitely should not shed its leaves. They dont look particularly yellow from the picture you have posted so it doesn't look as if it has been over-watered. Have you moved it recently? If so it just might not like its new location. If it was flourishing before, move it back to where it was. Bear in mind It wont like being in a draught either! If it continues to lose its leaves, there is nothing you can do - get rid and get a new one taking care where you place it. Good luck from Ladywoman!