new_reactions = np.random.rand(5, 4) new_preds = model.predict(new_reactions) new_uncs = np.std([tree.predict(new_reactions) for tree in model.estimators_], axis=0) order = np.argsort(new_preds) for i in order: print(f“候选{i+1}: 能垒 {new_preds[i]:.2f} +- {new_uncs[i]:.2f} kcal/mol”) ```

岗位关联

代码用途:演示用随机森林训练一个能垒预测模型,并借助集成模型间的预测标准差来估计不确定性,最终按预测能垒对候选反应排序,模拟高通量反应筛选。