I have a problem in the supervised classification output. The classification itself is giving any problem, but when I try to print or display the image I obtain this error:
Image (Error) Unable to use a collection in an algorithm that requires a feature or image. This may happen when trying to use a collection of collections where a collection of features is expected; use flatten, or map a function to convert inner collections to features. Use clipToCollection (instead of clip) to clip an image to a collection.
Here is the code: https://code.earthengine.google.com/9dae0afc574251bd102e81e10850dd82
I'm pretty sure that the problem is from line 103 to 128. Here I created a polygon from a raster, and set it as a FeatureCollection in order to set a class WATER with value = 1. If I use polygons created by giving the coordinates of nodes, I don't have this problem in the classification. I'll attach another link where I use polygons and don't have any problem: https://code.earthengine.google.com/6b03174ebd1c75a9281944c4a17c78b3
The problem is that I need to use the polygon from the raster and I have no clue how to solve this problem.