Peel the sweet potato and grate finely. Place the sweet potato in a kitchen towel and squeeze all the excess liquid. Add the diced onion and garlic, along with the eggs, flour, oil, spices and mix together well.
Heat oil in a large pan, add spoonfuls of sweet potato mixture and fry in batches. Fry on both sides until golden brown.