Skillpedia
تعلّم الآلة51k · #3578

statsmodels

ما الذي تفعله

تساعد هذه المهارة على تحليل البيانات باستخدام النماذج الإحصائية. يمكنها التنبؤ بالنتائج واختبار الفرضيات والتحقق من مدى ملاءمة النموذج لبياناتك.

متى تستخدمها

  • ✓عندما تريد فهم العلاقة بين المتغيرات.
  • ✓عندما تحتاج إلى التنبؤ بقيمة مستقبلية استناداً إلى البيانات التاريخية.
  • ✓عندما تريد اختبار ما إذا كانت فرضية حول بياناتك صحيحة.

رابط المهارة

https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/statsmodels/SKILL.md

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/statsmodels/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“حلّل مجموعة بيانات المبيعات هذه وتنبأ بالمبيعات للشهر القادم.”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

تزوّد المهارة ببياناتك وتختار نوعاً من النماذج الإحصائية. ثم تحسب المهارة نتائج النموذج وتعطيك ملخصاً مفصلاً.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

Statsmodels: Statistical Modeling and Econometrics

Overview

Statsmodels provides estimation, inference and diagnostics for regression, time series and econometric models. A successful fit establishes numerical execution; causal identification, calibrated uncertainty and model adequacy require a defensible study design and assumptions.

Current Compatibility

Reviewed against statsmodels 0.15.0 (released August 27, 2026). Native checks used Python 3.13, NumPy 2.5.3, SciPy 1.18.1, pandas 3.0.6, matplotlib 3.11.2 and scikit-learn 1.9.1. Install in a dedicated environment:

uv pip install statsmodels==0.15.0 numpy==2.5.3 scipy==1.18.1 pandas==3.0.6 matplotlib==3.11.2 scikit-learn==1.9.1

Use statsmodels.api and statsmodels.formula.api for stable high-level imports, and direct module imports when examples require newer or specialized classes such as HurdleCountModel.

The review and source ledger records API coverage and verification limits. The quick start is executable; topic references are contextual fragments requiring the named data and a matching model result. In 0.15, use result_object=True and named fields for ADF/KPSS and other transitioning tests; prefer rng= where statsmodels formerly accepted seed or random_state.

When to Use This Skill

This skill should be used when:

  • Fitting regression models (OLS, WLS, GLS, quantile regression)
  • Performing generalized linear modeling (logistic, Poisson, Gamma, etc.)
  • Analyzing discrete outcomes (binary, multinomial, count, ordinal)
  • Conducting time series analysis (ARIMA, SARIMAX, VAR, forecasting)
  • Running statistical tests and diagnostics
  • Testing model assumptions (heteroskedasticity, autocorrelation, normality)
  • Detecting outliers and influential observations
  • Comparing models (AIC/BIC, likelihood ratio tests)
  • Estimating causal effects
  • Producing publication-ready statistical tables and inference

Quick Start, Capabilities, and Model Selection

statsmodels supports inference and prediction, including forecasting. Match validation to the sampling design: grouped splits for repeated units, chronological splits for time series, and preprocessing learned on training data only.

Best Practices

Data Preparation

  1. Specify the intercept: Array OLS/GLM/Logit need an explicit constant; formula models include one by default. OrderedModel and ConditionalLogit must not receive a constant.
  2. Check for missing values: For array-based models, use missing="raise" during construction to catch unexpected NaNs; the default missing="none" does not check and can yield all-NaN estimates. If dropping rows is justified, record retained row IDs and compare models on the same observations. Fit any imputation on training data only.
  3. Scale if needed: Can improve conditioning and convergence; record units and estimate scaling on training data
  4. Encode categoricals: Use formula API or manual dummy coding

Model Building

  1. Start simple: Begin with basic model, add complexity as needed
  2. Check assumptions: Test residuals, heteroskedasticity, autocorrelation
  3. Use appropriate model: Match model to outcome type (binary→Logit, count→Poisson)
  4. Consider alternatives: If assumptions violated, use robust methods or different model

Inference

  1. Report effect sizes: Not just p-values
  2. Use robust SEs: When heteroskedasticity or clustering present
  3. Multiple comparisons: Correct when testing many hypotheses
  4. Confidence intervals: Always report alongside point estimates

Model Evaluation

  1. Check residuals: Plot residuals vs fitted, Q-Q plot

…

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

ما هو النموذج الإحصائي؟

هو طريقة لتمثيل العلاقة بين أجزاء مختلفة من بياناتك باستخدام الرياضيات.

ماذا تعني «التشخيصات» (diagnostics)؟

تعني التحقق من أن النموذج الذي اخترته يناسب بياناتك فعلاً، وأن افتراضاته صحيحة.

ما هو «الاستدلال» (inference)؟

هو الاستنتاجات التي يمكنك الوصول إليها من بياناتك استناداً إلى نتائج النموذج، مثل تقديرات التأثيرات ومستويات عدم اليقين.

التفاصيل

الوصف الأصلي من المؤلف

Fits and diagnoses Python statistical models including OLS, GLM, discrete and mixed models, ARIMA and SARIMAX. Supports coefficient inference, marginal effects, model comparison and time series forecasting with explicit design and uncertainty checks. Used for econometrics and statistical modeling; for guided test selection with APA reporting, see statistical-analysis.

repo: K-Dense-AI/scientific-agent-skills

الشعبية

نجوم GitHub
51k
الترتيب
#3578
الترخيص
MIT
آخر تحديث
15‏/10‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة