- 博客(81)
- 资源 (6)
- 收藏
- 关注
原创 Python打印99乘法表
for i in range(1,10): j=1 while(j<=i): print("{}*{}".format(j,i), end = " ") j+=1 print("\r\n")1*1 1*2 2*2 1*3 2*3 3*3 1*4 2*4 3*4 4*4 1*5 2*5 3*5 4*5 5*5 1*6 2*6 3*6 4*6 5*6 6*6 1*7 2*7 3*7 4*7 5*7 6*7 7*7 1*
2021-07-07 18:56:53
158
原创 【Andrew Gelman Data Analysis Using Regression and Multilevel/Hierarchical Models】4.9 exercises 解答
(部分不全)第一题Logarithmic transformation and regression: consider the following regression:log(weight) = −3.5+2.0 log(height) + errorwith errors that have standard deviation 0.25. Weights are in pounds and heights are in inches.(a) Fill in the blanks: app
2021-04-25 10:53:38
386
原创 【Andrew Gelman Data Analysis Using Regression and Multilevel/Hierarchical Models】3.9 exercises 解答
第一题The folder pyth contains outcome y and inputs x1, x2 for 40 data points, with a further 20 points with the inputs but no observed outcome. Save the file to your working directory and read it into R using the read.table() function.(a) Use R to fit a l
2021-04-22 12:45:36
336
原创 【统计学】R语言简单回归及其可视化
数据: kid.score mom.hs mom.iq1 91.18 164.75 121.502 70.00 167.86 102.003 80.00 165.00 107.004 93.31 163.71 110.005 98.00 179.25 120.006 99.00 172.00 123.007 92.88 169.93 126.248 95.87 158.00 114.569 93
2021-04-21 11:05:47
1377
2
原创 【Andrew Gelman Data Analysis Using Regression and Multilevel/Hierarchical Models】2.8 exercises 解答
自己写的答案,希望各位朋友们多加批评指正第一题A test is graded from 0 to 50, with an average score of 35 and a standard deviation of 10. For comparison to other tests, it would be convenient to rescale to a mean of 100 and standard deviation of 15.(a) How can the scores be l
2021-04-20 22:04:31
412
原创 爬虫学习笔记(一)
1、首先下载Anaconda2、在Anaconda中安装Jupyter notebook3、打开Jupyter notebook只需要在终端输入jupyter notebook4、打开一个网页,点新建,选择相应版本的python,我选择了python 35、在打开的网页编辑器上输入如下代码:import retest_string = "我是一个中国人。在学习爬虫。爬虫非常有趣。"regex = "爬虫"p_string = test_string.split("。")for line i
2020-11-02 17:17:21
66
转载 python网络爬虫笔记(一)
>>> import requests>>> r = requests.get("http://www.baidu.com")>>> r.status_code200>>> r.encoding = "utf-8" >>> r.text'<!DOCTYPE html>\r\n<!--STATUS OK--><html> <head><meta http-
2020-10-25 21:22:23
466
原创 问题(一)
OLS回归问题1、对以下式子的证明不理解:β^1=β1+∑i=1n(xi−x‾)uiSSTx=β1+1SSTx∑i=1ndiui\hat \beta_1= \beta_1 + \frac{\sum_{i=1}^n(x_i-\overline x)u_i}{SST_x}=\beta_1 +\frac{1}{SST_x}\sum_{i=1}^nd_iu_iβ^1=β1+SSTx∑i=1n(xi−x)ui=β1+SSTx1∑i=1ndiui证明:β^1=∑i=1n(xi−x‾)
2020-10-24 14:25:56
207
原创 错误: 无法载入程辑包‘Matrix’
下载r软件包的方法(如果普通方法不行的话)packageurl <- "https://cran.r-project.org/bin/macosx/contrib/4.0/Matrix_1.2-18.tgz"install.packages(packageurl, repos=NULL, type="source")
2020-10-17 16:45:40
2904
1
翻译 【Andrew Gelman多元统计】(基于R)
仿真n.sims <- 1000n.girls <- rep (NA, n.sims) for (s in 1:n.sims){n.girls[s] <- rbinom (1, 400, .488)} hist (n.girls)从400个婴儿中医院出生的女婴数量的1000个模拟值的直方图,这是根据二项式概率分布进行模拟的,概率为0.488。(每次模拟的图像都略有不同)从模拟结果看到女孩出生数量的分布主要集中在190-210。如果我们要一个医院中女孩的个数,需要考虑会影响
2020-10-09 14:03:56
306
原创 【C语言】PTA二分查找
本题要求实现二分查找算法。函数接口定义:Position BinarySearch( List L, ElementType X );其中List结构定义如下:typedef int Position;typedef struct LNode *List;struct LNode { ElementType Data[MAXSIZE]; Position Last; /* 保存线性表中最后一个元素的位置 */};L是用户传入的一个线性表,其中ElementType元素可以通
2020-09-04 10:59:10
1285
原创 【殷人昆数据结构】第五章5.6 哈夫曼树Huffman代码的调试
哈夫曼树Huffman文章目录哈夫曼树Huffman哈夫曼树的作用主函数data.txt结果:HuffmanNode类定义HuffmanTree树类定义构造函数deleteTree函数output函数mergeTree函数整一个头文件概念:路径长度两个结点之间的路径长度 PL 是连接两结点的路径上的分支数。树的外部路径长度是各叶结点(外结点)到根结点的路径长度之和 EPL。树的内部路径长度是各非叶结点(内结点)到根结点的路径长度之和 IPL。树的路径长度 PL = EPL + IPL。n 个结
2020-09-02 17:15:34
308
1
原创 【殷人昆数据结构】第五章5.5 最大堆MinHeap代码的调试
最大堆MinHeap文章目录最大堆MinHeap主函数MinHeap最大堆类定义构造函数siftDown函数——下滑调整法siftUp函数——上滑调整算法Insert函数——将x插入最大堆RemoveMax函数整一个头文件主函数#include <fstream>#include "MaxHeap.h"using namespace std;int main(){ ifstream fin("data.txt"); assert(fin); int n; assert(fin
2020-09-01 14:10:34
86
原创 【殷人昆数据结构】第五章5.4 最小堆MinHeap代码的调试
最小堆MinHeap文章目录最小堆MinHeap主函数MinHeap最小堆类定义构造函数siftDown函数siftUp函数Insert函数RemoveMin函数——最小元素的删除整一个头文件data.txt:853 17 78 09 45 65 87 23主函数#include <fstream>#include "MinHeap.h"using namespace std;int main(){ ifstream fin("data.txt"); assert(fin
2020-09-01 11:24:20
197
原创 【殷人昆数据结构】第五章5.3 树的子女-兄弟表示Tree代码的调试
树的子女-兄弟表示Tree文章目录树的子女-兄弟表示Tree主函数树结点类定义Tree类定义RootParent与FindParent函数FirstChild函数NextSiblingPreOrder函数PostOrder函数LevelOrder 函数——层次遍历Find函数RemovesubTree函数IntendedText 函数Output函数ShowTree函数Createtree整一个头文件主函数#include "Tree.h"#include <fstream>#incl
2020-08-31 20:33:53
224
原创 【殷人昆数据结构】第五章5.2 线索树Treaded Binary Tree代码的调试
线索树Treaded Binary Tree主函数#include <iostream>using namespace std;#define eptmark '$'#include "ThreadTree.h"#include "ThreadTree.cpp"template<class T>void visit(ThreadNode<T> *p) { cout << p -> data << ' ';}int ma
2020-08-30 09:55:43
76
原创 【殷人昆数据结构】第四章5.1 完全二叉树BinaryTree代码的调试
二叉树BinaryTree主函数#include "BinaryTree.h"#include <iostream>#include <fstream>#include <iomanip>using namespace std;void visit(BinTreeNode<int> *t){ cout<<t->data<<" ";}int main(){ ifstream fin("data.txt"
2020-08-30 06:46:26
593
原创 【殷人昆数据结构】第四章4.3 稀疏矩阵SparseMatrix代码的调试
稀疏矩阵SparseMatrix主函数#include <iostream>#include "SparseMatrix.h"#include "SparseMatrix.cpp"using namespace std;int main(){ cout<<"+---------------------------------------------------------------+"<<endl; cout<<"#1 Construct
2020-08-27 17:05:38
717
原创 【殷人昆数据结构】第四章4.2 广义表Generalized List代码的调试
广义表Generalized List广义表是在顺序表SeqList的基础上来的,主函数#include "GenList.h"#include <fstream>#include <string>#include <cassert>using namespace std;int main(){ ifstream fin1("data.txt"); assert(fin1); string str; fin1 >> str; cou
2020-08-26 15:17:18
261
原创 【殷人昆数据结构】第四章4.1 字符串数组AString代码的调试
AString字符串数组又是字符串数组。主函数#include "AString.h"#include <iostream>using namespace std;int main(){ cout << "Please input a string : "; AString str; cin >> str; cout << "The length of the string is: " << str.Length() <
2020-08-23 23:49:05
323
原创 【殷人昆数据结构】第三章3.5 优先级队列Priority Queue代码的调试
Priority Queue优先级队列主函数#include <fstream>#include <cassert>#include "PQueue.h"using namespace std;int main(){ ifstream fin("data.txt"); assert(fin); PQueue<int> que; int data; while (!fin.eof()) { assert(fin >> data);
2020-08-23 17:00:48
128
原创 【殷人昆数据结构】第二章3.4 链式队列LinkedQueue代码的调试
LinkedQueue链式队列主函数#include <fstream>#include "LinkedQueue.h"using namespace std;int main(){ ifstream fin("data.txt"); assert(fin); LinkedQueue<int> que; int data; while (!fin.eof()){ assert(fin >> data); que.EnQueue(data);
2020-08-23 09:54:28
477
原创 【殷人昆数据结构】第二章3.3 顺序队列SeqQueue代码的调试
Queue队列队列是只允许在一端删除,在另一端插入的线性表允许删除的一端叫做队头(front),允许插入的一端叫做队尾(rear)。特性先进先出(FIFO, First In First Out)顺序队列SeqQueue主函数#include "SeqQueue.h"#include <fstream>#include <cassert>using namespace std;int main(){ ifstream fin("data.txt"); as
2020-08-23 08:41:40
697
原创 【殷人昆数据结构】第二章3.2 链式栈LinkedStack代码的调试
LinkedStack链式栈链式栈无栈满问题,空间可扩充插入与删除仅在栈顶处执行链式栈的栈顶在链头适合于多栈操作主函数#include "LinkedStack.h"#include <fstream>#include <cassert>using namespace std;int main(){ LinkedStack<int> sta; ifstream fin("data.txt"); assert(fin); int data; w
2020-08-22 14:33:38
288
原创 【殷人昆数据结构】第三章3.1 顺序栈的调试
SeqStack顺序栈主函数#include "SeqStack.h"#include <fstream>#include <cassert>using namespace std;int main(){ SeqStack<int> sta; ifstream fin("data.txt"); assert(fin); int data; while (!fin.eof()){ assert(fin >> data); sta.P
2020-08-22 10:17:17
360
原创 【殷人昆数据结构】第二章2.4 双向链表代码的调试
Circular List双向链表主函数#include "DblList.h"#include <fstream>#include <cassert>using namespace std;int main(){ DblList<int> list(-1); ifstream fin("list.txt"); assert(fin); fin >> list; cout << "The initial list in th
2020-08-21 23:14:42
107
原创 【殷人昆数据结构】第二章2.3 循环链表代码的调试
Circular List循环链表????文件:主函数:#include <fstream>#include "CircList.h"using namespace std;int main(){ CircList<int> list; ifstream fin("list.txt"); assert(fin); fin >> list; cout << "The initial list in the file is:\n" &
2020-08-21 22:13:56
224
原创 【殷人昆数据结构】第二章2.2 单链表代码的调试
Single Linked List单链表文件:主函数:#include <fstream> //调用文件输入输出流类#include "LinkedList.h" //调用单链表头文件using namespace std; //声明命名空间int main(){ List<int> list; //实例化类List ifstream fin("list.txt"); //这里将输入文件设为ifstream类型 assert(fin);
2020-08-21 12:00:32
267
原创 【殷人昆数据结构】第二章2.1 顺序表代码的调试
SeqList文件:程序功能:输入#include "SeqList.h"#include <fstream>#include <cassert>using namespace std;int main(){ SeqList<int> list(10); //实例化SeqList类为int型,分配10个动态结点给list ifstream fin("list.txt"); //调用文件输入流ifstream,将txt输入缓存区fin
2020-08-20 16:34:36
406
原创 【头文件】代码解释
头文件中的#ifndef SEQLIST_H#define SEQLIST_H....#endif的作用是防止多重调用后,类被重复编译出现编译出错的问题。参考https://blog.csdn.net/qq_17034717/article/details/77482705#include <cstdlib>#include <cassert>标准C++中关于C语言头文件的一个重新包装头文件,它将所有C头文件中的函数封装进std名字空间C语言 C++语言std
2020-08-20 09:22:23
251
原创 【C++】面向对象编程基础要点-下(最全)
承接上文:(声明:部分内容来源于MOOC农业大学网课)久、流类库与文件读写C++语言将数据输入内存,或将某个内存变量输出到显示器的过程,看作数据流动的过程。键盘是一种提供数据的数据源,显示器则是输出数据的目的地。C++将提供输入数据的数据源称作输入数据流,将输出数据时的目的地称作输出数据流,这两者统称为输入输出流。C语言通过输入/输出函数实现了数据的输入/输出。C++本身没有输入输出语句,是以输入输出流类,为程序员提供输入输出的功能。C++语言提供了多个输入输出流类,可以实现不同的输入输出功能。这些
2020-08-16 10:07:52
176
Instabilities of Regression Estimates Relating Air Pollution to Mortality
2021-04-23
【andrew gelman Data Analysis Using Regression and Mult】2.8 exercise solution.zip
2021-04-21
Linear Algebra Done Right Solutions Manual by Sheldon Axler (z-lib.org).pdf
2020-07-05
Linear Algebra Done Right by Sheldon Axler (z-lib.org).pdf
2020-07-05
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人