预测曲线拟合matlab(Predictive curve fitting matlab)
我有一个关于曲线拟合的问题,我有很多像图片中的曲线。
X轴:时间Y轴:温度
每个样本每30秒出来一次。
目标:预测瞬态结束时的值
在这个情况下,你会怎么做? 我所做的是:对于每个新样本,我开始一个新的拟合(因此每个拟合都独立于前一个拟合),并在启动后检查拟合曲线的值2小时(我在2h之前设置的所有曲线)的测量。 如果对于后续拟合的数字(比如说5),未来的价值保持大致相同(+ - 0.2°C),我假设估计是正确的。
这种方法在我看来太简单了,我想我并没有利用所有的信息。 例如,我准时做出的错误信息(例如,我预测的分钟4点,4点30分我发现我正在做错误)。
在图片中,曲线的红色部分被排除(但将来的真实数据会通过它)。 估计是蓝色的。 你看,在这种情况下,我没有一个好的预测......一般来说,我也有更平坦的曲线。
I have a question about curve fitting, I have many curves like the one in the picture.
X axis : time Y axis : temperature
Each sample comes out every 30s.
GOAL : predict the value at the end of the transient
What would you do in this situation? What I am doing is this : for every new sample I start a new fitting (and so each fitting is independent from the previous one) and check the value of the fitted curve 2 hours (all curves I have set before 2h) after the start of the measurement. If for a number (let's say 5) of subsequent fitting the value in the future stays more or less the same(+-0.2°C) I so assume that the estimation is the right one.
This approach seems to me far too simple and I think I am not exploiting all information. For example the info of the error I am making punctually (e.g. at minute 4:00 I predict and at 4:30 I see that I am doing an error).
In the picture the red part of the curve is excluded (but the real data in the future passes through it). the estimation is the blue one. You see in this case I don't have a good prediction... In general I have also more flat curves.
原文:https://stackoverflow.com/questions/42648357
最满意答案
不,你不能。
替换为kubernetes将简单地替换该配置映射中的所有内容。 您不能只更新其中的一个文件或一个单独的属性。
但是,如果您使用客户端Api进行检查,则会发现您是否创建了大量文件的配置图。 然后,这些文件将被存储为一个HashMap,其中key是默认的文件名,value是文件内容编码为一个字符串。 因此,您可以根据HashMap中现有的键值对编写自己的函数。
这是我到目前为止发现的,如果你发现已经有了解决这个问题的方法,请让我知道:)
仅供参考,如果您只想更新一个或几个属性,则可以使用补丁。 但是,实施起来有点困难。
链接可能有所帮助: 如何在不手动修改文件的情况下编辑部署? 和https://github.com/kubernetes-client/java/blob/master/kubernetes/docs/CoreV1Api.md#patchNamespacedConfigMap
No, you can't.
Replace in kubernetes will simply replace everything in that configmap. You can't just update one file or one single property in it.
However, if you check with the client Api, you will find if you create a configmap with lots of files. Then, those files will be stored as a HashMap, where key is file name by default, value is the file content encoded as a string. So you can write your own function based on existing key-value pair in HashMap.
This is what I found so far, if you find there is already existing method to deal with this issue, please let me know :)
FYI, if you want to update just one or few properties, it is possible if you use patch. However, it is a little bit hard to implement.
相关问答
更多-
如果您使用此命令来创建您的证书: openssl x509 -req -days 365 -in server.csr -CA ca.pem -CAkey ca-key.pem \ -CAcreateserial -out server-cert.pem 然后通过执行以下操作来解决您的问题,因为'客户'证书使用了-extfile extfile.cnf: echo subjectAltName = IP:worker_node_ip > extfile.cnf openssl x509 -req ...
-
就在今天晚上,我用kubespray在CoreOS上配置了一个使用法兰绒(vxlan)的流浪群集,并且我还对于法兰绒如何成为Kubernetes内部的Pod 事实证明, 正如这里所看到的 ,他们使用来自quay.io的 flannel-cni图像,使用法兰绒侧面车和hostDir卷挂载来写出CNI文件; 它输出cni-conf.json (将CNI配置为使用flannel),然后输出net-conf.json (配置法兰绒使用的子网和后端)。 我希望jinja2 mustache语法不会混淆答案,但是我发现 ...
-
如何将二进制文件存储在Kubernetes ConfigMap中?(How can I store a binary file in a Kubernetes ConfigMap?)[2024-01-09]
自Kubernetes版本1.10.0以来,现在支持二进制配置映射。 从自述文件中 ConfigMap对象现在通过一个新的binaryData字段支持二进制数据。 使用kubectl create configmap --from-file时,包含非UTF8数据的文件将被放置在这个新字段中以保留非UTF8数据。 请注意,kubectl的--append-hash功能不考虑binaryData。 使用此功能需要1.10+ apiserver和kubelets。 (#57938,@dims) 有关更多详细信息, ... -
如何将Configmap添加到StatefulSet中的特定Pod中?(How to add a Configmap to a specific Pod In a StatefulSet?)[2024-02-01]
你不能在同一个StatefulSet中将pod威胁为特殊的pod。 仅仅因为您只能指定一个适用于整个集合的单个PodSpec 。 你可以做什么,但它仍然是一个黑客,将所有版本的配置文件挂载到每个pod中,并运行基于pod名称使用不同配置文件的入口点脚本。 我没有示例可以显示,但它应该很容易 You can't threat a pod inside the same StatefulSet as a special pod. Simply because you can only specify a sin ... -
Kubectl更新configMap(Kubectl update configMap)[2024-05-09]
不,你不能。 替换为kubernetes将简单地替换该配置映射中的所有内容。 您不能只更新其中的一个文件或一个单独的属性。 但是,如果您使用客户端Api进行检查,则会发现您是否创建了大量文件的配置图。 然后,这些文件将被存储为一个HashMap,其中key是默认的文件名,value是文件内容编码为一个字符串。 因此,您可以根据HashMap中现有的键值对编写自己的函数。 这是我到目前为止发现的,如果你发现已经有了解决这个问题的方法,请让我知道:) 仅供参考,如果您只想更新一个或几个属性,则可以使用补丁。 但 ... -
您可以使用以下语法引用先前定义的环境变量: env: - name: LOG_LEVEL valueFrom: configMapKeyRef: name: my.configmap key: log.level - name: JAVA_OPTIONS value: -Dswarm.logging=$(LOG_LEVEL) 不知道这会启动Java选项,但是,我通常编辑图像,并调用一个entrypoint.sh文件,其中一些逻辑将存在,但它值得我尝试一个尝试。 Yo ...
-
是的,这是v1.1.1中的新行为。 PR #9165增加了优美删除的豆荚,导致它们在短时间内出现在“终止”状态。 问题#1535有更多的背景讨论。 Yes, it is new behavior in v1.1.1. PR #9165 added graceful deletion of pods, which causes them to appear in the "Terminating" state for a short amount of time. Issue #1535 has some m ...
-
对于Kubernetes的当前版本(1.6.x),这是不可能的。 正如kubectl create configmap的官方文档中kubectl create configmap : --from-file:可以使用文件路径指定密钥文件,在这种情况下,文件basename将用作configmap密钥,或者可选地使用密钥和文件路径,在这种情况下将使用给定密钥。 指定目录将迭代其basename为有效configmap键的目录中的每个命名文件。 当你想创建一个像这样使用的configmap时,作为envFrom ...
-
您不能在spec.template.spec.containers[0].ports[0].containerPort使用configmap值。我担心,这是配置值。 您可以使用它(在本指南中指定)的选项是 作为环境变量 作为命令行配置标志(使用环境变量) 使用卷插件。 如果要为部署/ pod配置端口,可以考虑使用Helm 。 Helm允许您在清单/定义中使用Go模板,然后您可以在调用时覆盖它们。 以此MySQL图表模板为例 ,您可以在此处将端口设置为配置选项,如下所示: ports: - name: m ...
-
(编辑:我花了一些时间才能完全开始工作)这适用于一个小型边车容器。 配置可能如下所示: apiVersion: extensions/v1beta1 kind: Deployment metadata: name: prometheus spec: replicas: 1 template: .... spec: containers: ... (your actual container config goes here) ... - n ...