20250606_minutes.txt 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. Date: 8.june 2025
  2. Meeting with Zahra
  3. Dates:
  4. 30.6. - Zahra has presentation
  5. 5.7. - Zahra visits Iran for 2-3 weeks
  6. Asking about accuracy measures:
  7. * for fit we have goodness of fit measures:
  8. - log likelihood
  9. - AIC and BIC
  10. * these models used for classification: [1]
  11. - pred Y = [ Y : f(x|Y) > 0.5 === decision function(x) > 0
  12. [ !Y : otherwise
  13. - in logit models: [2] Speech and Language Processing, Ch 5
  14. decision_function(x) = b + w^T x == logit (x)
  15. logit == log odds
  16. logit(x) = 1/(1 + exp(-decision_function(x))
  17. - ACC == accuracy score [3]
  18. accuracy(y, \hat{y}) = 1/n \sum_{i=0}^{n-1} delta_{\hat{y}_i, y_i}
  19. - AUC == area under curve ???? [4,5]
  20. From [6]:
  21. fpr, tpr, thresholds = ROC = function(y_true, y_score)
  22. We are systematically doing
  23. pred Y[i] = [ 1 : y_score[i] >= threshold
  24. [ 0 : otherwise
  25. all i
  26. and comparing with
  27. y_true[i] all i
  28. for all meaningful thresholds == y_score
  29. Target scores, can either be probability estimates of the positive class,
  30. confidence values, or non-thresholded measure of decisions (as returned by
  31. “decision_function” on some classifiers). For decision_function scores,
  32. values greater than or equal to zero should indicate the positive class.
  33. In our case y_score = prob estimate(for Y=1) as given by the model
  34. Ref:
  35. - [1] https://realpython.com/logistic-regression-python/
  36. - [2] https://web.stanford.edu/~jurafsky/slp3/5.pdf
  37. - https://en.wikipedia.org/wiki/Logistic_regression
  38. - [3] https://scikit-learn.org/stable/modules/model_evaluation.html#accuracy-score
  39. - [4] https://scikit-learn.org/stable/modules/model_evaluation.html#roc-metrics
  40. - [5] https://en.wikipedia.org/wiki/Receiver_operating_characteristic
  41. - [6] https://scikit-learn.org/stable/modules/generated/sklearn.metrics.roc_curve.html
  42. - https://stats.stackexchange.com/questions/354709/sklearn-metrics-accuracy-score-vs-logisticregression-score
  43. - https://scikit-learn.org/stable/modules/generated/sklearn.metrics.roc_curve.html
  44. - https://scikit-learn.org/stable/modules/model_evaluation.html#roc-metrics
  45. Plan:
  46. * Make notes overleaf file (ZA)
  47. - notes will the basis for the paper and presentations
  48. * Transfer as much text and results to notes (ZA)
  49. * Test calc. with bayesian model (MH)
  50. * Chat about progress at the picnic
  51. Ideal:
  52. * Have some preliminary results for bayesian model until Friday
  53. -----------------------------------------------------------------------------------
  54. PIPELINE
  55. # condprob_flowchart.py
  56. def print_flowchart():
  57. print("\n" + "="*45)
  58. print(" Conditional Probability Modeling Flowchart")
  59. print("="*45 + "\n")
  60. print(" ┌────────────────────────────┐")
  61. print(" │ Define the Modeling Goal │")
  62. print(" └────────────┬──────────────┘")
  63. print(" │")
  64. print(" ┌────────────▼──────────────┐")
  65. print(" │ Choose Meaningful Model │")
  66. print(" │ and Set Assumptions │")
  67. print(" └────────────┬──────────────┘")
  68. print(" │")
  69. print(" ┌────────────▼──────────────┐")
  70. print(" │ Fit Model to Data │")
  71. print(" └────────────┬──────────────┘")
  72. print(" │")
  73. print(" ┌────────────▼──────────────┐")
  74. print(" │ Evaluate Model & Loss │")
  75. print(" └────────────┬──────────────┘")
  76. print(" │")
  77. print(" ┌────────────▼──────────────┐")
  78. print(" │ Quantify Uncertainty (UQ) │")
  79. print(" └────────────┬──────────────┘")
  80. print(" │")
  81. print(" ┌────────────▼──────────────┐")
  82. print(" │ Interpret Results & UQ │")
  83. print(" └────────────┬──────────────┘")
  84. print(" │")
  85. print(" ┌────────────▼──────────────┐")
  86. print(" │ Apply in Decision Context │")
  87. print(" └────────────────────────────┘\n")
  88. print(" ✔ Each block corresponds to one function or module")
  89. print(" ✔ Update each step with your methods and data later")
  90. print(" ✔ Plug in visual tools or UQ techniques where needed")
  91. if __name__ == "__main__":
  92. print_flowchart()