JDACS4C-IMPROVE / DrugCell

A visible neural network model for drug response prediction
MIT License
0 stars 2 forks source link

added IMPROVE result to scores #20

Closed rohandavidg closed 1 year ago

rohandavidg commented 1 year ago

Hi Rylie

Please let me know if this is what you mean?

RylieWeaver commented 1 year ago

Yes, this is what I mean.

RylieWeaver commented 1 year ago

I think this needs to be a print statement instead. Here's how it looks in other models:

    print("\nIMPROVE_RESULT val_loss:\t{}\n".format(scores["val_loss"]))
RylieWeaver commented 1 year ago

Zoomed out look:

            print(f'Currenf MSE: {mse}')
            if mse < max_MSE:
                model_max = copy.deepcopy(self.model)
                max_MSE = mse
                print('Validation at Epoch ' + str(epo + 1) +
                      ' with loss:' + str(loss_val.item())[:7] +
                      ', MSE: ' + str(mse)[:7] +
                      ' , Pearson Correlation: ' + str(pearson)[:7] +
                      ' with p-value: ' + str(p_val)[:7] +
                      ' Spearman Correlation: ' + str(spearman)[:7] +
                      ' with p_value: ' + str(s_p_val)[:7] +
                      ' , Concordance Index: ' + str(CI)[:7])
                scores['val_loss'] = mse #loss_val.item()
                scores['rmse'] = rmse
                scores['pcc'] = pearson
                scores['scc'] = spearman
                scores['r2'] = r2
                scores['best_epoch'] = epo
                print(scores)
        # table.add_row(lst)

    self.model = model_max

    # with open(self.record_file, 'w') as fp:
    #    fp.write(table.get_string())
    # with open(self.pkl_file, 'wb') as pck:
    #    pickle.dump(loss_history, pck)

    print("\nIMPROVE_RESULT val_loss:\t{}\n".format(scores["val_loss"]))
    #print("IMPROVE_RESULT pcc:\t{}\n".format(scores["pcc"]))
    #print("IMPROVE_RESULT scc:\t{}\n".format(scores["scc"]))
    #print("IMPROVE_RESULT rmse:\t{}\n".format(scores["rmse"]))
    #print("IMPROVE_RESULT r2:\t{}\n".format(scores["r2"]))
    #print("IMPROVE_RESULT best epoch:\t{}\n".format(scores["best_epoch"]))