# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# +
# %matplotlib inline
# %load_ext autoreload
# %autoreload 2

import seaborn as sns
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np

# -

results = pd.read_csv('tune_random_forest_regression_all_continuous.csv')
results.shape

results.columns


# +

print("names {}".format(list(results['name'].value_counts().to_dict().keys())))
print("features {}".format(list(results['feature'].value_counts().to_dict().keys())))
print("depth {}".format(list(results['depth'].value_counts().to_dict().keys())))
print("trees {}".format(list(results['trees'].value_counts().to_dict().keys())))

# +

summary = results.loc[results.groupby("name", as_index=False)["rmse"].idxmin()].sort_values('rmse')
summary
# -

summary = summary.loc[~summary['name'].isin(['ADMECaco2', 'Caco2', 'MouseRatTox', 'TB_SRI'])]
summary

results = results.loc[~results['name'].isin(['ADMECaco2', 'Caco2', 'MouseRatTox', 'TB_SRI'])]
results.shape

df = results[(results['depth'] == 30) & (results['feature'] == 'rdkit')]
df.shape

fig, axes = plt.subplots(nrows=1, ncols=1, figsize=(10, 8))
sns.pointplot(x='trees', y='rmse', hue='name', data=df, ax=axes)

df = results[(results['depth'] == 30) & (results['trees'] == 40)]
df.shape

fig, axes = plt.subplots(nrows=1, ncols=1, figsize=(10, 8))
sns.pointplot(x='feature', y='rmse', hue='name', data=df, ax=axes)

df = results[(results['depth'] == 30)]
df.shape

fig, axes = plt.subplots(nrows=1, ncols=1, figsize=(10, 8))
sns.pointplot(x='feature', y='rmse', hue='name', data=df, ax=axes)

label_df = pd.read_csv('MouseRatToxLabels.csv')
label_df.shape

td_rat = label_df['activity_value'].dropna()
len(td_rat)

fig, axes = plt.subplots(nrows=1, ncols=2, figsize=(10, 5))
sns.distplot(td_rat, kde=False, ax=axes[0])
sns.distplot(np.log(td_rat), kde=False, ax=axes[1])

admecaco2_efflux = pd.read_csv('ADMECaco2Labels.csv')['activity_value'].dropna()
fig, axes = plt.subplots(nrows=1, ncols=2, figsize=(10, 5))
sns.distplot(admecaco2_efflux, kde=False, ax=axes[0])
sns.distplot(np.log(admecaco2_efflux), kde=False, ax=axes[1])

tb_cc50 = pd.read_csv('TB_SRI_Labels.csv')['activity_value'].dropna()
#tb_cc50 = tb_cc50[tb_cc50 > 14]
fig, axes = plt.subplots(nrows=1, ncols=2, figsize=(10, 5))
sns.distplot(tb_cc50, kde=False, ax=axes[0])
sns.distplot(np.log(tb_cc50), kde=False, ax=axes[1])

test = pd.read_csv('TB_SRI_Labels.csv')
test['activity_value'].value_counts()

(tb_cc50 == 15).value_counts()


StarcoderdataJupyterScriptsDedupFiltered