Py之openml:openml的简介、安装、使用方法之详细攻略

目录

openml的简介、安装、使用方法

openml的安装

openml的使用方法

1、基础用法


openml的简介、安装、使用方法

        OpenML是一个全球性的机器学习实验室,机器学习研究应该易于访问和重用。OpenML是一个开放的平台,用于共享数据集、算法和实验——一起学习如何更好地学习。
       OpenML 围绕开放接口构建,可用于自动共享(和导入)数据集、算法和直接来自我们已知和喜爱的工具的实验结果。通过我们的 API,OpenML 可以轻松集成到新的工作流程和过程中,以导入新数据和导出新结果。我们也相信收集和共享数据以及收集和分析实验结果的伟大标准。特点如下:
(1)、人工智能就绪数据:所有数据集均采用统一格式,具有丰富、一致的元数据,并且可以直接加载到您喜欢的环境中。
(2)、机器学习库集成:管道和模型可以直接从您最喜欢的机器学习库中共享。无需手动步骤。
(3)、ML 结果的宝库:从数以千计的数据集上进行的数百万个可重现的机器学习实验中学习,以做出明智的决策。

官网OpenML

openml的安装

pip install openml

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple openml

 

openml的使用方法

1、基础用法

import openml

# List all datasets and their properties
openml.datasets.list_datasets(output_format="dataframe")

# Get dataset by ID
dataset = openml.datasets.get_dataset(61)

# Get dataset by name
dataset = openml.datasets.get_dataset('Fashion-MNIST')

# Get the data itself as a dataframe (or otherwise)
X, y, _, _ = dataset.get_data(dataset_format="dataframe")



from sklearn import ensemble
from openml import tasks, runs

# Build any model you like
clf = ensemble.RandomForestClassifier()

# Download any OpenML task
task = tasks.get_task(3954)

# Run and evaluate your model on the task
run = runs.run_model_on_task(clf, task)

# Share the results on OpenML. Your API key can be found in your account.
# openml.config.apikey = 'YOUR_KEY'
run.publish()


# List all tasks in a benchmark
benchmark = openml.study.get_suite('OpenML-CC18')
tasks.list_tasks(output_format="dataframe", task_id=benchmark.tasks)

# Return benchmark results
openml.evaluations.list_evaluations(
    function="area_under_roc_curve", 
    tasks=benchmark.tasks, 
    output_format="dataframe"
)


Logo

脑启社区是一个专注类脑智能领域的开发者社区。欢迎加入社区,共建类脑智能生态。社区为开发者提供了丰富的开源类脑工具软件、类脑算法模型及数据集、类脑知识库、类脑技术培训课程以及类脑应用案例等资源。

更多推荐