So my roommate (who is also my good friend) got this cat before I moved in when she was around 4 months old. I moved in when she was five months old and instantly we shared a bound and she basically became mine. I've spent the last 4 months being the one to feed her, play with her, take care of her litter box, and give her attention and cuddles/pettings. However the other day she randomly started attacking me (and not her playful play with me swipes full on growling and hissing trying to hurt me attacks). She doesn't do this to anyone else but me and they'll be completely unprovoked.
For instance I gave her some pettings and cuddles just a bit ago and then put her down so I could get ready for bed and about 5 minutes after putting her down she went psycho on me! Thankfully I wear thick pants so she didn't leave a mark on me (besides mentally). I'm afraid a vet may put her down, and she's so young! I'm just unsure what to do, she was perfectly fine and lovable a week ago. Usually after one of these attacks I have to carefully pick her up and put her in a room alone/ close the door to separate her (and the whole time I'm holding her she'll hiss and growl and try to swipe/get at me). After being alone and having time to cool down for 15-20 minutes she'll be perfectly loveable and let me approach and pet her and she'll get all affectionate. I'm just so confused and distressed right now and am unsure what I did to cause this borderline psychotic behavior. Like I said she leaves every one else alone, she only seems to target me. Even when she's still in a mood and will his/growl/swipe and bite at me if anyone else approaches her she'll be fine and let them pet her and be affectionate with them.