metrics

Is there an optimizer in keras based on precision or recall instead of loss?

旧巷老猫 提交于 2019-11-29 07:13:18
I am developping a segmentation neural network with only two classes, 0 and 1 (0 is the background and 1 the object that I want to find on the image). On each image, there are about 80% of 1 and 20% of 0. As you can see, the dataset is unbalanced and it makes the results wrong. My accuracy is 85% and my loss is low, but that is only because my model is good at finding the background ! I would like to base the optimizer on another metric, like precision or recall which is more usefull in this case. Does anyone know how to implement this ? Alexis as our comment were not clear enough, let me give

signalfx的中间件监控指标so cool

ぃ、小莉子 提交于 2019-11-29 05:00:22
signalfx的中间件监控指标so cool www.jianshu.com 对于我们做运维的来说,监控是最基本的东西,不过在初创公司很多计划是跟不上项目架构变化的,项目中会不断加入各种服务和组件,监控指标也大都不太相同,令人头痛。 幸好终于解放了一些... 最近公司微服务拆分的速度越来越快,很多小服务都有单独的存储和中间件(redis,cassandra,mysql,elastic search,kafka,rabbitmq), 针对服务的metric和中间件的无侵入的监控也越来越复杂, 刚开始大家都在想是不是需要自己写脚本收集指标。 最近偶然发现了 signalfx 提供了很多 collected 收集的各种中间件的 metrics, 最棒的是他们的github docs里还给出了他们在产品里提供的监控性能指标和非常详细的解释(url: https://github.com/signalfx/integrations/tree/master/collectd-elasticsearch/docs),看到这些参数后就觉得这个正符合我们的监控需求,然后下载,安装,三下五除二,10分钟就把metrics 显示到了 grafana 上,我在DataDog上也看了很多关于这些中间件的metrics说明,但是确没有像signalfx这样系统的整理并且把collected相关插件开源出来

Codahale Metrics: using @Timed metrics annotation in plain Java

流过昼夜 提交于 2019-11-29 04:43:52
问题 I am trying to add metrics to a plain Java application using codahale metrics. I'd like to use the @Timed annotation, but it is unclear to me which MetricRegistry it uses, or how to tell it which MetricRegistry to use. The application is a plain Java 8 application, built with Maven 3, no Spring, no Hibernate. I can not find any documentation on how to implement @Timed in the dropwizard documentation: https://dropwizard.github.io/metrics/3.1.0/manual/ I've added these dependencies: <dependency

nacos 部署笔记

时光毁灭记忆、已成空白 提交于 2019-11-29 04:22:45
Nacos 是什么? https://nacos.io/zh-cn/docs/what-is-nacos.html 服务(Service)是 Nacos 世界的一等公民。Nacos 支持几乎所有主流类型的“服务”的发现、配置和管理 我们开发说是: 配置中心和服务注册中心 不纠结了,做为一个运维,还是好好部署吧。 单机部署: 这个没什么好说的,用docker-compose 一键启动 Clone 项目 git clone https://github.com/nacos-group/nacos-docker.git cd nacos-docker 单机模式 docker-compose -f example/standalone-mysql.yaml up -d 集群部署 官网的文档比较简洁,用docker去搭建集群是伪集群。于是放弃用docker搭集群。换用官方的编译包。 以下为官方推荐的部署架构图 下载地址 https://github.com/alibaba/nacos/releases/download/1.1.3/nacos-server-1.1.3.tar.gz tar -xvf nacos-server-1.1.3.tar.gz cd nacos/conf 配置文件 [root@nodejs1 conf]# cat cluster.conf #it is ip

Sklearn K均值聚类

浪子不回头ぞ 提交于 2019-11-29 03:51:56
## 版权所有,转帖注明出处 章节 SciKit-Learn 加载数据集 SciKit-Learn 数据集基本信息 SciKit-Learn 使用matplotlib可视化数据 SciKit-Learn 可视化数据:主成分分析(PCA) SciKit-Learn 预处理数据 SciKit-Learn K均值聚类 SciKit-Learn 支持向量机 SciKit-Learn 速查 到目前为止,我们已经非常深入地了解了数据集,并且把它分成了训练子集与测试子集。 接下来,我们将使用聚类方法训练一个模型,然后使用该模型来预测测试子集的标签,最后评估该模型的性能。 聚类(clustering)是在一组未标记的数据中,将相似的数据(点)归到同一个类别中的方法。聚类与分类的最大不同在于分类的目标事先已知,而聚类则不知道。K均值聚类是聚类中的常用方法,它是基于点与点的距离来计算最佳类别归属,即靠得比较近的一组点(数据)被归为一类,每个聚类都有一个中心点。 我们首先创建聚类模型,对训练子集进行聚类处理,得到聚类中心点。然后使用模型预测测试子集的标签,预测时根据测试子集中的点(数据)到中心点的距离来进行分类。 创建模型 示例 创建聚类模型。 import numpy as np from sklearn import datasets # 加载 `digits` 数据集 digits =

Sklearn 速查

拈花ヽ惹草 提交于 2019-11-29 03:51:50
## 版权所有,转帖注明出处 章节 SciKit-Learn 加载数据集 SciKit-Learn 数据集基本信息 SciKit-Learn 使用matplotlib可视化数据 SciKit-Learn 可视化数据:主成分分析(PCA) SciKit-Learn 预处理数据 SciKit-Learn K均值聚类 SciKit-Learn 支持向量机 SciKit-Learn 速查 Scikit-learn是一个开源Python库,它使用统一的接口实现了一系列机器学习、预处理、交叉验证和可视化算法。 一个基本例子 from sklearn import neighbors, datasets, preprocessing from sklearn.model_selection import train_test_split from sklearn.metrics import accuracy_score iris = datasets.load_iris() X, y = iris.data[:, :2], iris.target X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=33) scaler = preprocessing.StandardScaler().fit(X

Lucene fieldNorm discrepancy between Similarity calculation and query-time value

江枫思渺然 提交于 2019-11-29 02:37:12
I'm trying to understand how fieldNorm is calculated (at index time) and then used (and apparentlly re-calculated) at query time. In all the examples I'm using the StandardAnalyzer with no stop words. Deugging the DefaultSimilarity 's computeNorm method while indexing stuff, I've noticed that for 2 particular documents it returns: 0.5 for document A (which has 4 tokens in its field) 0.70710677 for document B (which has 2 tokens in its field) It does this by using the formula: state.getBoost() * ((float) (1.0 / Math.sqrt(numTerms))); where boost is always 1 Afterwards, when I query for these

1.Sentinel源码分析—FlowRuleManager加载规则做了什么?

假装没事ソ 提交于 2019-11-29 02:14:42
最近我很好奇在RPC中限流熔断降级要怎么做,hystrix已经1年多没有更新了,感觉要被遗弃的感觉,那么我就把眼光聚焦到了阿里的Sentinel,顺便学习一下阿里的源代码。 这一章我主要讲的是FlowRuleManager在加载FlowRule的时候做了什么,下一篇正式讲Sentinel如何控制并发数的。 下面我给出一个简化版的demo,这个demo只能单线程访问,先把过程讲清楚再讲多线程版本。 初始化流量控制的规则:限定20个线程并发访问 public class FlowThreadDemo { private static AtomicInteger pass = new AtomicInteger(); private static AtomicInteger block = new AtomicInteger(); private static AtomicInteger total = new AtomicInteger(); private static AtomicInteger activeThread = new AtomicInteger(); private static volatile boolean stop = false; private static final int threadCount = 100; private static int

Java application profiling

二次信任 提交于 2019-11-29 01:29:27
I am looking for a Java code profiler which I can use to profile my application (its a service which runs in backend) on production (so means low over head, and it must not slow down my application). Primarily I want calling tree profiling, that is if a() calls b() and then b() calls c(), then how much time a() b() and c() took, both inclusively and exclusively. Have seen jvisualvm and jprofiler , but this is not what I am looking for, because I cannot tie my production application to them as it will cause a major performance issue. Also, I did go through metrics ( https://github.com

Contour 学习笔记(一):使用 Contour 接管 Kubernetes 的南北流量

有些话、适合烂在心里 提交于 2019-11-28 23:47:37
原文链接: Contour 学习笔记(一):使用 Contour 接管 Kubernetes 的南北流量 在 Kubernetes 中运行大规模以 Web 为中心的工作负载,最关键的需求之一就是在 L7 层实现高效流畅的入口流量管理。自从第一批 Kubernetes Ingress Controller 开发完成以来, Envoy (由 Matt Klein 和 Lyft 团队开发)已经成为云原生生态系统中的新生力量。Envoy 之所以受到支持,因为它是一个 CNCF 托管的项目,与整个容器圈和云原生架构有着天然的支持。 容器公司 Heptio 开源的项目 Contour 使用 Envoy 作为 Kubernetes 的 Ingress Controller 实现,为大家提供了一条新的 Kubernetes 外部负载均衡实现思路。 据 官方博客 介绍, Heptio Contour 可以为用户提供以下好处: 一种简单的安装机制来快速部署和集成 Envoy。 与 Kubernetes 对象模型的集成。 Ingress 配置的动态更新,而无需重启底层负载均衡器。 项目成熟后,将允许使用 Envoy 一些强大的功能,如熔断器、插件式的处理器链,以及可观测性和可调试性,可以非常方便地对接监控系统。 IngressRoute 之间可以级联,用来做蓝绿部署非常方便。 下面我们就来试用一下。 1