الانحدار اللوجستي لنعم أو لا
الاحتمالات وعتبات القرار
الانحدار اللوجستي لنعم أو لا درس مجاني في Data Science Academy على CoddyKit. هذا هو الدرس 1 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Data Science Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Data Science Academy 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
Classes, Not Numbers
Classification predicts a category, not a number. Will this email be spam or not? That yes-or-no answer is what we are after. ✉️
The Yes/No Workhorse
Logistic regression is the classic starting point for two-class problems. It is simple, fast, and surprisingly hard to beat.
It Outputs Probability
Despite its name, logistic regression returns a probability between 0 and 1, like a 0.82 chance this customer will churn.
The Sigmoid Squeeze
A curve called the sigmoid squeezes any value into the 0-to-1 range. That is how raw scores become clean probabilities.
Import and Create
You build it just like any estimator: import the class, then create the model object ready to learn.
from sklearn.linear_model import LogisticRegression
model = LogisticRegression()Train It With fit
Show it your features and labels with fit, and it learns the weights that separate the two classes.
model.fit(X_train, y_train)Predict the Label
Call predict to get the chosen class for each row, returning a clean 0 or 1 for every example.
labels = model.predict(X_test)Ask for the Probability
Want the raw confidence instead? predict_proba gives the probability of each class, so you see how sure the model is.
probs = model.predict_proba(X_test)The Decision Threshold
To turn a probability into a label, you compare it to a threshold, usually 0.5. Above it means yes, below it means no.
Move the Threshold
You can raise or lower that threshold on purpose. A stricter cutoff catches fewer cases but trusts each one more.
Read the Coefficients
Each feature gets a coefficient. A positive one pushes the prediction toward yes, a negative one toward no.
model.coef_Quick Check
Let's confirm what logistic regression actually hands back.
Recap
Logistic regression turns features into a probability, then a threshold decides yes or no. Simple, fast, and a great first classifier. 🎯
الأسئلة الشائعة
هل درس «الانحدار اللوجستي لنعم أو لا» مجاني؟
نعم — نص درس «الانحدار اللوجستي لنعم أو لا» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Data Science Academy، انتقل إلى CoddyKit PRO. تتضمن دورة Data Science Academy 4 دروس في المجموع.
ماذا ستتعلم في «الانحدار اللوجستي لنعم أو لا»؟
الاحتمالات وعتبات القرار تتمرن على Data Science Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ Data Science Academy؟
لا تُشترط خبرة سابقة. Data Science Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 1 من أصل 4.
كم من الوقت يستغرق درس «الانحدار اللوجستي لنعم أو لا»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس Data Science Academy هذا؟
نعم. كل درس في Data Science Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- الانحدار اللوجستي لنعم أو لا
- الجيران الأقرب k
- أشجار القرار والغابات العشوائية
- أساسيات Gradient Boosting