- 博客(17)
- 资源 (3)
- 问答 (1)
- 收藏
- 关注
原创 朴素贝叶斯
import numpy as npimport mathdef bagOfWord2VecMN(vocabList,inputSet): returnVec=[0]*len(vocabList) for word in inputSet: if word in vocabList: returnVec[vocabList.index(...
2018-12-31 10:36:15 118
原创 决策树学习1
#原代码来自机器学习实战,注释及改动原创from math import logimport operatorimport KNNdef createDataSet(): dataSet=[[1,1,'yes'] ,[1,1,'yes'], [1,0,'no'], [0,1,'no'] ...
2018-12-30 11:51:09 180
原创 KNN学习笔记1
#学习自机器学习实战,部分更改来自自己from numpy import*import operatorimport matplotlibimport matplotlib.pyplot as pltdef createDataset(): group=array([[1.0,1.1],[1.0,1.0],[0,0],[0,0.1]]) labels=['A' ,'A'...
2018-12-29 22:44:50 251
原创 机器调度问题,请不吝赐教
#include <iostream>#include <cmath>#include <vector>#include <algorithm>using namespace std;const int N = 101;struct node{ int val; int id;};bool cmp(node a, n...
2018-12-23 15:53:55 364
原创 简单树
#include <iostream>#include <cmath>#include <string>using namespace std;const int F = 3;struct node{ string s; node *parent, *child[F]; int val;};struct tree { ...
2018-12-21 13:27:21 460
原创 带缓冲的火车车厢重排,我是这么做的,欢迎指教
#include <iostream>#include <cmath>#include <string>#include <stack>#include<queue>using namespace std;const int N = 105;int dir[4][2] = { 0,1,1,0,0,-1,-1,0};...
2018-12-16 15:54:58 321
原创 简单迷宫问题
#include <iostream>#include <cmath>#include <string>#include <stack>#include<queue>using namespace std;const int N = 105;int dir[4][2] = { 0,1,1,0,0,-1,-1,0};...
2018-12-16 15:20:47 296
原创 堆栈迷宫搜索
#include <iostream>#include <cmath>#include <string>#include <stack>using namespace std;const int N = 105;int dir[4][2] = { 0,1,1,0,0,-1,-1,0};struct P { int x,...
2018-12-15 17:43:41 258
原创 简单火车车厢重排
#include <iostream>#include <cmath>#include <string>using namespace std;const int N = 105;int st[N];int main(){ int n; cin >> n; int sp[N]; for (int i =...
2018-12-15 17:04:10 547
原创 汉诺塔
#include <iostream>#include <cmath>#include <string>using namespace std;const int N = 105;void hanio(char a, char b, char c, int n){ if (n == 1) { cout <<...
2018-12-15 14:57:25 96
原创 括号匹配
#include <iostream>#include <cmath>#include <string>using namespace std;const int N = 105;struct node { int xs[N]; int val; node() { for (int i = 0; i &l...
2018-12-15 14:48:37 130
原创 凸包
#include <iostream>#include <cmath>#include <opencv2/opencv.hpp>#include <opencv2/highgui/highgui.hpp>#include <opencv2/imgproc/imgproc.hpp>using namespace std;usin...
2018-12-14 14:05:42 132
原创 箱子排序
#include "Matrix.h"const int N = 105;int a[N];int main(){ int n; cin >> n; int mx, mn; cin >> a[0]; mn = mx = a[0]; for (int i = 1; i < n; i++) { ...
2018-12-13 15:38:16 259
原创 基数排序
#include "Matrix.h"const int N = 105;int a[N];void srotbase(int bas,int n){ int out[N]; int buck[11]; buck[10] = 0; for (int i = 0; i < 10; i++) buck[i] = 0; for (in...
2018-12-13 15:27:22 114
原创 简单并查集
#include "Matrix.h"const int N = 105;int x[N];int pre[N];void init(int n){ for (int i = 0; i < n+1; i++) pre[i] = i;}int findf(int x){ if (pre[x] == x) return x; return ...
2018-12-13 14:56:02 115
原创 排序
#include <iostream>using namespace std;const int N = 10;int mark[N];int x[N];int main(){ int n; cin >> n; for (int i = 0; i < n; i++) { cin >> x[i];...
2018-12-12 17:33:51 110
原创 递归实现全排序
#include <iostream>using namespace std;const int N = 1000;int vis[N];int val[N];void print(int n,int* x,int l){ int i; bool flag = false; for (i = 0; i < n; i++) { ...
2018-12-12 17:24:05 904
BP神经网络,relu做激活函数,求大神帮忙
2019-01-10
TA创建的收藏夹 TA关注的收藏夹
TA关注的人