sw

周志华机器学习3_5线性判例分析 编程实现(python&matlab)

牧云@^-^@ 提交于 2020-01-06 21:35:29
作为小白一枚,在参考了大神们的代码(文末附链接)后首先利用python分别用两种方法进行了编程。编程结果与大神们的不一致,不知道是不是中间过程有问题。在阅读过程中如果看出问题,望能指出,谢谢大噶!(以下均将数据集中第15行数据去除后运行) 方法1:(利用sklearn库中的LDA函数) import pandas as pd ## import numpy as np import matplotlib . pyplot as plt from sklearn . discriminant_analysis import LinearDiscriminantAnalysis as LDA #数据读取 dataset = pd . read_csv ( 'watermelon1.csv' ) dataset = dataset . values X = dataset [ : , 1 : 3 ] y = dataset [ : , 3 ] #利用西瓜数据绘制散点图 fig = plt . figure ( ) plt . title ( 'wtatermelon30_a_sklearnlda' ) plt . xlabel ( 'density' ) plt . xlabel ( 'sugur_ratio' ) plt . scatter ( X [ y == 0 , 0 ] , X

Java-获取异常错误

佐手、 提交于 2020-01-06 11:27:06
public static String getStackTrace(Throwable throwable) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); try { throwable.printStackTrace(pw); return sw.toString(); } finally { pw.close(); } } 测试 public static void test() { try { int i = 0; int m = 10 / i; } catch (Exception e) { System.out.println(e.getMessage()); System.out.println("------调皮的分割线------"); System.out.println(ExceptionUtil.getStackTrace(e)); } } 来源: https://www.cnblogs.com/hyuxiang/p/12149011.html

搭建 SkyWalking 服务(For ElasticSearch 7)

半城伤御伤魂 提交于 2020-01-03 19:27:30
[TOC] 搭建 SkyWalking 服务(For ElasticSearch 7) 关于SkyWalking的基础使用参考: 基于 SkyWalking 实现服务链路追踪 官方文档: SkyWalking 文档中文版(社区提供) Apache SkyWalking 官方文档 下载压缩包 首先我们需要获取到SkyWalking的下载地址,官方下载地址如下: http://skywalking.apache.org/downloads/ 这里我选择当前最新的6.6.0版本的二进制包,由于一会需要对接的es服务版本为7.x,所以这里得选择for ElasticSearch 7: 复制下载地址到服务器上进行下载并解压,具体步骤如下: [root@localhost ~]# cd /usr/local/src [root@localhost /usr/local/src]# wget http://mirror.bit.edu.cn/apache/skywalking/6.6.0/apache-skywalking-apm-es7-6.6.0.tar.gz [root@localhost /usr/local/src]# mkdir ../skywalking && tar -zxvf apache-skywalking-apm-es7-6.6.0.tar.gz -C ..

界面操作

↘锁芯ラ 提交于 2019-12-23 17:57:38
1.需要匯入 System.Runtime.InteropServices 命名空間 2.宣告 ShowWindowAsync 函數 [DllImport("user32.dll")] private static extern bool ShowWindowAsync( IntPtr hWnd, int nCmdShow ); 3.宣告 ShowWindow函數 [DllImport("user32.dll")] public static extern int ShowWindow( int hwnd, int nCmdShow ); 4.宣告API常數定義 //API 常數定義 private const int SW_HIDE = 0; private const int SW_NORMAL = 1; private const int SW_MAXIMIZE = 3; private const int SW_SHOWNOACTIVATE = 4; private const int SW_SHOW = 5; private const int SW_MINIMIZE = 6; private const int SW_RESTORE = 9; private const int SW_SHOWDEFAULT = 10; 5.上述函數功能相同,都是用來設定視窗大小

H3C交换机配置链路聚合二层三层

▼魔方 西西 提交于 2019-12-17 00:22:44
二层聚合: 一、静态聚合 [SW]int Bridge-Aggregation 1 [SW-Ethernet1/0/1]port link-aggregation group 1 [SW-Ethernet1/0/2]port link-aggregation group 1 [SW-Bridge-Aggregation1]port link-type trunk [SW-Bridge-Aggregation1]port trunk permit vlan all 必须先加入端口再起Trunk,要不然会出错 二、动态聚合 [SW]int Bridge-Aggaregation 1 [SW-Bridge-Aggregation1]link-aggregation mode dynamic [SW-Ethernet1/0/1]port link-aggregation group 1 [SW-Ethernet1/0/2]port link-aggregation group 1 [SW-Bridge-Aggregation1]port link-type trunk [SW-Bridge-Aggregation1]port trunk permit vlan all 查看命令: display link-aggregation summary [S1]display link

2019 SDN上机第7次作业

