基于本体对复杂数据集进行分类的机器学习工具
项目描述
深度OC
DeepOC 是BioModel Classifier的核心- 使用深度神经网络自动分类生物模型的 python 应用程序。DeepOC 为基于本体的模型分类提供了一些非常底层的功能,这使我们能够适应任何其他项目。
安装
pip install deepoc
用法
首先,您需要一个地面实况数据集,它是模型的字典及其对应本体的列表
{
"model_1": ["GO:00001", "GO:00003", "GO:00002"],
"model_2: ["GO:00004", "GO:00002"]
}
要生成数据集并训练 DNN 模型:
ground_truth = ...
train_file = "path/to/your train csv file"
test_file = "path/to/your test csv file"
val_file = "path/to/your val csv file"
features = deepoc.build_features(ground_truth)
# Picking the first 300 features
selected_features = [feature['feature'] for idx, feature in enumerate(features) if idx < 300]
train, test, val = deepoc.generate_dataset(ground_truth, features, classes)
# Writing dataset to file
deepoc.write_dataset_to_file(train, train_file)
deepoc.write_dataset_to_file(test, test_file)
deepoc.write_dataset_to_file(val, val_file)
# Configure DNN model to use Gradient Descent optimizer, 1 hidden layer with 150 nodes, learning rate of 0.001 and dropout rate of 0.5
classifier = DeepOCClassifier(workspace, 'GD', [150], 0.001, train_file, test_file, classes, 0.5)
# Train the model with 3000 epoch, validate every 10 epochs and batch size of 16
classifier.train_dll_model(3000, 10, 16)
# Validate the result:
for record in val:
model = record['model']
predict_result = classifier.predict(record)
logger.info('Model %s: %s', model, predict_result)
更多示例可以在测试文件夹中找到。
基于除基因本体之外的任何本体对模型进行分类
要使该库与其他类型的本体一起使用,请根据您的本体实现OntologyService并在https://bitbucket.org/biomodels/deepoc/src/master/deepoc/ontology/init .py实例化您的对象
开发者
接触
许可
生物模型分类器源代码在 GNU Affero 通用公共许可证下分发。
请阅读 license.txt 以获取有关软件可用性和分发的信息。
项目详情
下载文件
下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。
源分布
deepoc-1.1.4.tar.gz
(10.1 kB
查看哈希)
内置分布
deepoc-1.1.4-py3-none-any.whl
(13.6 kB
视图哈希)