Beginner-Friendly Topic
Take your time - it's perfectly normal to re-read this topic 2-3 times. Try the interactive code editor below to run code yourself. Use the Q&A section to check your understanding before moving on.You've got this!
Practice: ML Algorithm Selection
Practice identifying the type of machine learning for different real-world problems.
12 min•By Priygop Team•Updated 2026
Practice: ML Type Classifier
Practice: ML Type Classifier
# Practice: classify AI problems by their ML approach
problems = [
{
"name": "Credit card fraud detection",
"has_labels": True,
"output_type": "category",
"data_type": "tabular",
},
{
"name": "Group website visitors into segments",
"has_labels": False,
"output_type": "groups",
"data_type": "tabular",
},
{
"name": "Classify photos as indoor or outdoor",
"has_labels": True,
"output_type": "category",
"data_type": "images",
},
{
"name": "Train a robot to pick up objects",
"has_labels": False,
"output_type": "actions",
"data_type": "sensor_data",
},
{
"name": "Predict tomorrow's temperature",
"has_labels": True,
"output_type": "number",
"data_type": "tabular",
},
]
def recommend_approach(problem):
if not problem["has_labels"] and problem["output_type"] == "actions":
return "Reinforcement Learning"
elif not problem["has_labels"]:
return "Unsupervised Learning"
elif problem["data_type"] == "images":
return "Supervised Deep Learning (CNN)"
elif problem["output_type"] == "category":
return "Supervised Classification (ML)"
elif problem["output_type"] == "number":
return "Supervised Regression (ML)"
return "Needs more information"
print("Problem -> Recommended ML Approach")
print("=" * 60)
for problem in problems:
approach = recommend_approach(problem)
print(f" {problem['name']}")
print(f" -> {approach}")
print()Diagram
Loading diagram…
Educational visual guide for practice ml algorithm selection.