0Pricing
Data Science Academy · درس

قيّم نموذجك الأول

قراءة طريقة score في النموذج

قيّم نموذجك الأول درس مجاني في Data Science Academy على CoddyKit. هذا هو الدرس 4 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Data Science Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Data Science Academy 4 دروس في المجموع.

بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.

Is It Any Good?

Training a model is only half the job. Next you ask the real question: how well does it actually predict? 🧐

The score Method

Every estimator offers a score method that returns a single number summarizing performance. One call, one quick verdict.

model.score(X_test, y_test)

Score Needs Truth

You pass both features and the real answers, so score can compare its predictions against what truly happened.

What Regression Reports

For regressors, score returns R squared: the fraction of the target's variation your model manages to explain.

Reading R Squared

An R squared of 1.0 is a perfect fit and 0.0 is no better than guessing the mean. Higher is better, and it can even go negative.

Test, Don't Reuse Training

Always score on data the model never saw. A great training score with a poor test score is the classic sign of overfitting.

Beyond the Built-In

For finer detail, the metrics module offers many measures. You compare true and predicted values directly with a chosen function.

from sklearn.metrics import mean_absolute_error

Average Error in Units

Mean absolute error tells you the typical miss in the target's own units. It is wonderfully easy to explain to anyone.

mean_absolute_error(y_test, y_pred)

Classifiers Score Differently

For classifiers, the score method returns accuracy: the share of labels predicted correctly. Same method name, different meaning.

One Number Is a Start

A single metric never tells the whole story. Pair it with plots and several measures before you trust a model.

Compare to a Baseline

A score only means something next to a baseline, like always predicting the mean. Beat that simple guess to prove real value.

Quick Check

What does score return for a regression model?

Recap

Use score for a fast R squared, reach for metrics like MAE for detail, and always test on unseen data versus a baseline. 🏁

الأسئلة الشائعة

هل درس «قيّم نموذجك الأول» مجاني؟

نعم — نص درس «قيّم نموذجك الأول» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Data Science Academy، انتقل إلى CoddyKit PRO. تتضمن دورة Data Science Academy 4 دروس في المجموع.

ماذا ستتعلم في «قيّم نموذجك الأول»؟

قراءة طريقة score في النموذج تتمرن على Data Science Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.

هل أحتاج إلى خبرة سابقة لأبدأ Data Science Academy؟

لا تُشترط خبرة سابقة. Data Science Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 4 من أصل 4.

كم من الوقت يستغرق درس «قيّم نموذجك الأول»؟

معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.

هل يمكنني كتابة وتشغيل أكواد في درس Data Science Academy هذا؟

نعم. كل درس في Data Science Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.

جميع الدروس في هذه الدورة

  1. عقد fit وpredict
  2. الميزات X والهدف y
  3. تدريب انحدار خطي
  4. قيّم نموذجك الأول
← العودة إلى Data Science Academy