2350e18231a67fa9d795fe7a16919b344a4b4ce5,examples/factors/FACTORS_correlations.py,,,#,17

Before Change


y_train = train_dataset.y
n_tasks = y_train.shape[1]

all_results = []
for task in range(n_tasks):
  y_task = y_train[:, task]
  task_results = []
  for other_task in range(n_tasks):
    if task == other_task:
      task_results.append(1.)
      continue
    y_other = y_train[:, other_task]
    r2 = dc.metrics.pearson_r2_score(y_task, y_other)
    //print("r2 for %s-%s is %f" % (task, other_task, r2))
    task_results.append(r2)
  print("Task %d" % task)
  print(task_results)
  all_results.append(task_results)
print("Writing results to factors_corr.csv")
df = pd.DataFrame(all_results)
df.to_csv("factors_corr.csv")

After Change


  y_task = y_train[:, task]
  for other_task in range(n_tasks):
    if task == other_task:
      continue
    y_other = y_train[:, other_task]
    r2 = dc.metrics.pearson_r2_score(y_task, y_other)
    print("r2 for %s-%s is %f" % (task, other_task, r2))
    all_results.append(r2)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: deepchem/deepchem
Commit Name: 2350e18231a67fa9d795fe7a16919b344a4b4ce5
Time: 2017-02-05
Author: bharath.ramsundar@gmail.com
File Name: examples/factors/FACTORS_correlations.py
Class Name:
Method Name:


Project Name: deepchem/deepchem
Commit Name: 2350e18231a67fa9d795fe7a16919b344a4b4ce5
Time: 2017-02-05
Author: bharath.ramsundar@gmail.com
File Name: examples/kinase/KINASE_correlations.py
Class Name:
Method Name:


Project Name: deepchem/deepchem
Commit Name: 2350e18231a67fa9d795fe7a16919b344a4b4ce5
Time: 2017-02-05
Author: bharath.ramsundar@gmail.com
File Name: examples/uv/UV_correlations.py
Class Name:
Method Name: