Date: 8.june 2025

Meeting with Zahra

Dates:
  28.6 - Meeting about results and Presentation
  30.6. - Zahra has presentation
  04.7 - Meeting about Bayesian Model
  11.07- Meeting on Zoom about distributions
  23.07- Meeting in Person, Zahra and Katja
  5.08- Meeting on zoom
  12.8- Meeting in Person
  15.08- Meeting on Zoom
  18.8- Meeting on Zoom
  26.8- Meeting in Person 
  
  

Asking about accuracy measures:
  * for fit we have goodness of fit measures:
    - log likelihood
    - AIC and BIC
  * these models used for classification: [1]
  -  pred Y = [ Y : f(x|Y) > 0.5 === decision function(x) > 0
              [ !Y : otherwise
  - in logit models: [2]  Speech and Language Processing, Ch 5
      decision_function(x) = b + w^T x == logit (x)
      logit == log odds
      logit(x) = 1/(1 + exp(-decision_function(x))
  - ACC == accuracy score [3]
      accuracy(y, \hat{y}) = 1/n \sum_{i=0}^{n-1} delta_{\hat{y}_i, y_i}

  - AUC == area under curve ???? [4,5]
      From [6]:

        fpr, tpr, thresholds = ROC = function(y_true, y_score)

        We are systematically doing

          pred Y[i] = [ 1 : y_score[i] >= threshold
                     [ 0 : otherwise
          all i

        and comparing with

          y_true[i] all i
        for all meaningful thresholds == y_score

      Target scores, can either be probability estimates of the positive class,
      confidence values, or non-thresholded measure of decisions (as returned by
      “decision_function” on some classifiers). For decision_function scores,
      values greater than or equal to zero should indicate the positive class.
      In our case y_score = prob estimate(for Y=1) as given by the model


Ref:
   - [1] https://realpython.com/logistic-regression-python/
   - [2] https://web.stanford.edu/~jurafsky/slp3/5.pdf
   - https://en.wikipedia.org/wiki/Logistic_regression

   - [3] https://scikit-learn.org/stable/modules/model_evaluation.html#accuracy-score
   - [4] https://scikit-learn.org/stable/modules/model_evaluation.html#roc-metrics
   - [5] https://en.wikipedia.org/wiki/Receiver_operating_characteristic
   - [6] https://scikit-learn.org/stable/modules/generated/sklearn.metrics.roc_curve.html

   - https://stats.stackexchange.com/questions/354709/sklearn-metrics-accuracy-score-vs-logisticregression-score
   - https://scikit-learn.org/stable/modules/generated/sklearn.metrics.roc_curve.html
   - https://scikit-learn.org/stable/modules/model_evaluation.html#roc-metrics
   - https://en.wikipedia.org/wiki/Method_of_moments_(statistics)
   - https://en.wikipedia.org/wiki/Maximum_a_posteriori_estimation
   - https://en.wikipedia.org/wiki/Limited-memory_BFGS

Plan:

  * Make notes overleaf file (ZA)
    - notes will the basis for the paper and presentations
  * Transfer as much text and results to notes (ZA)
  * Test calc. with bayesian model (MH)
  * Chat about progress at the picnic

Ideal:
  * Have some preliminary results for bayesian model until Friday
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  -----------------------------------------------------------------------------------
  
  PIPELINE
  
  
# condprob_flowchart.py

def print_flowchart():
    print("\n" + "="*45)
    print(" Conditional Probability Modeling Flowchart")
    print("="*45 + "\n")

    print("       ┌────────────────────────────┐")
    print("       │ Define the Modeling Goal   │")
    print("       └────────────┬──────────────┘")
    print("                    │")
    print("       ┌────────────▼──────────────┐")
    print("       │  Choose Meaningful Model  │")
    print("       │   and Set Assumptions     │")
    print("       └────────────┬──────────────┘")
    print("                    │")
    print("       ┌────────────▼──────────────┐")
    print("       │     Fit Model to Data     │")
    print("       └────────────┬──────────────┘")
    print("                    │")
    print("       ┌────────────▼──────────────┐")
    print("       │  Evaluate Model & Loss    │")
    print("       └────────────┬──────────────┘")
    print("                    │")
    print("       ┌────────────▼──────────────┐")
    print("       │ Quantify Uncertainty (UQ) │")
    print("       └────────────┬──────────────┘")
    print("                    │")
    print("       ┌────────────▼──────────────┐")
    print("       │  Interpret Results & UQ   │")
    print("       └────────────┬──────────────┘")
    print("                    │")
    print("       ┌────────────▼──────────────┐")
    print("       │ Apply in Decision Context │")
    print("       └────────────────────────────┘\n")

    print("  ✔ Each block corresponds to one function or module")
    print("  ✔ Update each step with your methods and data later")
    print("  ✔ Plug in visual tools or UQ techniques where needed")

if __name__ == "__main__":
    print_flowchart()



