Dealing with spam can be tough. It depends on two main factors.
First, is the type of spam you're dealing with throwable? Turnips, lasers, items, etc. If it is, you're in luck. Jab, forward tilt, and back aerial stop almost all forms of projectile spam in the game (lasers omitted, unfortunately). Neutral air stops Din's Fire and Snake's mortar among other things. You can DR into items like turnips, bananas, and gyros and pick them up for free laglessly (as opposed to using a dash attack). As you can see, you have lots of options here. Beating projectile spam like this comes in two phases: dodging the projectile and counterspamming. One may immediately think to throw an egg after your first successful dodge. This can sometimes work out well, but is usually not the best answer. The safest and most intimidating way to counterspam is to cancel out the projectile, if possible (this shows that you can safely stand your ground without becoming vulnerable by shielding, rolling, or spotdodging, etc.), and then to continue doing it for a very short while. After a few good cancels, spot an opening for an egg and if you can nail it (and if your opponent is paying any attention), your opponent will realize that they just spent twenty seconds throwing stuff at you and you stood your ground, took no damage, and dealt 11% in an instant. This tactic makes projectile spam a little less of a go-to option for your opponent and takes some of the burden of being patient and precise off of your shoulders.
Maybe the type of spam is move spam? This is the most difficult to overcome. Snake forward tilt, Meta Knight downsmash, etc. are all very common types of move spam. The best way to counteract this is to first make the decision to not get hit. I'm not patronizing you, but it's a real decision many players never come to and it's why they lose to move spam so much. Once you've decided that you shouldn't get hit by the same junk over and over, begin to float outside of your opponent's range and observe them and what triggers their decision to use certain moves. Actually, I covered a lot of this in my topic: Mah **** Don't Stank. If you can find that in the Yoshi boards, I've covered a good deal of this information there. If it doesn't have what you're looking for, ask me again in more detail and I'll try to help.
On the topic of predictability, it's a barrier all players are constantly working to overcome. I, myself, after just getting over a huge deep rut of predictable tactics, have just hit another brick wall this past weekend that kept me out of top three at my regional. Noticing it, I've been working to see what I can do to abuse my opponents without training them to expect the correct reaction from me; training your opponents to expect a certain something is difficult, and the really hard part is that most times, you are going to actually have to deliver on what they're expecting you to do in order for them to keep expecting it. The difficulty IN THAT is that you need to do this when your opponent is forced into a situation where they can do nothing about it. For instance, at 0%, many of my opponents can expect a back aerial to forward tilt to up tilt to up aerial. This does an easy 42% and DI cannot save them. If they shield, however, I can try to take advantage of the fact that I know their shield will stay up or that they will spotdodge out of it (in anticipation of the forward tilt). Simple things like this. Predictability is also built into some characters. For Yoshi, some parts are his egg recovery, double jump air dodge, really REALLY obvious grab setups, down+B onto the ledge (this is a big one, surprisingly), etc. One of the best ways to combat this is to just use the character-specific techniques when it's safest; not much outside of that that you can do. Finally, predictability just comes as part of your attitude. That is to say, if your attitude toward your opponent is something like, "I'ma do this particular move for this particular situation that I've already got plotted out in my head," you are more likely to fall into your own rut than you are to take advantage of your opponent. If your attitude is, "I'ma beat some @$$," then you lose a good deal of predictability just due to the sheer ambiguity of your goal: beating @$$. It's what I like to call "textbook." When people play the golden bylaws of their character/region, you can very clearly expect what they'll do beforehand. When they fight you with something all their own, however, it's harder to fight them and much of this stuff is homegrown mindgames...something nobody can really teach you.
Sorry if all of this seemed general or unhelpful. If you still want help, let me know and ask me in more detail and I'll try to help as much as I can.