Logistic Regression
Despite its name, Logistic Regression is a classification algorithm, not regression. It's the foundation of classification and still widely used today.
From Linear to Logistic
Linear regression outputs any number. But classification needs probabilities (0 to 1).
The Sigmoid Function
The sigmoid function squashes any number to the range (0, 1) - perfect for probabilities!
How Logistic Regression Works
Logistic regression = linear combination + sigmoid function
The Decision Boundary
Training with Gradient Descent
Practice: Logistic Regression Prediction
Key Takeaways
- Logistic regression is for classification despite its name
- Uses the sigmoid function to output probabilities (0 to 1)
- Creates a linear decision boundary
- Threshold (usually 0.5) converts probability to class label
- Uses gradient descent with cross-entropy loss for training
- In sklearn:
LogisticRegression().fit(X, y).predict(X_new)
Next, we'll learn K-Nearest Neighbors - a completely different approach!
اختبار قصير
التالي · الدرس 16 من 35
K-Nearest Neighbors
قراءة 1 دقيقة
أنهيت 15 من 35 درسًا

اسأل Byte عن هذا الدرس
محادثة خاصة حول هذا الدرس. قرأ Byte الدرس كاملًا، ويجيب خلال ثوانٍ، ويُظهر القسم الذي تأتي منه كل إجابة. يمكنك السؤال بأي لغة.
الأسئلة والأجوبة
أسئلة عامة حول هذا الدرس. يجيب AI Tutor فورًا بلغتك، ويراجع فريق FreeAcademy الإجابات، ويمكن لكل المتعلمين قراءتها.

