<jupyter_start><jupyter_text>Read sample data<jupyter_code>x_train = pd.read_csv('sample_training_data.csv')
ft_predict = 'cur_pH' # specify which column to predict
all_fts = x_train.columns
model_fts = all_fts
model_fts.drop(ft_predict)<jupyter_output><empty_output><jupyter_text>Run pairwise regression model<jupyter_code># train model
z_dynamic_range = np.linspace(6.8,7.5,15) # specify the range and binning of key-covariate

model = KeyCovariatePairwiseLR(alpha_blend=20, cov_steps=20, coeff_smooth_z=6, func_smooth_z='sigmoid')
print(ft_predict)
model.fit(x_train[all_fts], 'prev_pH', ft_predict, cov_range_z=z_dynamic_range, include_z_in_x=True)
ypred_train = model.predict(x_train[all_fts])
model.plot_pairwise_interactions(n_plot_cols=3, scaleup=1.6)
plt.tight_layout()<jupyter_output>cur_pH
prev_pH
{'fraction_non_alphanumeric': 0.10767326732673267, 'fraction_numerical': 0.017326732673267328, 'mean_word_length': 10.557142857142857, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '668457', 'license': 'MIT', 'n_tokens_mistral': 340, 'n_tokens_neox': 318, 'n_words': 47, 'path': 'example/runPairwiseRegression_example.ipynb', 'repo_name': 'philips-labs/pairwise-regression', 'size': '808'}