当前位置:网站首页>Machine learning based on deepchem
Machine learning based on deepchem
2022-07-29 03:25:00 【Order anything】
Introduce a library ——DeepChem, It's a building on Tensorflow Libraries on the platform , Designed to help use deep learning in Life Sciences , For molecular processing , Genetic data sets or microscopic data sets have special support .
DeepChem And Tensorflow The system can be well integrated , Therefore, it can DeepChem Code and others Tensorflow Application code mixing and matching .
DeepChem I won't support it windows install , Currently only supported linux And Mac, For installation and use, please refer to its official website :
DeepChemhttps://deepchem.io/ There are rich usage methods on the official website , See the detailed tutorial .
Here is a small example that may be used in work demo( Use DeepChem To train models for predicting molecular toxicity ):
import numpy as np
import deepchem as dc
# Load a toxicity data set —— The characterization process is to transform the data set containing molecular information into matrices and vectors
tox21_tasks,tox21_datasets,transformers = dc.molnet.load_tox21()
# Look at the data
print(f'tox21_tasks:{tox21_tasks};tox21_datasetsL:{tox21_datasets}')
# Split the dataset
train_dataset,valid_dataset,test_dataset = tox21_datasets
# see Transformer
print(f'transformers:{transformers}')
# [<deepchem.trans.transformers.BalancingTransformer at XXXXXXXXX>]
# Establish a fully connected network
model = dc.models.MultitaskClassifier(n_tasks=12,n_features=1024,layer_sizes=[1000])
model.fit(train_dataset,nb_epoch=100)
metric = dc.metrics.Metric(dc.metrics.roc_auc_score,np.mean)
# Model to evaluate
train_scores = model.evaluate(train_dataset,[metric],transformers)
test_scores = model.evaluate(test_dataset,[metric],transformers)
print(train_scores)
print(test_scores) notes : among transformers It is a process of characterization , Here we call transformers, In fact, the modules used are BalancingTransformer, Looking at the name, I feel that it is not simple transformer The appearance of
, in fact BalancingTransofrmer Class is designed to correct unbalanced data , The unbalanced data set is compensated by adjusting the weight matrix of the data set .
BalancingTransofrmer Adjust the weight of each data point , Make the total weight assigned to each class the same . such , The loss function has no systematic bias towards any class , Only through correct classification , To reduce losses ( If you are interested in the specific implementation process, please refer to the source code ).
In life sciences , Data imbalances are common , Screening 100 Ten thousand molecules , Maybe it's just 10 One is effective ,99.99% Are invalid molecules , When using the model, we should focus on dealing with the problem of data imbalance .
边栏推荐
猜你喜欢

照片比例校正工具:DxO ViewPoint 3 直装版

exness:鸽派决议帮助黄金反弹,焦点转向美国GDP

Asynchronous callback future mode of concurrent mode

Watermelon book learning Chapter 6 -- SVM

How does DataGrid export and recover the entire database data, using a single SQL file

How dare you write a resume that is proficient in concurrent programming? Why do you use a two-way linked list in AQS?

逐步分析类的拆分之案例——五彩斑斓的小球碰撞

暴力递归到动态规划 01 (机器人移动)

How to deploy sentinel cluster of redis

基于单片机烟雾温湿度甲醛监测设计
随机推荐
机器学习【Numpy】
mycat读写分离配置
Multi level wavelet CNN for image restoration
GJB常见混淆概念
Flask creation process day05-06 creation project
生产部署zabbix5.0笔记
[technology 1]
Digital image processing Chapter 10 - image segmentation
Sanzi chess (player + computer)
军品三大基线(功能基线、分配基线、产品基线)及基线包含的文件
3D advanced renderer: artlandis studio 2021.2 Chinese version
Unity game special effects
Complexity analysis learning
ROS - create workspace
Arm architecture and neural network
Military product development process - transition phase
Numpy acceleration -- > cupy installation
Reproduce 20 character short domain name bypass and XSS related knowledge points
腾讯云使用pem登录
STC单片机驱动1.8‘TFT SPI屏幕演示示例(含资料包)