Skip to content
Home Tutorials Roadmaps Courses
Log in Join free
Tutorials AI Ethics in AI
AI Intermediate FREE

Ethics in AI

Lesson 1 of 17 Intermediate Interactive

AI raises important ethical questions about bias, privacy, and accountability.

Key Concerns

  • Bias in training data
  • Privacy and surveillance
  • Job displacement
  • Deepfakes and misinformation
  • Autonomous weapons
Bias Detection in Data
PYTHON
# Checking for data bias
data = {
    "approved": {"male": 80, "female": 60},
    "rejected": {"male": 20, "female": 40}
}

total_male = data["approved"]["male"] + data["rejected"]["male"]
total_female = data["approved"]["female"] + data["rejected"]["female"]

approval_rate_male = data["approved"]["male"] / total_male
approval_rate_female = data["approved"]["female"] / total_female

print(f"Male approval rate: {approval_rate_male:.1%}")
print(f"Female approval rate: {approval_rate_female:.1%}")

diff = abs(approval_rate_male - approval_rate_female)
print(f"Disparity: {diff:.1%}")
if diff > 0.1:
    print("Warning: Potential bias detected!")

Practice

1
Exercise

Practice this concept.

Answer
Write the code as shown above.

Quick Quiz

1

What did you learn?

This covers the basics.

Interview Questions

It is a fundamental AI feature.