平滑粗糙的地块(Smoothing out of rough plots)
我想在Matlab中绘制一些图。
细节:对于1类, p(x | c1)对于[2,4]之间的x是均匀的,参数a = 1且b = 4 。 对于类2 , p(x | c2)是指数的,参数lambda = 1 。 除了p(c1)= p(c2)= 0.5之外,我想绘制两个类密度的草图,分别乘以P(c1)和P(c2) ,作为x的函数,清楚地显示最优决策边界(或边界)。
我有解决这个问题的方法,这就是作者所做的( 我想得到 ),但是没有Matlab代码,所以我想自己做。
这就是我画的。
这是我写的MATLAB代码。
x=0:1:8; pc1 = 0.5; px_given_c1 = exppdf(x,1); px_given_c2 = unifpdf(x,2,4); figure; plot(x,px_given_c1,'g','linewidth',3); hold on; plot(x,px_given_c2,'r','linewidth',3); axis([0 8 0 0.5]); legend('P(x|c_1)','P(x|c_2)'); figure; plot(x,px_given_c1.*pc1,'g','linewidth',3); hold on; plot(x,px_given_c2.*(1-pc1),'r','linewidth',3); axis([0 8 0 0.5]); legend('P(x|c_1)P(c_1)','P(x|c_2)P(c_2)');
正如你所看到的,它们几乎是熟悉的,但我对这种均匀分布有问题,这是用红色绘制的。 我该怎么改变它?
I want to draw some plots in Matlab.
Details: For class 1, p(x|c1) is uniform for x between [2, 4] with the parameters a = 1 and b = 4. For class 2, p(x|c2) is exponential with parameter lambda = 1. Besides p(c1) = p(c2) = 0.5 I would like to draw a sketch of the two class densities multiplied by P(c1) and P(c2) respectively, as a function of x, clearly showing the optimal decision boundary (or boundaries).
I have the solution for this problem, this is what the writer did (and I want to get), but there's no Matlab code, so I want to do it all by myself.
And this is what I drew.
And this is the MATLAB code I wrote.
x=0:1:8; pc1 = 0.5; px_given_c1 = exppdf(x,1); px_given_c2 = unifpdf(x,2,4); figure; plot(x,px_given_c1,'g','linewidth',3); hold on; plot(x,px_given_c2,'r','linewidth',3); axis([0 8 0 0.5]); legend('P(x|c_1)','P(x|c_2)'); figure; plot(x,px_given_c1.*pc1,'g','linewidth',3); hold on; plot(x,px_given_c2.*(1-pc1),'r','linewidth',3); axis([0 8 0 0.5]); legend('P(x|c_1)P(c_1)','P(x|c_2)P(c_2)');
As you can see, they are almost smiliar, but I am having problem with this uniform distribution, which is drawn in red. How can I change it?
原文:https://stackoverflow.com/questions/13309089
最满意答案
根据用户运行Web服务(我不记得IIS6的默认值是什么,但怀疑它本质上是“NETWORK SERVICE”),如果它们受到保护,它将无法读取网络共享。 您最好的办法是为Web服务创建一个域帐户,然后使用“Internet信息服务(IIS)管理器”将应用程序池配置为以所述用户身份运行(注意:对于IIS 6,您还需要添加用户到LOCAL用户组“IIS_WPG”)。
一个小小的提示,你在整个问题中提到“网络驱动器”; 您的服务不会共享任何映射的网络驱动器,因此您需要为其提供完整的UNC路径(即
\\server\share
而不是m:\
)才能使其正常工作。Depending on the user the web service is being run as (I can't remember what the default for IIS6 is but suspect it's essentially "NETWORK SERVICE"), it won't be able to read network shares if they're secured. Your best bet is to create a domain account for the web service to run under and use "Internet Information Services (IIS) Manager" to configure the application pool to run as said user (NOTE: For IIS 6 youy'll also need to add the user to the LOCAL user group "IIS_WPG").
One small note, you mention "network drives" throughout your question; your service will not share any of your mapped network drives, so you'll need to provide it with full UNC paths (i.e.
\\server\share
rather thanm:\
) for it to work.
相关问答
更多-
从SAP Web IDE中的两个不同系统访问OData服务(Access OData services from two different system in SAP Web IDE)[2022-10-03]
如果'path'相同,则只匹配第一个。 为目的地设置不同的路径。 neo-app.json中的'path'属性只是目标的别名。 使用您的配置,这意味着,无论何时在您的应用中,您从'/ sap / opu / odata / ...'请求某些内容,应用程序将使用您在Destination中配置的URL覆盖路径的这一部分。 做这样的事情: { "path": "/ABC/sap/opu/odata", "target": { "type": "destination", "name" ... -
如何访问FirstData Web服务集成WSDL文件?(How to access the FirstData web service integration WSDL file?)[2024-01-12]
请将wsdl网址更正为https://www.staging.linkpointcentral.com/fdggwsapi/services/order.wsdl并尝试生成存根类。 我尝试在浏览器中,我能够生成Java存根。 Please correct the wsdl url to https://www.staging.linkpointcentral.com/fdggwsapi/services/order.wsdl and try generating the stub classes. I tr ... -
信不信由你,我只需要更改当前的.browser文件以适应各种浏览器。 这消除了主要错误,在Chrome中工作,但在IE11中没有。 我只是觉得得到一个示踪剂会有所帮助。 似乎这样做了 有关更多帮助,请参阅浏览器定义文件架构(浏览器元素) Believe it or not, I just had to change the current .browser file to accommodate the various browsers. This eliminated the main error, wo ...
-
如何从部署的Web应用程序访问本地文件系统上的文件?(how to access files on local file system from deployed web app?)[2023-09-09]
好的,看起来我找到了解决方案。 可以只使用具有绝对路径的File()对象,这样做。 我认为Web应用程序会有一些特殊要求,但看起来没有 Ok, looks like I found the solution. Can just use the File() object with absolute paths and that does the trick. I thought there would be some special requirements for web apps but it look ... -
系统必须属于同一网络,然后用URL中的托管系统的IP地址替换localhost URL "localhost:8080/webApp/services/Hello?wsdl" 成为托管Web服务的系统的IP = 192.111.111.111 URL "192.111.111.111:8080/webApp/services/Hello?wsdl" both the system have to belong to the same network then just replace the local ...
-
Azure中的情况有所不同。 基本上,您需要在角色的服务定义文件中指明和设置本地存储使用情况。 角色属性中有“本地存储”部分。 设置完成后,您可以通过调用RoleEnvironment.GetLocalResource并传入本地存储名称来访问代码中的本地存储。 然后,您可以读取和写入该本地存储。 以下是有关该主题的一些博文。 Windows Azure本地文件存储 - 如何指南和警告 与我一起学习Azure本地存储 Things are different in Azure. Basically you n ...
-
既然你用soap标记了这个问题,我将假设你想要一个Java的SOAP Web服务。 这也使JAX-WS (XML Web Services的Java API)成为库使用的自然选择。 Java(TM)Web服务教程将更详细地介绍您的问题。 现在,您将需要实现逻辑以获取图像并返回URL,并获取URL并返回图像。 @WebService public class MyJavaWebService { @WebMethod public String takeImage(byte[] image, ...
-
来自wso2 esb的本地文件系统的Web服务进程文件(Web service process file from local file system for wso2 esb)[2023-11-27]
我假设你不能得到这个统计数据,你需要自己做,但是为了替代,也许你可以在你的逻辑中使用ws调用成功/失败的状态,然后你可以通过提供的监视器功能获得这些由ESB。 I'm assume you cannot get this statistic, you need to do that by yourself, but for alternative, maybe you can use the status of the ws call success/failure instead in your logi ... -
根据用户运行Web服务(我不记得IIS6的默认值是什么,但怀疑它本质上是“NETWORK SERVICE”),如果它们受到保护,它将无法读取网络共享。 您最好的办法是为Web服务创建一个域帐户,然后使用“Internet信息服务(IIS)管理器”将应用程序池配置为以所述用户身份运行(注意:对于IIS 6,您还需要添加用户到LOCAL用户组“IIS_WPG”)。 一个小小的提示,你在整个问题中提到“网络驱动器”; 您的服务不会共享任何映射的网络驱动器,因此您需要为其提供完整的UNC路径(即\\server\s ...
-
如何从ServiceHost托管的IIS Web服务访问文件(How to access a file from IIS web service hosted by ServiceHost)[2021-10-26]
您需要将IHostingEnvironment注入到类中才能访问ApplicationBasePath属性值 假设IHostingEnvironment类型是env那么你可以使用 File.ReadAllText(env.WebRootPath + "/ConfigFile.json"); 就像你有一个名为Read的函数那么你可以使用 public void Read(IHostingEnvironment env) { File.ReadAllText(env.WebRootPath + "/Co ...