metrics

【机器学习实战】计算两个矩阵的成对距离(pair-wise distances)

本小妞迷上赌 提交于 2019-12-16 12:20:42
矩阵中每一行是一个样本,计算两个矩阵样本之间的距离,即成对距离(pair-wise distances),可以采用 sklearn 或 scipy 中的函数,方便计算。 sklearn: sklearn.metrics.pairwise_distances scipy: scipy.spatial.distance_matrix (用于 p-norm) 或 scipy.spatial.distance.cdist (所有常用距离 metrics) 比较三者的运行时间:(都计算欧式距离) import numpy as np from sklearn.metrics import pairwise_distances from scipy.spatial import distance_matrix from scipy.spatial.distance import cdist # 10-dimensional features x = np.random.rand(400000).reshape((-1, 10)) y = np.random.rand(45000).reshape((-1, 10)) def option1(): dists = pairwise_distances(x, y) def option2(): dists = distance_matrix(x,

Prometheus 入门

泪湿孤枕 提交于 2019-12-15 23:59:55
文章首发于公众号《程序员果果》 地址 : https://mp.weixin.qq.com/s/BjZyNcWEgflJMnjfceiluw 简介 Prometheus 是一套开源的系统监控报警框架。它启发于 Google 的 borgmon 监控系统,由工作在 SoundCloud 的 google 前员工在 2012 年创建,作为社区开源项目进行开发,并于 2015 年正式发布。 特点 作为新一代的监控框架,Prometheus 具有以下特点: 强大的多维度数据模型: 时间序列数据通过 metric 名和键值对来区分。 所有的 metrics 都可以设置任意的多维标签。 数据模型更随意,不需要刻意设置为以点分隔的字符串。 可以对数据模型进行聚合,切割和切片操作。 支持双精度浮点类型,标签可以设为全 unicode。 灵活而强大的查询语句(PromQL):在同一个查询语句,可以对多个 metrics 进行乘法、加法、连接、取分数位等操作。 易于管理: Prometheus server 是一个单独的二进制文件,可直接在本地工作,不依赖于分布式存储。 高效:平均每个采样点仅占 3.5 bytes,且一个 Prometheus server 可以处理数百万的 metrics。 使用 pull 模式采集时间序列数据,这样不仅有利于本机测试而且可以避免有问题的服务器推送坏的

从零开始搭建内网高可用k8s集群

笑着哭i 提交于 2019-12-14 04:01:27
从零开始搭建内网高可用k8s集群 前言 前期准备 服务器硬件准备 服务器软件准备 第一步-搭建内网yum仓库 root@test: root@node2: root@master1, master2, node1 第二步-搭建内网harbor服务器 root@test: root@ALL: root@node2: 第三步-在master1,master2节点上搭建haproxy+keepalived框架 root@master1,master2: 第四步-部署k8s集群 root@master1: root@master2: root@node1,node2: 第五步-部署dashboard root@master1: 第六步-搭建ceph root@ALL: myceph@node2: root@node2: 前言 前段时间由于项目需求,需要搭建k8s集群,由于是首次接触,因此经验不足,只搭建了一个最基础的简单集群,现重新在内网搭建高可用集群+分布式存储,记录搭建过程 前期准备 服务器硬件准备 服务器 ip 系统 master1 172.16.140.100 centos7 master2 172.16.140.101 centos7 node1 172.16.140.102 centos7 node2 172.16.140.103 centos7 test——外网服务器

Can my PDF ping my server when it is opened?

六眼飞鱼酱① 提交于 2019-12-14 02:17:10
问题 I have a daily cron job that email PDFs to customers. I want to get a measure of how many of those PDF files are opened. What techniques are available? The standard technique in a web page is to include an img tag with a src reference to a server endpoint that records the ping. But it seems that PDF doesn't allow external image references. Is there some way to accomplish what I want? Update: we're considering having the email carry a link to the PDF, but there are reasons we don't want to, so

Automatic way to obtain the floating-point operation count for some piece of code

戏子无情 提交于 2019-12-13 19:34:24
问题 I have some rather complex and highly templated code (C++, but this may not be very relevant) of which I'd like to know the number of adds, subs, muls, divs, and sqrts at execution. Is there an automatic way to get this information (the compiler could work it out easily)? I tried to count it myself in the assembler code generated, but got confused with jp , jmp , and call s. 回答1: I would suggest to override + , - , * , / operators and sqrt function for some float-like type, in which you can

mlpack nearest neighbor with cosine distance?

随声附和 提交于 2019-12-13 18:23:11
问题 I'd like to use the NeighborSearch class in mlpack to perform KNN classification on some vectors representing documents. I'd like to use Cosine Distance, but I'm having trouble. I think the way to do this is to use the inner-product metric "IPMetric" and specify the CosineDistance kernel... This is what I have: NeighborSearch<NearestNeighborSort, IPMetric<CosineDistance>> nn(X_train); But I get the following compile errors: /usr/include/mlpack/core/tree/hrectbound_impl.hpp:211:15: error:

Loading multiple CSV files into MySQL [closed]

南楼画角 提交于 2019-12-13 04:51:53
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I am working on a metrics project for my team. I have to load several different reports into a central repository and then create

Azure VM stats - Network In/Out - what are the measurements?

人走茶凉 提交于 2019-12-13 03:45:15
问题 I feel perturbed, but I don't understand the measurement Azure uses for Network In/Out and a few other things. On Azure portal -> my VM -> Metrics -> [Host] Network In/Out, it says that it is measured in bytes, but then it also draws graph over time. If it were plain, bytes, it should be cumulative and therefore grow indefinitely, but it isn't, therefore I am inclined to believe it is measured per second or something like that. But Azure docs claim that it is bytes and not bytes per second

How to handle the mean Intersection Over Union (mIOU) for unknown class in semantic segmentation?

旧巷老猫 提交于 2019-12-12 21:48:55
问题 I implemented a FCN network to do semantic segmentation. I am using Cityscapes as my dataset. As you know, there are some classes in Cityscapes that you ignore during the training and it is labeled as 255. I used weighted loss to ignore the loss for the unknown classes(set the loss to zero for unknown class). Now I want to exclude unknown class from my evaluation metric(mean Intersection Over Union (mIOU)).It is not clear for me how to exclude the unknown class at this point. At the moment I

Offset graphite metrics by the lowest value in current time range

最后都变了- 提交于 2019-12-12 17:13:35
问题 I have Grafana with Graphite metrics. I have a graph showing the EnqueueCount of some specific queue in ActiveMQ. The problem is that the EnqueueCount shows all values since the queue was created, so when I narrow down the time range in Grafana to "today so far", the graph looks like this: I would like it to show only values for current period - I would like the graph to always start at 0. In this case I would like to offset it by -2. There is an offset function, however it is only by