<jupyter_start><jupyter_text>explanation<jupyter_code>data= pd.read_csv('data/simulation/simulation_classification.csv')
task_type = "Classification"

meta_info = OrderedDict()

meta_info['uf_1']={'type': 'continues','source':'user'}
meta_info['uf_2']={'type': 'continues','source':'user'}
meta_info['uf_3']={'type': 'continues','source':'user'}
meta_info['uf_4']={'type': 'continues','source':'user'}
meta_info['uf_5']={'type': 'continues','source':'user'}
meta_info['if_1']={'type': 'continues','source':'item'}
meta_info['if_2']={'type': 'continues','source':'item'}
meta_info['if_3']={'type': 'continues','source':'item'}
meta_info['if_4']={'type': 'continues','source':'item'}
meta_info['if_5']={'type': 'continues','source':'item'}
meta_info['user_id']={"type":"id",'source':'user'}
meta_info['item_id']={"type":"id",'source':'item'}
meta_info['target']={"type":"target",'source':''}
train , test = train_test_split(data,test_size=0.2 ,random_state=0)
tr_x, tr_Xi, tr_y, tr_idx, te_x, te_Xi, te_y, val_x, val_Xi, val_y, val_idx, meta_info, model_info, sy, sy_t = data_initialize(train,test,meta_info,task_type ,'warm', 0, True)
model = GAMMLI(model_info=model_info, meta_info=meta_info, subnet_arch=[20, 10],interact_arch=[20, 10],activation_func=tf.tanh, batch_size=1000, lr_bp=0.01, auto_tune=False,
               interaction_epochs=500,main_effect_epochs=70,tuning_epochs=50,loss_threshold_main=0.01,loss_threshold_inter=0.01,combine_range=0.9,
              verbose=True, early_stop_thres=100,interact_num=10,u_group_num=50,i_group_num=50,scale_ratio=0.8,n_power_iterations=5,n_oversamples=0,
              mf_training_iters=300,change_mode=True,convergence_threshold=0.001,max_rank=3,wc='warm',interaction_restrict='intra')
model.fit(tr_x, val_x, tr_y, val_y, tr_Xi, val_Xi, tr_idx, val_idx)
simu_dir = 'result'
data_dict_logs = model.final_gam_model.summary_logs(save_dict=False)
data_dict_logs.update({"err_train_mf":model.final_mf_model.mf_mae,
                       "err_val_mf":model.final_mf_model.mf_valmae})
plot_trajectory(data_dict_logs, folder=simu_dir, name="s1_traj_plot", log_scale=True, save_png=False, save_eps=False)
plot_regularization(data_dict_logs, folder=simu_dir, name="s1_regu_plot", log_scale=True, save_png=False, save_eps=False)
data_dict = model.final_gam_model.global_explain(0,save_dict=False,)
feature_importance_visualize(data_dict, save_png=False, folder=simu_dir, name='s1_feature')
global_visualize_density(data_dict, save_png=False, folder=simu_dir, name='s1_global')
data_dict_local = model.local_explain(0,0,tr_x,tr_Xi,tr_y)
local_visualize(data_dict_local, save_png=False, folder=simu_dir, name='s1_local',task_type='Classification')
model.relation_plot(0.6,5,False)
new = te_x[91,:].reshape(1,-1)
_ = model.cold_start_analysis(new,'item',1.96)<jupyter_output>The new item belong to group 38
 mean is [0.00372281 0.00624268 0.00391979]
 and std is [0.02902827 0.03221927 0.03476598]
 the confidence interval is [[-0.05317259 -0.05690709 -0.06422152],[0.06061821 0.06939244 0.0720611 ]]
{'fraction_non_alphanumeric': 0.17451432334540665, 'fraction_numerical': 0.06322028317418506, 'mean_word_length': 10.421052631578947, 'pattern_counts': {'":': 5, '<': 4, '<?xml version=': 0, '>': 4, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '24268', 'license': 'MIT', 'n_tokens_mistral': 1327, 'n_tokens_neox': 1209, 'n_words': 137, 'path': 'scripts/simulation_test_classification.ipynb', 'repo_name': 'CnBDM-Su/LV_XNN', 'size': '3037'}