没有项目描述

hmc_loss的Python项目详细描述


Build Status

HMC损失

结构

python实现的分层多类验证度量:hmc loss . 原纸是(Bi&Kwok, 2012)

安装

pip install hmc_loss

要求

  • 努比
  • 网络x

如何使用

这个度量是像scikit学习度量一样实现的。

from hmc_loss import hmc_loss_score, get_cost_list
import numpy as np

# Generate label data(2-D array of numpy)
true_label = np.random.randint(2, size(100, 100))
pred_label = np.random.randint(2, size(100, 100))

# Generate test graph(Di-Graph of NetworkX)
graph = nx.gnc_graph(100)
# Generate element list of graph node
label_list = list(range(100))
# Calculate cost of each node in graph
cost_list = get_cost_list(graph, 0, label_list)
# Calculate HMC-loss
hmc_loss_score(true_label, pred_label, graph, 0, label_list, cost_list, alpha=0.5, beta=1.5)

许可证

MIT

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
工作负载调度器TWSz Java API重新启动和重新启动以及计划中的清理作业   在运行Java程序时,如何在shell脚本中提供输入选择?   数组无法解释的“OutOfMemoryError:Java堆空间”错误和代码行为   java Android:与文件关联(使用打开的文件)   基于两个元素的java排序2d arraylist   swing Java addActionListener错误   java尝试使用Jetty作为嵌入式servlet容器   java Set JTable背景标头图像   AsyncTask的postExecute方法无法正常工作   多线程是Java performancewise中处理AIs的最佳方法。(独立线程与单个更新线程)   java扫描程序在主方法中关闭异常   自定义SMTPAppender中的java scheduleAtFixedRate不会延迟   使用重载的java方法重复   java我有两个代表长数字的列表,我需要找到一种递归的方法来回答哪个数字更大   安卓 Kotlin相当于MainActivity。java处理来自外部应用程序的传入意图,以便在Flatter中使用   java有没有办法找出谁在阅读我的SQS消息?