model_selection.py 378 B

123456789101112131415
  1. import pandas as pd
  2. import numpy as np
  3. import matplotlib
  4. import matplotlib.pyplot as plt
  5. df = pd.read_csv("output/hep-ct-validation/lda_tuning_results.csv")
  6. df['overfitting'] = (df['perplexity']/df['train_perplexity']).apply(np.log)
  7. df = df[df['topics'] > 25]
  8. df = df[df['overfitting'] < 1]
  9. df.sort_values('c_npmi', ascending=False, inplace=True)
  10. print(df)
  11. print(len(df))