- 博客(29)
- 收藏
- 关注
转载 Fisher判别分析
Fisher判别分析将高维度空间的样本投影到低维空间上,使得投影后的样本数据在新的子空间上有最小的类内距离以及最大的类间距离,使得在该子空间上有最佳的可分离性可以看出右侧投影后具有更好的可分离性。Fisher判别分析和PCA差别刚学完感觉两个很类似,实际上两个方法是从不同的角度来降维。PCA是找到方差尽可能大的维度,使得信息尽可能都保存,不考虑样本的可分离性,不具备预测功能。LAD(线性判别分析) 是找到一个低维的空间,投影后,使得可分离性最佳,投影后可进行判别以及对新的样本进
2020-07-14 16:03:27
951
转载 Python Tkinter Grid (网格布局管理器) 简明解释+代码
Grid(网格)布局管理器会将控件放置到一个二维的表格里。主控件被分割成一系列的行和列,表格中的每个单元(cell)都可以放置一个控件。什么时候使用Grid管理器grid管理器是Tkinter里面最灵活的几何管理布局器。如果你不确定什么情况下从三种布局管理中选择,你至少要保证自己会使用grid。当你设计对话框的时候,grid布局管理器是一个非常方便的工具。如果你之前使用pack进行...
2020-04-25 21:06:42
1739
转载 python3 socket 传输图片
server.py#!/usr/bin/env python# -*- coding=utf-8 -*-import socketimport threadingimport timeimport sysimport osimport structdef socket_service(): try: s = socket.socket(socket....
2020-04-25 20:50:53
780
转载 python socket 如何传输一个列表
Python中的 list 或者 dict 都可以转成JSON字符串来发送,接收后再转回来。client.py#!/usr/bin/env python# -*- coding: UTF-8 -*- import socketimport json address = ('127.0.0.1', 31500)s = socket.socket(socket.AF_IN...
2020-04-25 20:47:50
4628
4
原创 计网 停止等待协议模拟 python
写实验的日常~1.实现的功能(1)CRC编码,解码。(1)正常数据帧的通信过程(2)错误帧的通信过程(3)数据帧的丢失(4)超时情况计时器tip: GUI 使用tkinter 写的。2.结果展示3.结果解释客户端:(1)先随机生成长度为20的数据。 将数据截取成长度为10的数据段。即:当前数据分两次发送。(2)将要发送的数据进行crc编码,并...
2020-04-25 17:52:36
1441
1
原创 稀疏矩阵 csr \ coo 用法,及文件操作
一、coo矩阵:优点:比较容易转换成其他的稀疏矩阵存储格式(CSR等)缺点:不能进行矩阵运算。一般格式:coo_matrix((coo_data, (coo_rows, coo_cols)), shape=shape)例:>>> import numpy as np>>> import scipy.sparse as sp>...
2020-04-03 17:21:43
1688
1
原创 梯度下降法
梯度下降法1.引言梯度下降是迭代法的一种,可以用于求解最小二乘问题(线性和非线性都可以)。在求解机器学习算法的模型参数,即无约束优化问题时,梯度下降(Gradient Descent)是最常采用的方法之一。在求解损失函数的最小值时,可以通过梯度下降法来一步步的迭代求解,得到最小化的损失函数和模型参数值。反过来,如果我们需要求解损失函数的最大值,这时就需要用梯度上升法来迭代了。在机器学...
2019-08-11 16:20:50
142
原创 08 列表控件 ListCtrl
1.拖入List Ctrol2.属性View: report3.添加变量类别: Control 变量名: m_list1)添加默认值CString str[ ] = { TEXT("姓名"), TEXT(“性别”), TEXT(年龄“”) };//设置表头 参数1 索引 2.内容 3.对齐方式 4.列宽度for(iny i =- 0;i ...
2019-06-10 23:55:58
189
原创 comboBoxCtrl 下拉框
1.添加选项 Data 默认选项 Data 可乐;雪碧;美年达 不允许修改: type : Drop List 默认按照拼音排序,按设定排序: Sort : False2.添加变量:类别:Control 变量名:m_cbx3.在初始化函数(OnInitDialog())中//下拉框添加操作 m_cbx.AddSt...
2019-06-10 22:21:56
228
原创 编辑框 Editctrl
一。使用11.拖拽一个编辑框回车即退出,Dlg右键属性,重写,Onok;将代码注释。2.基础设置 支持换行Multiline 想要回车Want return 竖向无限: Anto VScroll 水平滚动条:Horizontal Scroll 垂直滚动条:Vertical Scroll3.复制编辑框 ctrl+拖拽...
2019-06-10 21:53:10
407
原创 1.4 静态文本StaticText
1.设置为呵呵1.先将需要设置的编辑框添加变量(如m_text)2.可在类视图中的DoDataExchang()中找到 及关联的变量3.点击按钮使变量变成"哈哈"m_text.SetWindowTextW(TEXT("哈哈")); //3、4按钮Botton相同4.获取变量并输出:CString str;m_text.GetWindowTextW(str);Mes...
2019-06-10 20:16:03
568
原创 MFC
视类始终覆盖在框架类之上(1)InitInstance函数: 程序的入口 app中(2)PreCreateWindow函数:frame中在程序创建之前,可修改窗口外观。(3)OnCreate函数创建窗口使用 Create函数,创建成功创建消息WM_Create,由OnCreate来响应这个消息。OnCreate不产生窗口,只是设置窗口的属性、风格、位置。(4)OnDra...
2019-06-10 14:41:39
159
原创 MFC入门 1.1消息机制
学习背景: 选了门叫高级可视化的选修课,以为是QT,上了才发现是MFC,懒得退了,周末学一下MFC。看的b站的学习资料,链接如下:https://www.bilibili.com/video/av20005978?p=2下面是学习笔记,转载的话附个链接嘛。SDK:第三方写好的工具包API: 为程序接口,团队交互时使用,Windows应用程序的API由C语言实现。(2)窗口...
2019-06-09 22:50:13
142
原创 Codeforces #563 (Div. 2) D. Ehab and the Expected XOR Problem (位运算)
链接:http://codeforces.com/contest/1174/problem/D总结:我是一只小菜鸡,叽叽叽。 建议做个位运算专题叭。思路:位运算 思考题设b[]为前缀异位和数组。首先我们知道: a[l] ^ a[l+1] ^......^ a[r] = b[r] ^ b[l-1] 。相邻al,al+1不能相等,相等异或为0不符合条件,所以每次i...
2019-06-09 16:02:05
140
原创 time库
time.time() # 获取到一个浮点数time.ctime # 获取到一个易读字符串time.gmtime #获取到一个系统可读的字符串time.strftime(tpl, ts) # tpl 定义输出效果的可视化模板字符串 # 一般(ts =time.gmmtime())time.strptime(times...
2019-02-18 02:15:21
134
原创 蟒蛇绘制练习01
import turtleturtle.setup(650,350,200,200)turtle.penup()turtle.speed(2)turtle.fd(-250)turtle.pendown()turtle.pensize(25)turtle.pencolor("purple")turtle.seth(-40)for i in range(4): turtle...
2019-02-15 15:22:55
217
原创 turtle库 的常规应用函数
# https://blog.youkuaiyun.com/zengxiantao1994/article/details/76588580import turtleturtle.setup(a,b,c,d) #turtle.penup() # turtle.pu()turtle.pendown() # turtle.pd()turtle.goto(x,y) #画笔到x,y...
2019-02-15 15:21:58
340
原创 温度转换
''' str=input()if str[-1] in ['c', 'C']: F = eval(str[0:-1]) * 1.8 + 32 print("{:.2f}.F".format(F))if str[-1] in ['c', 'C'] str[]'''tem=input()if tem[-1] in ['c','C'] : F = e...
2019-02-15 15:20:47
184
原创 无相邻重复字符串(广搜)
Krypton Factor You have been employed by the organisers of a Super Krypton Factor Contest in which contestants have very high mental and physical abilities. In one section of the contest the contesta...
2018-05-11 20:12:08
1251
原创 素数环
A ring is composed of n (even number) circles as shown in diagram.Put natural numbers 1, 2, . . . , n into each circle separately, and the sum of numbers in two adjacent circles should be a prime.Note...
2018-05-11 17:50:30
351
原创 除法(枚举)
Write a program that finds and displays all pairs of 5-digit numbers that between them use the digits 0through 9 once each, such that the first number divided by the second is equal to an integer N, w...
2018-05-06 20:23:27
356
转载 kmp优化
https://vjudge.net/contest/70325?utm_source=qq&utm_medium=social#problem/BProblem Description The French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter ‘e’. He
2018-05-05 00:56:42
292
转载 手链(字符串周期)
Problem Description CC always becomes very depressed at the end of this month, he has checked his credit card yesterday, without any surprise, there are only 99.9 yuan left. he is too distressed and t
2018-05-01 20:45:36
300
转载 kmpA
Given two sequences of numbers : a[1], a[2], …… , a[N], and b[1], b[2], …… , b[M] (1 <= M <= 10000, 1 <= N <= 1000000). Your task is to find a number K which make a[K] = b[1], a[K + 1] = b[2], …… , a[K
2018-04-25 19:01:36
205
转载 kmp模板
#include<iostream>#include<cstring>#include<cstdio>using namespace std;int next[1005];void tonext(char b[],int blen){ int k=-1,i; next[0]=-1; for(i=1;i<blen;i++)...
2018-04-25 18:59:02
82
转载 总统素数
将一个素数变成另一个素数,且过程均为素数 #include <iostream> #include <algorithm> #include <cstring> #include <cstdio> #include <math.h> #include <cstdlib> #include <queue>
2018-04-21 15:38:30
117
转载 0、1整除
题意:找出任意一个由0和1组成的数,而且是n的倍数。unsigned __int64可以存下结果,循环深度<20;两条搜索路径---t*10;t*10+1;#include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace s...
2018-04-21 00:06:02
296
转载 棋盘问题
在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。2 1#..#4 4...#..#..#..#...-1 -1#include<iostream>#include<cstdio>#include<...
2018-04-20 20:42:01
154
转载 抓牛
https://vjudge.net/contest/65959#problem/CFarmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line ...
2018-04-20 20:35:21
260
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人