半城伤御伤魂 提交于 2019-12-15 18:46:35
1.根据P4教程,将basic和basic_tunnel两个案例程序补充完整,成功运行。 (1)补充并运行basic代码 /* -*- P4_16 -*- */ #include <core.p4> #include <v1model.p4> const bit<16> TYPE_IPV4 = 0x800; /************************************************************************* *********************** H E A D E R S *********************************** *************************************************************************/ typedef bit<9> egressSpec_t; typedef bit<48> macAddr_t; typedef bit<32> ip4Addr_t; header ethernet_t { macAddr_t dstAddr; macAddr_t srcAddr; bit<16> etherType; } header ipv4_t { bit<4> version; bit<4> ihl; bit<8> diffserv

Oracle 11g Data Guard Switchover and Switchback – Active Data Guard Part-II

一个人想着一个人 提交于 2019-12-09 21:32:56
Oracle 11g Data Guard Switchover and Switchback – Active Data Guard Part-II Published 3 years ago by Jignesh Jethwa In my Previous article we have covered How to configured oracle 11g Data Guard on CentOS 6.5 , Now we will look into switchover and switch back activity: After configuring data guard, databases would be either primary and standby database role, and we can altered these roles without loss of data or without resetting logs. called switchover and switch back. Switchover: Before performing switchover, kindly verify the state of data guard on both the instances by following SQL

管理 Python基础系列讲解

妖精的绣舞 提交于 2019-12-09 15:28:21
python基础系列讲解-自动控制windows桌面 原链接: https://zhuanlan.zhihu.com/p/73001806 在使用PC时与PC交互的主要途径是看屏幕显示、听声音,点击鼠标和敲键盘等等。在自动化办公的趋势下,繁琐的工作可以让程序自动完成。比如自动化测试、自动下单交易等。很多软件除了可以GUI方式操作外还可以用CLI接口操作,不过当一些软件未提供CLI接口时,我们应该怎么办呢?我们还可以用程序控制桌面上的窗口、模拟点击鼠标或按下键盘等动作来释放自己。 pywin32是一个Python库,它为Python提供访问Windows API的扩展,提供了齐全的windows常量、接口、线程以及COM机制等等,安装后会自带一个pythonwin的IDE。接下来主要介绍下如何通过Python去操作windows桌面软件。 1、打开软件或文件 ,比如打开一个谷歌浏览器,或者打开一个word文件,如下所示: win32api.ShellExecute(1, 'open', r'C:Program Files (x86)GoogleChromeApplicationchrome.exe', '', '', 1) win32api.ShellExecute(1, 'open', r'C:UsersJayDesktopEnvironment Guider.docx', '',

【机器学习】激活函数(ReLU, Swish, Maxout)

一个人想着一个人 提交于 2019-12-09 13:25:11
https://blog.csdn.net/ChenVast/article/details/81382939 神经网络中使用激活函数来加入非线性因素,提高模型的表达能力。 ReLU(Rectified Linear Unit,修正线性单元) 形式如下: ReLU 公式近似推导:: 下面解释上述公式中的softplus,Noisy ReLU. softplus 函数与ReLU函数接近,但比较平滑, 同ReLU一样是单边抑制,有宽广的接受域(0,+inf), 但是由于指数运算,对数运算计算量大的原因,而不太被人使用.并且从一些人的使用经验来看(Glorot et al.(2011a)),效果也并不比ReLU好. softplus的导数恰好是sigmoid函数. softplus 函数图像 : Noisy ReLU 1 ReLU可以被扩展以包括高斯噪声(Gaussian noise): f(x)=max(0,x+Y),Y∼N(0,σ(x))f(x)=max(0,x+Y),Y∼N(0,σ(x)) Noisy ReLU 在受限玻尔兹曼机解决计算机视觉任务中得到应用. ReLU上界设置 : ReLU相比sigmoid和tanh的一个缺点是没有对上界设限.在实际使用中,可以设置一个上限,如ReLU6经验函数: f(x)=min(6,max(0,x))f(x)=min(6,max(0,x)).

WPF界面调用C++内核

若如初见. 提交于 2019-12-09 04:11:01
用WPF写界面,来调用C++内核,一直觉得很高深,到底是怎么实现的呢。。。 首先WPF界面上应该有相应的按钮(Button),而Button的对应事件处理函数中可以调用C++内核——其实就是C++程序编译链接后生成的可执行程序(.exe文件)。 而事件处理函数中该如何调用.exe文件呢?朋友说她只用了一个命令就是ShellExecute,于是我开始各种搜ShellExecute的用法,无意间也还看到了Process类的调用方法,于是写了那篇《 C#如何运行外部程序(打开可执行程序):ShellExcute和Process 》。 下面给出一个WPF调用C++内核的小例子: MainWindow.xaml <Window x:Class="WPFcallC__.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <StackPanel Name="sp1"> <Grid> <TextBox Height="25" Text = "{Binding Path=TextBoxValue}"