-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.xml
1622 lines (780 loc) · 768 KB
/
search.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="utf-8"?>
<search>
<entry>
<title>C++基于getline的split实现</title>
<link href="/2021/05/10/c-%E5%9F%BA%E4%BA%8Egetline%E7%9A%84splite%E5%AE%9E%E7%8E%B0/"/>
<url>/2021/05/10/c-%E5%9F%BA%E4%BA%8Egetline%E7%9A%84splite%E5%AE%9E%E7%8E%B0/</url>
<content type="html"><![CDATA[<h1 id="前言"><a class="markdownIt-Anchor" href="#前言"></a> 前言</h1><p>C++ 作为老大哥竟然一直不支持 split ,在看程设模拟的时候发现了可以通过 getline 优雅的实现 split。</p><h1 id="代码"><a class="markdownIt-Anchor" href="#代码"></a> 代码</h1><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br></pre></td><td class="code"><pre><span class="line"><span class="function">vector<string> <span class="title">split</span><span class="params">(<span class="keyword">const</span> string& s, <span class="keyword">char</span> c)</span> </span>{ <span class="comment">//分隔文件名</span></span><br><span class="line"> vector<string> res;</span><br><span class="line"> string tmp;</span><br><span class="line"> <span class="function">stringstream <span class="title">ss</span><span class="params">(s)</span></span>;</span><br><span class="line"> <span class="keyword">while</span> (<span class="built_in">getline</span>(ss, tmp, c)) res.<span class="built_in">push_back</span>(tmp); <span class="comment">//res保存整体</span></span><br><span class="line"> <span class="keyword">return</span> res;</span><br><span class="line">}</span><br><span class="line"><span class="comment">// std::vector<std::string> split(const std::string& line, char c) {</span></span><br><span class="line"><span class="comment">// std::stringstream stm(line);</span></span><br><span class="line"><span class="comment">// std::vector<std::string> ans;</span></span><br><span class="line"><span class="comment">// std::string tmp;</span></span><br><span class="line"><span class="comment">// while (std::getline(stm, tmp, c)) ans.push_back(tmp);</span></span><br><span class="line"><span class="comment">// return ans;</span></span><br><span class="line"><span class="comment">// }</span></span><br><span class="line"><span class="function"><span class="keyword">int</span> <span class="title">main</span><span class="params">()</span> </span>{</span><br><span class="line"> <span class="comment">// ios::sync_with_stdio(false);</span></span><br><span class="line"> <span class="comment">// cout.tie(NULL);</span></span><br><span class="line"> string s;</span><br><span class="line"> <span class="keyword">while</span> (cin >> s) {</span><br><span class="line"> vector<string> V = <span class="built_in">split</span>(s, <span class="string">'/'</span>);</span><br><span class="line"> cout << V.<span class="built_in">size</span>() << <span class="string">" "</span>;</span><br><span class="line"> <span class="keyword">for</span> (<span class="keyword">auto</span>& it : V) {</span><br><span class="line"> cout << it << <span class="string">" "</span>;</span><br><span class="line"> }</span><br><span class="line"> cout << endl;</span><br><span class="line"> }</span><br><span class="line"> <span class="keyword">return</span> <span class="number">0</span>;</span><br><span class="line">}</span><br></pre></td></tr></table></figure><h2 id="input"><a class="markdownIt-Anchor" href="#input"></a> input</h2><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">a/bb/cc</span><br><span class="line">a/bb/cc/</span><br><span class="line">a/bb/cc-c//c</span><br></pre></td></tr></table></figure><h2 id="output"><a class="markdownIt-Anchor" href="#output"></a> output</h2><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">3 a bb cc </span><br><span class="line">3 a bb cc </span><br><span class="line">5 a bb cc-c c </span><br></pre></td></tr></table></figure><h1 id="解释"><a class="markdownIt-Anchor" href="#解释"></a> 解释</h1><p><code>basic_istream& getline( char_type* s, std::streamsize count, char_type delim );</code></p><p>从流释出字符,直至<strong>行尾</strong>或<strong>指定的分隔符</strong> <code>delim</code> 。</p><p>参考链接:</p><p><a href="https://zh.cppreference.com/w/cpp/io/basic_istream/getline">cppreference</a></p>]]></content>
<categories>
<category> C++ </category>
</categories>
<tags>
<tag> C++ </tag>
</tags>
</entry>
<entry>
<title>在64位Linux环境中运行Nachos3.4</title>
<link href="/2021/03/31/%E5%9C%A864%E4%BD%8DLinux%E7%8E%AF%E5%A2%83%E4%B8%AD%E8%BF%90%E8%A1%8CNachos3-4/"/>
<url>/2021/03/31/%E5%9C%A864%E4%BD%8DLinux%E7%8E%AF%E5%A2%83%E4%B8%AD%E8%BF%90%E8%A1%8CNachos3-4/</url>
<content type="html"><![CDATA[<h1 id="操作过程"><a class="markdownIt-Anchor" href="#操作过程"></a> 操作过程</h1><p>操作过程如下(以64位Ubuntu为例):</p><h2 id="检查系统是否支持多架构"><a class="markdownIt-Anchor" href="#检查系统是否支持多架构"></a> 检查系统是否支持多架构</h2><h3 id="1-确认主机系统为64位架构的内核"><a class="markdownIt-Anchor" href="#1-确认主机系统为64位架构的内核"></a> (1) 确认主机系统为64位架构的内核</h3><p>在命令终端中运行 <code>dpkg--print-architecture</code>,应该输出amd64</p><h3 id="2-确认系统多架构功能已经打开以支持1386"><a class="markdownIt-Anchor" href="#2-确认系统多架构功能已经打开以支持1386"></a> (2) 确认系统多架构功能已经打开,以支持1386</h3><p>在命令终端中运行 <code>dpkg--print-foreign-architectures</code>,应该输出i386</p><h3 id="如果2中检测到多架构功能尚未打开则使用下述命令安装"><a class="markdownIt-Anchor" href="#如果2中检测到多架构功能尚未打开则使用下述命令安装"></a> 如果(2)中检测到多架构功能尚未打开,则使用下述命令安装</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo dpkg--add-architecture i386</span><br></pre></td></tr></table></figure><h2 id="安装32位编译环境与支持库"><a class="markdownIt-Anchor" href="#安装32位编译环境与支持库"></a> 安装32位编译环境与支持库</h2><h3 id="1-检查gcc与g是否已经安装如果尚未安装使用如下命令安装它们"><a class="markdownIt-Anchor" href="#1-检查gcc与g是否已经安装如果尚未安装使用如下命令安装它们"></a> (1) 检查gcc与g++是否已经安装,如果尚未安装,使用如下命令安装它们。</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo apt install gcc g++</span><br></pre></td></tr></table></figure><p>(2)安装32位编译环境与支持库</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo apt install build-essential g++-multilib gcc-multilib</span><br></pre></td></tr></table></figure><h2 id="修改nachos"><a class="markdownIt-Anchor" href="#修改nachos"></a> 修改Nachos</h2><h3 id="1-修改code目录下的makefiledep文件"><a class="markdownIt-Anchor" href="#1-修改code目录下的makefiledep文件"></a> (1) 修改code目录下的Makefile.dep文件</h3><p>在C++的编译器CC与链接器LD后追加<code>-m32</code>,在汇编编译器AS后追加<code>--32</code>,修改后的内容如下所示:</p><figure class="highlight makefile"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">ifndef</span> MAKEFILE_DEP</span><br><span class="line"><span class="keyword">define</span> MAKEFILE_DEP</span><br><span class="line">yes</span><br><span class="line"><span class="keyword">endef</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># These definitions may change as the software is updated.</span></span><br><span class="line"><span class="comment"># Some of them are also system dependent</span></span><br><span class="line">CPP=/lib/cpp</span><br><span class="line">CC = g++ -m32</span><br><span class="line">LD = g++ -m32</span><br><span class="line">AS = as --32</span><br><span class="line"></span><br><span class="line">uname = <span class="variable">$(<span class="built_in">shell</span> uname)</span></span><br><span class="line"><span class="variable">$(<span class="built_in">warning</span> <span class="variable">$(uname)</span>)</span></span><br></pre></td></tr></table></figure><h3 id="2-修改codebincoffh"><a class="markdownIt-Anchor" href="#2-修改codebincoffh"></a> (2) 修改code/bin/coff.h</h3><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/* coff.h</span></span><br><span class="line"><span class="comment"> * Data structures that describe the MIPS COFF format.</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"></span><br><span class="line"><span class="meta">#<span class="meta-keyword">ifdef</span> HOST_ALPHA<span class="comment">/* Needed because of gcc uses 64 bit long */</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">define</span> _long int<span class="comment">/* integers on the DEC ALPHA architecture. */</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">else</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">define</span> _long int <span class="comment">// 修改为 #define _long int</span></span></span><br><span class="line"><span class="meta">#<span class="meta-keyword">endif</span></span></span><br></pre></td></tr></table></figure><p>文件<code>code/bin/coff.h</code>中的几条语句如下所示:<br />在32位环境中,宏命令<code>#define _longlong</code>将<code>_long</code>定义为<code>long</code>,系统为<code>long</code>类型数据分配4字节存储空间,因此结构<code>filehdr</code>的大小为20字节,而在64位系统中,由于数据类型<code>long</code>需要8字节存储空间,导致<code>filehdr</code>占用了40字节。而Nachos中要求<code>filehdr</code>大小必须为20字节,因此需要将<code>code/bin/coff.h</code>中的<code>long</code>改成<code>int</code>,即将<code>#define _long long</code>修改为<code>#define _long int</code>。</p><h1 id="64位下的一些问题"><a class="markdownIt-Anchor" href="#64位下的一些问题"></a> 64位下的一些问题</h1><p>由于使用的是64位操作系统。编译器版本要高于gcc3.4。会出现一些c++版本的问题</p><h2 id="问题1warning-iso-c-forbids-converting-a-string-constant-to-char-wwrite-strings"><a class="markdownIt-Anchor" href="#问题1warning-iso-c-forbids-converting-a-string-constant-to-char-wwrite-strings"></a> 问题1:warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20210331010106123.png" alt="img" /></p><p>这是由于c<ins>规范中认为<code>"aaa"</code>是string类型,,c</ins>03前<code>string</code> to <code>char const *</code>会发生隐式转换。从c++11开始,该规则删除。</p><p>对类似字符串做如下更改:</p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20210331010305677.png" alt="img" /></p><p>参考链接:<a href="https://stackoverflow.com/questions/20944784/why-is-conversion-from-string-constant-to-char-valid-in-c-but-invalid-in-c">Why is conversion from string constant to ‘char*’ valid in C but invalid in C++</a></p><h2 id="问题2warning-deleting-void-is-undefined-wdelete-incomplete"><a class="markdownIt-Anchor" href="#问题2warning-deleting-void-is-undefined-wdelete-incomplete"></a> 问题2:warning: deleting ‘void*’ is undefined [-Wdelete-incomplete]</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20210331010427207.png" alt="" /></p><p>这是由于在现代c<ins>中,删除void *指针是一种错误格式(也就是我们通常所说的“编译错误”)。在c</ins> 98中情况就不同了。删除void *类型的空指针是NOP,删除void *类型的非空指针是UB。</p><p>解决方法:注释掉</p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20210331011346542.png" alt="" /></p><p>参考链接:<a href="https://stackoverflow.com/questions/50843120/why-deleting-void-is-ub-rather-than-compilation-error">Why deleting void* is UB rather than compilation error?</a></p><h2 id="问题3cc1plus-note-obsolete-option-i-used-please-use-iquote-instead"><a class="markdownIt-Anchor" href="#问题3cc1plus-note-obsolete-option-i-used-please-use-iquote-instead"></a> 问题3:cc1plus: note: obsolete option ‘-I-’ used, please use ‘-iquote’ instead</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20210331010654999.png" alt="img" /></p><p><code>-iquote</code>是在GCC 4.0.0 中添加的。GCC开发人员在90年代中期错误的取消了<code>-I-</code>。但<code>-iquote</code>并不能完全代替<code>-I-</code>(没有很好的解决方法)。</p><p>参考链接:<a href="https://github.com/att/ast/issues/20">cc1: note: obsolete option -I- used, please use -iquote instead #20</a></p><h2 id="问题4-warning-multi-line-comment-wcomment"><a class="markdownIt-Anchor" href="#问题4-warning-multi-line-comment-wcomment"></a> 问题4: warning: multi-line comment [-Wcomment]</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20210331103552047.png" alt="image-20210331103552047" /></p><p>在C/C++语言中,<br />在对源文件做预处理的时候,有两条基本原则:</p><ol><li><p>凡是以//开头的为单行注释</p></li><li><p>凡是以\结尾的代表此行尚未结束</p></li></ol><p>于是预处理器在处理的时候会先按第二条规则,看每行的末尾的那个字符是不是”\”,是的话,就下一行接到本行。然后把所有以//开头的注释和/* */的块注释去掉。</p><p>但是存在一个问题,对于big5中的汉字而言,其第一个字节的编码范围是0xA1 - 0xFE,第二个字节是0×40 -0xFE。而’'的ASCII码是0×5c.这就意味这,凡是以big5编码的文件,如果gcc没有正确的认为它源文件的编码是big5,那么就可能出现因为单行注释末尾是汉字,而把下行的代码吃掉的情况。这样是很危险的,但是gcc会给出一个警告:”warning: multi-linecomment In file”</p><p>解决方法,改用:</p><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/*</span></span><br><span class="line"><span class="comment">*/</span></span><br></pre></td></tr></table></figure><p>参考链接:</p><p><a href="https://blog.csdn.net/lyd0813/article/details/83023918">c语言中的注释,multi-line comment</a></p><p><a href="https://stackoverflow.com/questions/19105350/what-is-the-meaning-of-multi-line-comment-warnings-in-c">What is the meaning of multi-line comment warnings in C?</a></p>]]></content>
<categories>
<category> 操作系统 </category>
</categories>
<tags>
<tag> 操作系统 </tag>
</tags>
</entry>
<entry>
<title>illumination, shading, rendering的区别</title>
<link href="/2021/01/01/illumination-shading-rendering%E7%9A%84%E5%8C%BA%E5%88%AB/"/>
<url>/2021/01/01/illumination-shading-rendering%E7%9A%84%E5%8C%BA%E5%88%AB/</url>
<content type="html"><![CDATA[<h1 id="答案"><a class="markdownIt-Anchor" href="#答案"></a> 答案</h1><ul><li>Illumination 理解成光照的情况,是输入的量;</li><li>Shading 是着色,计算一个点在光照之后看上去长什么样;</li><li>Rendering 是整个渲染过程,包括解 light transport 用到的各种光线追踪,也包括之后的着色过程。</li></ul><h1 id="参考链接"><a class="markdownIt-Anchor" href="#参考链接"></a> 参考链接</h1><p><a href="http://games-cn.org/forums/topic/illumination-shading-renderingdequbie/">games101</a></p>]]></content>
<categories>
<category> 图形学 </category>
</categories>
<tags>
<tag> 图形学 </tag>
</tags>
</entry>
<entry>
<title>NTFS, FAT32和exFAT文件系统有什么区别?</title>
<link href="/2020/12/17/NTFS-FAT32%E5%92%8CexFAT%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F%E6%9C%89%E4%BB%80%E4%B9%88%E5%8C%BA%E5%88%AB%EF%BC%9F/"/>
<url>/2020/12/17/NTFS-FAT32%E5%92%8CexFAT%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F%E6%9C%89%E4%BB%80%E4%B9%88%E5%8C%BA%E5%88%AB%EF%BC%9F/</url>
<content type="html"><![CDATA[<p>NTFS是目前Windows系统中一种现代文件系统,目前使用最广泛,内置的硬盘大多数都是NTFS格式。FAT32是一种相对老旧的文件系统,不能像NTFS格式支持很多现代文件格式的属性,但对于不同系统平台具有良好的兼容性,可以在Linux、Mac或Android系统平台上通用。exFAT是FAT32文件格式的替代品,很多设备和操作系统都支持该文件系统,但是目前用的不多。</p><hr /><p>1、FAT32文件格式是一种通用格式,任何USB存储设备都会预装该文件系统,可以在任何操作系统平台上使用。最主要的缺陷是只支持最大单文件大小容量为4GB(<strong>索引节点表的问题</strong>),因此日常使用没有问题,只有在传输大文件时才会显现出缺点。</p><p>2、exFAT文件是微软自家创建的用来取代FAT32文件格式的新型文件格式,它最大可以支持1EB的文件大小,非常适合用来存储大容量文件,还可以在Mac和Windows操作系统上通用。虽然是微软的技术,苹果批准在系统中使用该文件格式,因此在Mac系统中格式化存储设备时会出现exFAT文件格式选项。最大的缺点是没有文件日志功能,这样就不能记录磁盘上文件的修改记录。</p><p>3、NTFS是微软为硬盘或固态硬盘(SSD)创建的默认新型文件系统,NTFS的含义是 New Technology File System,它基层了所有文件系统的优点:日志功能、无文件大小限制、支持文件压缩和长文件名、服务器文件管理权限等。最大的缺点是Mac系统只能读取NTFS文件但没有权限写入,需要借助第三方工具才能实现。因此跨平台的功能非常差。</p>]]></content>
<categories>
<category> 操作系统 </category>
</categories>
<tags>
<tag> 操作系统 </tag>
</tags>
</entry>
<entry>
<title>死锁的避免和预防的区别?</title>
<link href="/2020/12/17/%E6%AD%BB%E9%94%81%E7%9A%84%E9%81%BF%E5%85%8D%E5%92%8C%E9%A2%84%E9%98%B2%E7%9A%84%E5%8C%BA%E5%88%AB%EF%BC%9F/"/>
<url>/2020/12/17/%E6%AD%BB%E9%94%81%E7%9A%84%E9%81%BF%E5%85%8D%E5%92%8C%E9%A2%84%E9%98%B2%E7%9A%84%E5%8C%BA%E5%88%AB%EF%BC%9F/</url>
<content type="html"><![CDATA[<h1 id="死锁避免"><a class="markdownIt-Anchor" href="#死锁避免"></a> 死锁避免</h1><p><strong>死锁避免的基本思想:</strong></p><ul><li><strong>系统对进程发出每一个系统能够满足的资源申请进行动态检查</strong></li><li>并根据检查结果决定是否分配资源</li><li><strong>如果分配后系统可能发生死锁,则不予分配,否则予以分配。</strong></li><li>这是一种保证系统不进入死锁状态的动态策略。</li></ul><h1 id="死锁预防"><a class="markdownIt-Anchor" href="#死锁预防"></a> 死锁预防</h1><p><strong>我们可以通过破坏死锁产生的4个必要条件来预防死锁</strong>,由于资源互斥是资源使用的固有特性是无法改变的。</p><ul><li><strong>破坏"不可剥夺"条件</strong>:<strong>一个进程不能获得所需要的全部资源时便处于等待状态,等待期间他占有的资源将被隐式的释放重新加入到系统的资源列表中,可以被其他的进程使用</strong>,而等待的进程只有重新获得自己原有的资源以及新申请的资源才可以重新启动,执行。</li><li><strong>破坏"请求与保持条件"</strong>:第一种方法静态分配即<strong>每个进程在开始执行时就申请他所需要的全部资源</strong>。第二种是动态分配即每个进程在申请所需要的资源时他本身不占用系统资源。</li><li><strong>破坏"循环等待"条件</strong>:<strong>采用资源有序分配</strong>。其基本思想是将系统中的所有资源顺序编号,将紧缺的,稀少的采用较大的编号,在申请资源时必须按照编号的顺序进行,一个进程只有获得较小编号的进程才能申请较大编号的进程。</li></ul><h1 id="更本质的区别"><a class="markdownIt-Anchor" href="#更本质的区别"></a> 更本质的区别:</h1><p>避免是操作系统对进程和进程之间的(对用户程序不加限制)。</p><p>预防是操作系统对用户程序限制的(限制其申请资源)。</p>]]></content>
<categories>
<category> 操作系统 </category>
</categories>
<tags>
<tag> 操作系统 </tag>
</tags>
</entry>
<entry>
<title>VSCode 配置速览定义</title>
<link href="/2020/12/02/VSCode-%E9%85%8D%E7%BD%AE%E9%80%9F%E8%A7%88%E5%AE%9A%E4%B9%89/"/>
<url>/2020/12/02/VSCode-%E9%85%8D%E7%BD%AE%E9%80%9F%E8%A7%88%E5%AE%9A%E4%B9%89/</url>
<content type="html"><![CDATA[<h1 id="前言"><a class="markdownIt-Anchor" href="#前言"></a> 前言</h1><p>VSCode 按住<code>ctrl</code> 再用鼠标左键点击变量会出现它的定义,点击函数会实现跳转。但是我不想让它跳转到函数而是像 Visual Studio 那样出现速览定义弹窗</p><h1 id="方法"><a class="markdownIt-Anchor" href="#方法"></a> 方法</h1><p>在设置中勾选此项<br /><img src="https://img-blog.csdnimg.cn/2020120220512965.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0Fsb25laW5nY2hpbGQ=,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述" /></p><h1 id="效果"><a class="markdownIt-Anchor" href="#效果"></a> 效果</h1><p><img src="https://img-blog.csdnimg.cn/20201202205216795.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0Fsb25laW5nY2hpbGQ=,size_16,color_FFFFFF,t_70#pic_center" alt="在这里插入图片描述" /></p>]]></content>
<categories>
<category> VSCode </category>
</categories>
<tags>
<tag> VSCode </tag>
</tags>
</entry>
<entry>
<title>SVM目标函数的一些理解</title>
<link href="/2020/11/27/SVM%E7%9B%AE%E6%A0%87%E5%87%BD%E6%95%B0%E7%9A%84%E4%B8%80%E4%BA%9B%E7%90%86%E8%A7%A3/"/>
<url>/2020/11/27/SVM%E7%9B%AE%E6%A0%87%E5%87%BD%E6%95%B0%E7%9A%84%E4%B8%80%E4%BA%9B%E7%90%86%E8%A7%A3/</url>
<content type="html"><![CDATA[<h1 id="写在前面"><a class="markdownIt-Anchor" href="#写在前面"></a> 写在前面</h1><p>学习SVM的对目标函数有些疑问,做了一些笔记。感谢ZKX同学提供的帮助,(PS:这篇博客可能会继续更新</p><h1 id="svm"><a class="markdownIt-Anchor" href="#svm"></a> SVM</h1><p>我们的问题是设定一个超平面,去最大化样本点和这个超平面的距离,这个距离我们称之为Margin(间隔)。</p><p><span class="katex-display"><span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>γ</mi><mo>=</mo><munder><mo><mi>min</mi><mo></mo></mo><mi>i</mi></munder><msup><mi>γ</mi><mrow><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup></mrow><annotation encoding="application/x-tex">\gamma=\min _{i} \gamma^{(i)}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.19444em;"></span><span class="mord mathdefault" style="margin-right:0.05556em;">γ</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:1.665664em;vertical-align:-0.727664em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.66786em;"><span style="top:-2.072336em;margin-left:0em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathdefault mtight">i</span></span></span></span><span style="top:-2.7em;"><span class="pstrut" style="height:2.7em;"></span><span><span class="mop">min</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.727664em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.05556em;">γ</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.938em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mathdefault mtight">i</span><span class="mclose mtight">)</span></span></span></span></span></span></span></span></span></span></span></span></span></p><p><img src="https://img-blog.csdnimg.cn/20201127212016190.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0Fsb25laW5nY2hpbGQ=,size_16,color_FFFFFF,t_70#pic_center" alt="" /></p><h2 id="函数间隔-functional-margin"><a class="markdownIt-Anchor" href="#函数间隔-functional-margin"></a> 函数间隔 Functional margin:</h2><p>这一点老师的PPT上并没有给出来,所以可能学习的时候有些混淆。</p><p><span class="katex-display"><span class="katex"><span class="katex-mathml"><math><semantics><mrow><msup><mover accent="true"><mi>γ</mi><mo>^</mo></mover><mrow><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo>=</mo><msup><mi>y</mi><mrow><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mrow><mo fence="true">(</mo><msup><mi>ω</mi><mi>T</mi></msup><msup><mi>x</mi><mrow><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo>+</mo><mi>b</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\hat{\gamma}^{(i)}=y^{(i)}\left(\omega^{T} x^{(i)}+b\right)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.13244em;vertical-align:-0.19444em;"></span><span class="mord"><span class="mord accent"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.69444em;"><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.05556em;">γ</span></span></span><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="accent-body" style="left:-0.25em;">^</span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.19444em;"><span></span></span></span></span></span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.938em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mathdefault mtight">i</span><span class="mclose mtight">)</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:1.80002em;vertical-align:-0.65002em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.03588em;">y</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.938em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mathdefault mtight">i</span><span class="mclose mtight">)</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size2">(</span></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.03588em;">ω</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8913309999999999em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathdefault mtight" style="margin-right:0.13889em;">T</span></span></span></span></span></span></span></span></span><span class="mord"><span class="mord mathdefault">x</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.938em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mathdefault mtight">i</span><span class="mclose mtight">)</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mord mathdefault">b</span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size2">)</span></span></span></span></span></span></span></p><p>这里我们扩大<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>ω</mi><mo separator="true">,</mo><mi>b</mi></mrow><annotation encoding="application/x-tex">\omega,b</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8888799999999999em;vertical-align:-0.19444em;"></span><span class="mord mathdefault" style="margin-right:0.03588em;">ω</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord mathdefault">b</span></span></span></span> n 倍数会改变<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mover accent="true"><mi>γ</mi><mo>^</mo></mover></mrow><annotation encoding="application/x-tex">\hat{\gamma}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8888799999999999em;vertical-align:-0.19444em;"></span><span class="mord accent"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.69444em;"><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.05556em;">γ</span></span></span><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="accent-body" style="left:-0.25em;">^</span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.19444em;"><span></span></span></span></span></span></span></span></span>。因此我们引入几何间隔。</p><h2 id="几何间隔-geometric-margin"><a class="markdownIt-Anchor" href="#几何间隔-geometric-margin"></a> 几何间隔 Geometric margin :</h2><p><span class="katex-display"><span class="katex"><span class="katex-mathml"><math><semantics><mrow><msup><mi>γ</mi><mrow><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo>=</mo><msup><mi>y</mi><mrow><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mrow><mo fence="true">(</mo><msup><mrow><mo fence="true">(</mo><mfrac><mi>ω</mi><mrow><mi mathvariant="normal">∥</mi><mi>ω</mi><mi mathvariant="normal">∥</mi></mrow></mfrac><mo fence="true">)</mo></mrow><mi>T</mi></msup><msup><mi>x</mi><mrow><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo>+</mo><mfrac><mi>b</mi><mrow><mi mathvariant="normal">∥</mi><mi>ω</mi><mi mathvariant="normal">∥</mi></mrow></mfrac><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\gamma^{(i)}=y^{(i)}\left(\left(\frac{\omega}{\|\omega\|}\right)^{T} x^{(i)}+\frac{b}{\|\omega\|}\right)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.13244em;vertical-align:-0.19444em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.05556em;">γ</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.938em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mathdefault mtight">i</span><span class="mclose mtight">)</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:3.0000299999999998em;vertical-align:-1.25003em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.03588em;">y</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.938em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mathdefault mtight">i</span><span class="mclose mtight">)</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size4">(</span></span><span class="minner"><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size3">(</span></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.10756em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">∥</span><span class="mord mathdefault" style="margin-right:0.03588em;">ω</span><span class="mord">∥</span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.03588em;">ω</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.936em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size3">)</span></span></span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:1.681231em;"><span style="top:-3.9029000000000003em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathdefault mtight" style="margin-right:0.13889em;">T</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord"><span class="mord mathdefault">x</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.938em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mathdefault mtight">i</span><span class="mclose mtight">)</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.37144em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">∥</span><span class="mord mathdefault" style="margin-right:0.03588em;">ω</span><span class="mord">∥</span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathdefault">b</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.936em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size4">)</span></span></span></span></span></span></span></p><p>几何间隔具有缩放不变性:</p><p><span class="katex-display"><span class="katex"><span class="katex-mathml"><math><semantics><mtable rowspacing="0.24999999999999992em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><msup><mi>γ</mi><mrow><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><msup><mi>y</mi><mrow><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mrow><mo fence="true">(</mo><msup><mrow><mo fence="true">(</mo><mfrac><mrow><mi>c</mi><mo>⋅</mo><mi>ω</mi></mrow><mrow><mi mathvariant="normal">∥</mi><mi>c</mi><mo>⋅</mo><mi>ω</mi><mi mathvariant="normal">∥</mi></mrow></mfrac><mo fence="true">)</mo></mrow><mi>T</mi></msup><msup><mi>x</mi><mrow><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo>+</mo><mfrac><mrow><mi>c</mi><mo>⋅</mo><mi>b</mi></mrow><mrow><mi mathvariant="normal">∥</mi><mi>c</mi><mo>⋅</mo><mi>ω</mi><mi mathvariant="normal">∥</mi></mrow></mfrac><mo fence="true">)</mo></mrow></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><msup><mi>y</mi><mrow><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mrow><mo fence="true">(</mo><msup><mrow><mo fence="true">(</mo><mfrac><mi>ω</mi><mrow><mi mathvariant="normal">∥</mi><mi>ω</mi><mi mathvariant="normal">∥</mi></mrow></mfrac><mo fence="true">)</mo></mrow><mi>T</mi></msup><msup><mi>x</mi><mrow><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo>+</mo><mfrac><mi>b</mi><mrow><mi mathvariant="normal">∥</mi><mi>ω</mi><mi mathvariant="normal">∥</mi></mrow></mfrac><mo fence="true">)</mo></mrow></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{aligned}\gamma^{(i)} &=y^{(i)}\left(\left(\frac{c \cdot \omega}{\|c \cdot \omega\|}\right)^{T} x^{(i)}+\frac{c \cdot b}{\|c \cdot \omega\|}\right) \\&=y^{(i)}\left(\left(\frac{\omega}{\|\omega\|}\right)^{T} x^{(i)}+\frac{b}{\|\omega\|}\right)\end{aligned}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:6.600059999999999em;vertical-align:-3.0500299999999996em;"></span><span class="mord"><span class="mtable"><span class="col-align-r"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:3.5500299999999996em;"><span style="top:-5.55003em;"><span class="pstrut" style="height:3.75em;"></span><span class="mord"><span class="mord"><span class="mord mathdefault" style="margin-right:0.05556em;">γ</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.938em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mathdefault mtight">i</span><span class="mclose mtight">)</span></span></span></span></span></span></span></span></span></span></span><span style="top:-2.2500000000000004em;"><span class="pstrut" style="height:3.75em;"></span><span class="mord"></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:3.0500299999999996em;"><span></span></span></span></span></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:3.5500299999999996em;"><span style="top:-5.55003em;"><span class="pstrut" style="height:3.75em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.03588em;">y</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.938em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mathdefault mtight">i</span><span class="mclose mtight">)</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size4">(</span></span><span class="minner"><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size3">(</span></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.12145em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">∥</span><span class="mord mathdefault">c</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">⋅</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mord mathdefault" style="margin-right:0.03588em;">ω</span><span class="mord">∥</span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathdefault">c</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">⋅</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mord mathdefault" style="margin-right:0.03588em;">ω</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.936em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size3">)</span></span></span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:1.681231em;"><span style="top:-3.9029000000000003em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathdefault mtight" style="margin-right:0.13889em;">T</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord"><span class="mord mathdefault">x</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.938em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mathdefault mtight">i</span><span class="mclose mtight">)</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.37144em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">∥</span><span class="mord mathdefault">c</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">⋅</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mord mathdefault" style="margin-right:0.03588em;">ω</span><span class="mord">∥</span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathdefault">c</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">⋅</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mord mathdefault">b</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.936em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size4">)</span></span></span></span></span><span style="top:-2.2500000000000004em;"><span class="pstrut" style="height:3.75em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.03588em;">y</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.938em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mathdefault mtight">i</span><span class="mclose mtight">)</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size4">(</span></span><span class="minner"><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size3">(</span></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.10756em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">∥</span><span class="mord mathdefault" style="margin-right:0.03588em;">ω</span><span class="mord">∥</span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.03588em;">ω</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.936em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size3">)</span></span></span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:1.681231em;"><span style="top:-3.9029000000000003em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathdefault mtight" style="margin-right:0.13889em;">T</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord"><span class="mord mathdefault">x</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.938em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mathdefault mtight">i</span><span class="mclose mtight">)</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.37144em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">∥</span><span class="mord mathdefault" style="margin-right:0.03588em;">ω</span><span class="mord">∥</span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathdefault">b</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.936em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size4">)</span></span></span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:3.0500299999999996em;"><span></span></span></span></span></span></span></span></span></span></span></span></p><p>有了这个性质我们可以对求解目标进行限制,简化优化问题。</p><p>这里要注意:如果<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi mathvariant="normal">∣</mi><mi>ω</mi><mi mathvariant="normal">∣</mi><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">|\omega|=1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">∣</span><span class="mord mathdefault" style="margin-right:0.03588em;">ω</span><span class="mord">∣</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:0.64444em;vertical-align:0em;"></span><span class="mord">1</span></span></span></span>,那么函数间隔和几何间隔相等。如果超平面参数<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>ω</mi></mrow><annotation encoding="application/x-tex">\omega</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.43056em;vertical-align:0em;"></span><span class="mord mathdefault" style="margin-right:0.03588em;">ω</span></span></span></span>和<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>b</mi></mrow><annotation encoding="application/x-tex">b</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.69444em;vertical-align:0em;"></span><span class="mord mathdefault">b</span></span></span></span>成比例地改变(超平面没有改变),函数间隔也按此比例改变,而几何间隔不变。</p><h1 id="svm的目标问题"><a class="markdownIt-Anchor" href="#svm的目标问题"></a> SVM的目标问题:</h1><p><span class="katex-display"><span class="katex"><span class="katex-mathml"><math><semantics><mrow><munder><mo><mi>max</mi><mo></mo></mo><mrow><mi>ω</mi><mo separator="true">,</mo><mi>b</mi></mrow></munder><munder><mo><mi>min</mi><mo></mo></mo><mi>i</mi></munder><mrow><mo fence="true">{</mo><msup><mi>γ</mi><mrow><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo fence="true">}</mo></mrow></mrow><annotation encoding="application/x-tex">\max _{\omega, b} \min _{i}\left\{\gamma^{(i)}\right\}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:2.038216em;vertical-align:-0.8882159999999999em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.43055999999999994em;"><span style="top:-2.0478920000000005em;margin-left:0em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathdefault mtight" style="margin-right:0.03588em;">ω</span><span class="mpunct mtight">,</span><span class="mord mathdefault mtight">b</span></span></span></span><span style="top:-2.7em;"><span class="pstrut" style="height:2.7em;"></span><span><span class="mop">max</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.8882159999999999em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.66786em;"><span style="top:-2.072336em;margin-left:0em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathdefault mtight">i</span></span></span></span><span style="top:-2.7em;"><span class="pstrut" style="height:2.7em;"></span><span><span class="mop">min</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.727664em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size2">{</span></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.05556em;">γ</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.938em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mathdefault mtight">i</span><span class="mclose mtight">)</span></span></span></span></span></span></span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size2">}</span></span></span></span></span></span></span></p><p><strong>目标问题</strong>可以转化为:</p><p><span class="katex-display"><span class="katex"><span class="katex-mathml"><math><semantics><mtable rowspacing="0.15999999999999992em" columnalign="left left" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><msub><mo><mi>max</mi><mo></mo></mo><mrow><mi>γ</mi><mo separator="true">,</mo><mi>ω</mi><mo separator="true">,</mo><mi>b</mi></mrow></msub></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mi>γ</mi></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mtext>s.t.</mtext></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><msup><mi>γ</mi><mrow><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo>≥</mo><mi>γ</mi><mo separator="true">,</mo><mspace width="1em"/><mi mathvariant="normal">∀</mi><mi>i</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{array}{ll}\max _{\gamma, \omega, b} & \gamma\\\text {s.t.} & \gamma^{(i)} \geq \gamma, \quad \forall i\end{array}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:2.4480000000000004em;vertical-align:-0.9740000000000004em;"></span><span class="mord"><span class="mtable"><span class="arraycolsep" style="width:0.5em;"></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.474em;"><span style="top:-3.634em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mop"><span class="mop">max</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361079999999999em;"><span style="top:-2.5500000000000003em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathdefault mtight" style="margin-right:0.05556em;">γ</span><span class="mpunct mtight">,</span><span class="mord mathdefault mtight" style="margin-right:0.03588em;">ω</span><span class="mpunct mtight">,</span><span class="mord mathdefault mtight">b</span></span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.286108em;"><span></span></span></span></span></span></span></span></span><span style="top:-2.3859999999999997em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord text"><span class="mord">s.t.</span></span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.9740000000000004em;"><span></span></span></span></span></span><span class="arraycolsep" style="width:0.5em;"></span><span class="arraycolsep" style="width:0.5em;"></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.474em;"><span style="top:-3.634em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.05556em;">γ</span></span></span><span style="top:-2.3859999999999997em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"><span class="mord mathdefault" style="margin-right:0.05556em;">γ</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8879999999999999em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mathdefault mtight">i</span><span class="mclose mtight">)</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">≥</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mord mathdefault" style="margin-right:0.05556em;">γ</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mspace" style="margin-right:1em;"></span><span class="mord">∀</span><span class="mord mathdefault">i</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.9740000000000004em;"><span></span></span></span></span></span><span class="arraycolsep" style="width:0.5em;"></span></span></span></span></span></span></span></p><p>其中,间隔为函数间隔:</p><p><span class="katex-display"><span class="katex"><span class="katex-mathml"><math><semantics><mrow><msup><mi>γ</mi><mrow><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo>=</mo><msup><mi>y</mi><mrow><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mrow><mo fence="true">(</mo><msup><mrow><mo fence="true">(</mo><mfrac><mi>ω</mi><mrow><mi mathvariant="normal">∥</mi><mi>ω</mi><mi mathvariant="normal">∥</mi></mrow></mfrac><mo fence="true">)</mo></mrow><mi>T</mi></msup><msup><mi>x</mi><mrow><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo>+</mo><mfrac><mi>b</mi><mrow><mi mathvariant="normal">∥</mi><mi>ω</mi><mi mathvariant="normal">∥</mi></mrow></mfrac><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\gamma^{(i)}=y^{(i)}\left(\left(\frac{\omega}{\|\omega\|}\right)^{T} x^{(i)}+\frac{b}{\|\omega\|}\right)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.13244em;vertical-align:-0.19444em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.05556em;">γ</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.938em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mathdefault mtight">i</span><span class="mclose mtight">)</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:3.0000299999999998em;vertical-align:-1.25003em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.03588em;">y</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.938em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mathdefault mtight">i</span><span class="mclose mtight">)</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size4">(</span></span><span class="minner"><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size3">(</span></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.10756em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">∥</span><span class="mord mathdefault" style="margin-right:0.03588em;">ω</span><span class="mord">∥</span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.03588em;">ω</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.936em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size3">)</span></span></span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:1.681231em;"><span style="top:-3.9029000000000003em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathdefault mtight" style="margin-right:0.13889em;">T</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord"><span class="mord mathdefault">x</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.938em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mathdefault mtight">i</span><span class="mclose mtight">)</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.37144em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">∥</span><span class="mord mathdefault" style="margin-right:0.03588em;">ω</span><span class="mord">∥</span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathdefault">b</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.936em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size4">)</span></span></span></span></span></span></span></p><p>因此<strong>目标问题</strong>转化为:</p><p><span class="katex-display"><span class="katex"><span class="katex-mathml"><math><semantics><mtable rowspacing="0.15999999999999992em" columnalign="left left" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><msub><mo><mi>max</mi><mo></mo></mo><mrow><mi>γ</mi><mo separator="true">,</mo><mi>ω</mi><mo separator="true">,</mo><mi>b</mi></mrow></msub></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mi>γ</mi></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mtext>s.t.</mtext></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><msup><mi>y</mi><mrow><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mrow><mo fence="true">(</mo><msup><mi>ω</mi><mi>T</mi></msup><msup><mi>x</mi><mrow><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo>+</mo><mi>b</mi><mo fence="true">)</mo></mrow><mo>≥</mo><mi>γ</mi><mi mathvariant="normal">∥</mi><mi>ω</mi><mi mathvariant="normal">∥</mi><mtext> </mtext><mspace width="1em"/><mi mathvariant="normal">∀</mi><mi>i</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{array}{ll}\max _{\gamma, \omega, b} & \gamma\\\text {s.t.} & y^{(i)}\left(\omega^{T} x^{(i)}+b\right) \geq \gamma\|\omega\| \ \quad \forall i\end{array}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:2.4480000000000004em;vertical-align:-0.9740000000000004em;"></span><span class="mord"><span class="mtable"><span class="arraycolsep" style="width:0.5em;"></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.474em;"><span style="top:-3.634em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mop"><span class="mop">max</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361079999999999em;"><span style="top:-2.5500000000000003em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathdefault mtight" style="margin-right:0.05556em;">γ</span><span class="mpunct mtight">,</span><span class="mord mathdefault mtight" style="margin-right:0.03588em;">ω</span><span class="mpunct mtight">,</span><span class="mord mathdefault mtight">b</span></span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.286108em;"><span></span></span></span></span></span></span></span></span><span style="top:-2.3859999999999997em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord text"><span class="mord">s.t.</span></span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.9740000000000004em;"><span></span></span></span></span></span><span class="arraycolsep" style="width:0.5em;"></span><span class="arraycolsep" style="width:0.5em;"></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.474em;"><span style="top:-3.634em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.05556em;">γ</span></span></span><span style="top:-2.3859999999999997em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"><span class="mord mathdefault" style="margin-right:0.03588em;">y</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8879999999999999em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mathdefault mtight">i</span><span class="mclose mtight">)</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size1">(</span></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.03588em;">ω</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8413309999999999em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathdefault mtight" style="margin-right:0.13889em;">T</span></span></span></span></span></span></span></span></span><span class="mord"><span class="mord mathdefault">x</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8879999999999999em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mathdefault mtight">i</span><span class="mclose mtight">)</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mord mathdefault">b</span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size1">)</span></span></span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">≥</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mord mathdefault" style="margin-right:0.05556em;">γ</span><span class="mord">∥</span><span class="mord mathdefault" style="margin-right:0.03588em;">ω</span><span class="mord">∥</span><span class="mspace"> </span><span class="mspace" style="margin-right:1em;"></span><span class="mord">∀</span><span class="mord mathdefault">i</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.9740000000000004em;"><span></span></span></span></span></span><span class="arraycolsep" style="width:0.5em;"></span></span></span></span></span></span></span></p><p>利用几何间隔不变性,一方面为了使优化目标更加简单。</p><p>另一方面有点类似于标准化的思想因为不同模型由于数据分布的原因,<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>ω</mi></mrow><annotation encoding="application/x-tex">\omega</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.43056em;vertical-align:0em;"></span><span class="mord mathdefault" style="margin-right:0.03588em;">ω</span></span></span></span>和<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>b</mi></mrow><annotation encoding="application/x-tex">b</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.69444em;vertical-align:0em;"></span><span class="mord mathdefault">b</span></span></span></span>可能会大不相同(数据集1的分法和数据集2的分法结果的好坏因为<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>ω</mi></mrow><annotation encoding="application/x-tex">\omega</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.43056em;vertical-align:0em;"></span><span class="mord mathdefault" style="margin-right:0.03588em;">ω</span></span></span></span>和<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>b</mi></mrow><annotation encoding="application/x-tex">b</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.69444em;vertical-align:0em;"></span><span class="mord mathdefault">b</span></span></span></span>比例的不同难以直观比较)。但是把他们的最小间隔都设置为1后,就有比较性了。同一个数据的不同超平面,也有了比较的方法</p><p><span class="katex-display"><span class="katex"><span class="katex-mathml"><math><semantics><mrow><munder><mo><mi>min</mi><mo></mo></mo><mi>i</mi></munder><mrow><mo fence="true">{</mo><msup><mi>y</mi><mrow><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mrow><mo fence="true">(</mo><msup><mi>ω</mi><mi>T</mi></msup><msup><mi>x</mi><mrow><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo>+</mo><mi>b</mi><mo fence="true">)</mo></mrow><mo fence="true">}</mo></mrow><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">\min _{i}\left\{y^{(i)}\left(\omega^{T} x^{(i)}+b\right)\right\}=1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.8776639999999998em;vertical-align:-0.727664em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.66786em;"><span style="top:-2.072336em;margin-left:0em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathdefault mtight">i</span></span></span></span><span style="top:-2.7em;"><span class="pstrut" style="height:2.7em;"></span><span><span class="mop">min</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.727664em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size2">{</span></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.03588em;">y</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.938em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mathdefault mtight">i</span><span class="mclose mtight">)</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size2">(</span></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.03588em;">ω</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8913309999999999em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathdefault mtight" style="margin-right:0.13889em;">T</span></span></span></span></span></span></span></span></span><span class="mord"><span class="mord mathdefault">x</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.938em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mathdefault mtight">i</span><span class="mclose mtight">)</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mord mathdefault">b</span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size2">)</span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size2">}</span></span></span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:0.64444em;vertical-align:0em;"></span><span class="mord">1</span></span></span></span></span></p><p>即令最小间隔为<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mfrac><mn>1</mn><mrow><mi mathvariant="normal">∥</mi><mi>ω</mi><mi mathvariant="normal">∥</mi></mrow></mfrac></mrow><annotation encoding="application/x-tex">\frac{1}{\|\omega\|}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.365108em;vertical-align:-0.52em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.845108em;"><span style="top:-2.655em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">∥</span><span class="mord mathdefault mtight" style="margin-right:0.03588em;">ω</span><span class="mord mtight">∥</span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.394em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.52em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span></span></span></span>:</p><p><span class="katex-display"><span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>γ</mi><mo>=</mo><munder><mo><mi>min</mi><mo></mo></mo><mi>i</mi></munder><mrow><mo fence="true">{</mo><msup><mi>y</mi><mrow><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mrow><mo fence="true">(</mo><msup><mrow><mo fence="true">(</mo><mfrac><mi>ω</mi><mrow><mi mathvariant="normal">∥</mi><mi>ω</mi><mi mathvariant="normal">∥</mi></mrow></mfrac><mo fence="true">)</mo></mrow><mi>T</mi></msup><msup><mi>x</mi><mrow><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo>+</mo><mfrac><mi>b</mi><mrow><mi mathvariant="normal">∥</mi><mi>ω</mi><mi mathvariant="normal">∥</mi></mrow></mfrac><mo fence="true">)</mo></mrow><mo fence="true">}</mo></mrow><mo>=</mo><mfrac><mn>1</mn><mrow><mi mathvariant="normal">∥</mi><mi>ω</mi><mi mathvariant="normal">∥</mi></mrow></mfrac></mrow><annotation encoding="application/x-tex">\gamma=\min _{i}\left\{y^{(i)}\left(\left(\frac{\omega}{\|\omega\|}\right)^{T} x^{(i)}+\frac{b}{\|\omega\|}\right)\right\}=\frac{1}{\|\omega\|}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.19444em;"></span><span class="mord mathdefault" style="margin-right:0.05556em;">γ</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:3.0000299999999998em;vertical-align:-1.25003em;"></span><span class="mop op-limits"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.66786em;"><span style="top:-2.072336em;margin-left:0em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathdefault mtight">i</span></span></span></span><span style="top:-2.7em;"><span class="pstrut" style="height:2.7em;"></span><span><span class="mop">min</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.727664em;"><span></span></span></span></span></span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size4">{</span></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.03588em;">y</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.938em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mathdefault mtight">i</span><span class="mclose mtight">)</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size4">(</span></span><span class="minner"><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size3">(</span></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.10756em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">∥</span><span class="mord mathdefault" style="margin-right:0.03588em;">ω</span><span class="mord">∥</span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.03588em;">ω</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.936em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size3">)</span></span></span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:1.681231em;"><span style="top:-3.9029000000000003em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathdefault mtight" style="margin-right:0.13889em;">T</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord"><span class="mord mathdefault">x</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.938em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mathdefault mtight">i</span><span class="mclose mtight">)</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.37144em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">∥</span><span class="mord mathdefault" style="margin-right:0.03588em;">ω</span><span class="mord">∥</span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathdefault">b</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.936em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size4">)</span></span></span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size4">}</span></span></span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:2.25744em;vertical-align:-0.936em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.32144em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">∥</span><span class="mord mathdefault" style="margin-right:0.03588em;">ω</span><span class="mord">∥</span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">1</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.936em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span></span></span></span></span></p><p>因此<strong>目标问题</strong>变为:</p><p><span class="katex-display"><span class="katex"><span class="katex-mathml"><math><semantics><mtable rowspacing="0.15999999999999992em" columnalign="left left" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><msub><mo><mi>max</mi><mo></mo></mo><mrow><mi>ω</mi><mo separator="true">,</mo><mi>b</mi></mrow></msub></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><mn>1</mn><mi mathvariant="normal">/</mi><mi mathvariant="normal">∥</mi><mi>ω</mi><mi mathvariant="normal">∥</mi></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mtext> s.t. </mtext></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><msup><mi>y</mi><mrow><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mrow><mo fence="true">(</mo><msup><mi>ω</mi><mi>T</mi></msup><msup><mi>x</mi><mrow><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo>+</mo><mi>b</mi><mo fence="true">)</mo></mrow><mo>≥</mo><mn>1</mn><mo separator="true">,</mo><mi mathvariant="normal">∀</mi><mi>i</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{array}{ll}\max _{\omega, b} & 1 /\|\omega\| \\\text { s.t. } & y^{(i)}\left(\omega^{T} x^{(i)}+b\right) \geq 1, \forall i\end{array}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:2.4480000000000004em;vertical-align:-0.9740000000000004em;"></span><span class="mord"><span class="mtable"><span class="arraycolsep" style="width:0.5em;"></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.474em;"><span style="top:-3.634em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mop"><span class="mop">max</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361079999999999em;"><span style="top:-2.5500000000000003em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathdefault mtight" style="margin-right:0.03588em;">ω</span><span class="mpunct mtight">,</span><span class="mord mathdefault mtight">b</span></span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.286108em;"><span></span></span></span></span></span></span></span></span><span style="top:-2.3859999999999997em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord text"><span class="mord"> s.t. </span></span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.9740000000000004em;"><span></span></span></span></span></span><span class="arraycolsep" style="width:0.5em;"></span><span class="arraycolsep" style="width:0.5em;"></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.474em;"><span style="top:-3.634em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">1</span><span class="mord">/</span><span class="mord">∥</span><span class="mord mathdefault" style="margin-right:0.03588em;">ω</span><span class="mord">∥</span></span></span><span style="top:-2.3859999999999997em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"><span class="mord mathdefault" style="margin-right:0.03588em;">y</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8879999999999999em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mathdefault mtight">i</span><span class="mclose mtight">)</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size1">(</span></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.03588em;">ω</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8413309999999999em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathdefault mtight" style="margin-right:0.13889em;">T</span></span></span></span></span></span></span></span></span><span class="mord"><span class="mord mathdefault">x</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8879999999999999em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mathdefault mtight">i</span><span class="mclose mtight">)</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mord mathdefault">b</span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size1">)</span></span></span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">≥</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mord">1</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord">∀</span><span class="mord mathdefault">i</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.9740000000000004em;"><span></span></span></span></span></span><span class="arraycolsep" style="width:0.5em;"></span></span></span></span></span></span></span></p><p>又仅为最小化<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mfrac><mn>1</mn><mrow><mi mathvariant="normal">∥</mi><mi>ω</mi><mi mathvariant="normal">∥</mi></mrow></mfrac></mrow><annotation encoding="application/x-tex">\frac{1}{\|\omega\|}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.365108em;vertical-align:-0.52em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.845108em;"><span style="top:-2.655em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">∥</span><span class="mord mathdefault mtight" style="margin-right:0.03588em;">ω</span><span class="mord mtight">∥</span></span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.394em;"><span class="pstrut" style="height:3em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">1</span></span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.52em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span></span></span></span>等价于最大化<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi mathvariant="normal">∥</mi><mi>ω</mi><msup><mi mathvariant="normal">∥</mi><mn>2</mn></msup><mo>=</mo><msup><mi>ω</mi><mi>T</mi></msup><mi>ω</mi></mrow><annotation encoding="application/x-tex">\|\omega\|^{2}=\omega^{T} \omega</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.064108em;vertical-align:-0.25em;"></span><span class="mord">∥</span><span class="mord mathdefault" style="margin-right:0.03588em;">ω</span><span class="mord"><span class="mord">∥</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141079999999999em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:0.8413309999999999em;vertical-align:0em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.03588em;">ω</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8413309999999999em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathdefault mtight" style="margin-right:0.13889em;">T</span></span></span></span></span></span></span></span></span><span class="mord mathdefault" style="margin-right:0.03588em;">ω</span></span></span></span>(这样凑是为了满足二次规划形式)</p><p>最终目标函数即为:</p><p><span class="katex-display"><span class="katex"><span class="katex-mathml"><math><semantics><mtable rowspacing="0.15999999999999992em" columnalign="left" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><msub><mo><mi>min</mi><mo></mo></mo><mrow><mi>ω</mi><mo separator="true">,</mo><mi>b</mi></mrow></msub><msup><mi>ω</mi><mi>T</mi></msup><mi>ω</mi></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><mtext> s.t. </mtext><mspace width="1em"/><msup><mi>y</mi><mrow><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mrow><mo fence="true">(</mo><msup><mi>ω</mi><mi>T</mi></msup><msup><mi>x</mi><mrow><mo stretchy="false">(</mo><mi>i</mi><mo stretchy="false">)</mo></mrow></msup><mo>+</mo><mi>b</mi><mo fence="true">)</mo></mrow><mo>≥</mo><mn>1</mn><mo separator="true">,</mo><mi mathvariant="normal">∀</mi><mi>i</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{array}{l}\min _{\omega, b} \omega^{T} \omega \\\text { s.t. } \quad y^{(i)}\left(\omega^{T} x^{(i)}+b\right) \geq 1, \forall i\end{array}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:2.449331em;vertical-align:-0.9746655000000002em;"></span><span class="mord"><span class="mtable"><span class="arraycolsep" style="width:0.5em;"></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.4746654999999997em;"><span style="top:-3.6333344999999997em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mop"><span class="mop">min</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361079999999999em;"><span style="top:-2.5500000000000003em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathdefault mtight" style="margin-right:0.03588em;">ω</span><span class="mpunct mtight">,</span><span class="mord mathdefault mtight">b</span></span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.286108em;"><span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.03588em;">ω</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8413309999999999em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathdefault mtight" style="margin-right:0.13889em;">T</span></span></span></span></span></span></span></span></span><span class="mord mathdefault" style="margin-right:0.03588em;">ω</span></span></span><span style="top:-2.3853344999999995em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord text"><span class="mord"> s.t. </span></span><span class="mspace" style="margin-right:1em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.03588em;">y</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8879999999999999em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mathdefault mtight">i</span><span class="mclose mtight">)</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="minner"><span class="mopen delimcenter" style="top:0em;"><span class="delimsizing size1">(</span></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.03588em;">ω</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8413309999999999em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mathdefault mtight" style="margin-right:0.13889em;">T</span></span></span></span></span></span></span></span></span><span class="mord"><span class="mord mathdefault">x</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8879999999999999em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mopen mtight">(</span><span class="mord mathdefault mtight">i</span><span class="mclose mtight">)</span></span></span></span></span></span></span></span></span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mord mathdefault">b</span><span class="mclose delimcenter" style="top:0em;"><span class="delimsizing size1">)</span></span></span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">≥</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mord">1</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord">∀</span><span class="mord mathdefault">i</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.9746655000000002em;"><span></span></span></span></span></span><span class="arraycolsep" style="width:0.5em;"></span></span></span></span></span></span></span></p><h1 id="参考文献"><a class="markdownIt-Anchor" href="#参考文献"></a> 参考文献</h1><p><a href="https://www.svm-tutorial.com/2015/06/svm-understanding-math-part-3/">SVM - Understanding the math - the optimal hyperplane</a></p><p><a href="https://funglee.github.io/ml/slides/Lecture6-SVM.pdf">Lecture 6: Support Vector Machine</a></p><p><a href="https://funglee.github.io/ml/ref/svmhao.pdf">从零构建支持向量机(SVM)</a></p><p><a href="https://zhuanlan.zhihu.com/p/106024205">svm函数的解释(转载)</a></p>]]></content>
<categories>
<category> 机器学习 </category>
</categories>
<tags>
<tag> 机器学习 </tag>
</tags>
</entry>
<entry>
<title>操作系统、计算机网络、计算机组成原理中同步和异步的概念</title>
<link href="/2020/11/14/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E3%80%81%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%BD%91%E7%BB%9C%E3%80%81%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%BB%84%E6%88%90%E5%8E%9F%E7%90%86%E4%B8%AD%E5%90%8C%E6%AD%A5%E5%92%8C%E5%BC%82%E6%AD%A5%E7%9A%84%E6%A6%82%E5%BF%B5/"/>
<url>/2020/11/14/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E3%80%81%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%BD%91%E7%BB%9C%E3%80%81%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%BB%84%E6%88%90%E5%8E%9F%E7%90%86%E4%B8%AD%E5%90%8C%E6%AD%A5%E5%92%8C%E5%BC%82%E6%AD%A5%E7%9A%84%E6%A6%82%E5%BF%B5/</url>
<content type="html"><![CDATA[<h1 id="操作系统中"><a class="markdownIt-Anchor" href="#操作系统中"></a> 操作系统中</h1><h2 id="同步"><a class="markdownIt-Anchor" href="#同步"></a> 同步</h2><p>在并发环境下,保持操作之间的偏序关系的行为。</p><p>进程同步是指多个进程中发生的事件存在某种时序关系,必须协同动作共同完成一个任务。简单来讲同步是一种协作关系。</p><p><strong>同步亦称直接制约关系,它是指为完成某种任务而建立的两个或多个进程,这些进程因为需要在某些位置上协调它们的工作次序而等待、传递信息所产生的制约关系</strong></p><p>举几个例子:<br />当两个进程运行时,进程A需要获取进程B此时运行到某一步的运行结果或者信息,才能进行自己的下一步工作,这个时候就得等待进程B与自己通信(发送某一个消息或信号),进程A再继续执行。这种进程之间相互等待对方发送消息或信号的协作就叫做进程同步。或者工厂的流水线,每道工序都有自己特定的任务,前一道工序没有完成或不合格后一道工序就不能进行。再或者ABC三个进程分别负责输入、处理、输出数据,A必须先执行,B次之,最后C。</p><h2 id="异步"><a class="markdownIt-Anchor" href="#异步"></a> 异步</h2><p>异步性:是指进程以不可预知的速度向前推进。在多道程序环境下,进程是并发执行的,不同进程之间存在着不同的相互制约关系(一般是资源问题)。内存中的每个进程何时执行,何时暂停,以怎样的速度向前推进,程序总共需要多少时间才能完成等,都是不可预知的。</p><h2 id="互斥"><a class="markdownIt-Anchor" href="#互斥"></a> 互斥</h2><p>多个进程在运行过程中,都需要某一个资源时,它们便产生了竞争关系,它们可能竞争某一块内存空间,也可能竞争某一个IO设备。当一方获取资源时,其他进程只能在该进程释放资源之后 才能去访问该资源,这就是进程互斥。简单来说,互斥是一种竞争关系。<br />举例:假如多个进程同时申请一台打印机,而先申请打印机的一方先使用打印机,当它用完时在给其他进程使用。在一个进程使用打印机期间,其他进程对打印机的使用申请不予满足,这些进程必须等待。</p><h3 id="同步和异步"><a class="markdownIt-Anchor" href="#同步和异步"></a> 同步和异步</h3><p>在现代操作系统中,有并发性,共享性,虚拟性,不确定性四大基础特征。而程序并发活动的实现是异步(一个程序走走停停),并发控制的时候需要用到同步技术。</p><p>所以并发控制需要同步,并发的实现是异步,同步过多又会导致死锁。在并发领域有一句经典的话,并发执行的可串行化。那么并行是什么?并行才是真正的并发。并发只不过在占用时间片不同上实现的。</p><h1 id="计算机网络"><a class="markdownIt-Anchor" href="#计算机网络"></a> 计算机网络:</h1><p>同步通信简单的说就是你在发送数据时候我必须同时接受。这个过程有精确的时钟控制。</p><p>而异步通信是你在发数据时候必须加上开始与结束符号,这样我才可以接受,异步通信没有时钟控制。因为没有了时钟的控制(额外硬件),所以成本低,设备简单,但是传输效率较低。(开始与结束符占了开销)。</p><h1 id="机组"><a class="markdownIt-Anchor" href="#机组"></a> 机组:</h1><p>同步与异步在I/O中指的是一种数据访问机制。</p><p>同步指的是主动请求后等待I/O,数据就绪后读写必须阻塞。</p><p>异步指的是主动请求后,可处理其他任务,等I/O完毕后通知。</p><h1 id="总结"><a class="markdownIt-Anchor" href="#总结"></a> 总结:</h1><p>这三者的同步和异步相类似。只是操作系统中的同步和异步并不像相对关系。</p><p>操作系统中,同步是对于进程和进程而言。异步更像是宏观的看各个进程。</p><h2 id="同步-2"><a class="markdownIt-Anchor" href="#同步-2"></a> 同步</h2><ol><li>同步是阻塞模式;</li><li>同步是按顺序执行,执行完一个再执行下一个,需要等待,协调运行;</li></ol><h2 id="异步-2"><a class="markdownIt-Anchor" href="#异步-2"></a> 异步:</h2><ol><li>异步是非阻塞模式,无需等待;</li><li>异步是彼此独立,在等待某事件的过程中,继续做自己的事,不需要等待这一事件完成后再工作。线程是异步实现的一个方式。</li></ol><h1 id="参考链接"><a class="markdownIt-Anchor" href="#参考链接"></a> 参考链接</h1><p><a href="https://blog.csdn.net/qq_38289815/article/details/81012826">操作系统中的同步和异步</a><br /><a href="https://blog.51cto.com/thinklili/1742869">同步与异步到底是什么???</a></p>]]></content>
<categories>
<category> 操作系统 </category>
</categories>
<tags>
<tag> 操作系统 </tag>
<tag> 计算机组成原理 </tag>
<tag> 计算机网络 </tag>
</tags>
</entry>
<entry>
<title>Django 返回相对路径和绝对路径</title>
<link href="/2020/11/09/Django-%E8%BF%94%E5%9B%9E%E7%9B%B8%E5%AF%B9%E8%B7%AF%E5%BE%84%E5%92%8C%E7%BB%9D%E5%AF%B9%E8%B7%AF%E5%BE%84/"/>
<url>/2020/11/09/Django-%E8%BF%94%E5%9B%9E%E7%9B%B8%E5%AF%B9%E8%B7%AF%E5%BE%84%E5%92%8C%E7%BB%9D%E5%AF%B9%E8%B7%AF%E5%BE%84/</url>
<content type="html"><![CDATA[<h1 id="imagefiled"><a class="markdownIt-Anchor" href="#imagefiled"></a> imagefiled</h1><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">user_directory_path</span>(<span class="params">instance, filename</span>):</span></span><br><span class="line"> <span class="comment"># file will be uploaded to MEDIA_ROOT/user_<id>/<filename></span></span><br><span class="line"> <span class="keyword">return</span> <span class="string">'user_{0}/{1}'</span>.<span class="built_in">format</span>(instance.user.<span class="built_in">id</span>, filename)</span><br><span class="line"></span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">MyModel</span>(<span class="params">models.Model</span>):</span></span><br><span class="line"> image = models.FileField(upload_to=user_directory_path)</span><br></pre></td></tr></table></figure><ul><li><code>1image.url</code> 返回相对路径</li><li><code>image.path</code> 返回绝对路径</li></ul>]]></content>
<categories>
<category> Django </category>
</categories>
<tags>
<tag> Django </tag>
</tags>
</entry>
<entry>
<title>在Linux上使用Nginx + Gunicorn部署Django工程</title>
<link href="/2020/11/09/%E5%9C%A8Linux%E4%B8%8A%E4%BD%BF%E7%94%A8Nginx-Gunicorn%E9%83%A8%E7%BD%B2Django%E5%B7%A5%E7%A8%8B/"/>
<url>/2020/11/09/%E5%9C%A8Linux%E4%B8%8A%E4%BD%BF%E7%94%A8Nginx-Gunicorn%E9%83%A8%E7%BD%B2Django%E5%B7%A5%E7%A8%8B/</url>
<content type="html"><![CDATA[<h1 id="tmux-start-django"><a class="markdownIt-Anchor" href="#tmux-start-django"></a> tmux + start django</h1><h2 id="tmux"><a class="markdownIt-Anchor" href="#tmux"></a> tmux</h2><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">tmux new -s session_name # 创建名为 session_name 的 tmux session</span><br><span class="line">tmux attach -t session_name # 重新回到叫做 session_name 的 tmux session</span><br><span class="line">tmux switch -t session_name # 切换到叫做 session_name 的 tmux session</span><br><span class="line">tmux list-sessions / tmux ls # 列出现有的所有 session</span><br><span class="line">tmux detach # 离开当前开启的 session</span><br><span class="line">tmux kill-server # 关闭所有 session</span><br></pre></td></tr></table></figure><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">ctrl + b</span><br><span class="line">? 列出所有快捷键;按q返回</span><br><span class="line">d 脱离当前会话,可暂时返回Shell界面</span><br><span class="line">s 选择并切换会话;在同时开启了多个会话时使用</span><br><span class="line">D 选择要脱离的会话;在同时开启了多个会话时使用</span><br><span class="line">: 进入命令行模式;此时可输入支持的命令,例如 kill-server 关闭所有tmux会话</span><br><span class="line">[ 复制模式,光标移动到复制内容位置,空格键开始,方向键选择复制,回车确认,q/Esc退出</span><br><span class="line">] 进入粘贴模式,粘贴之前复制的内容,按q/Esc退出</span><br><span class="line">~ 列出提示信息缓存;其中包含了之前tmux返回的各种提示信息</span><br><span class="line">t 显示当前的时间</span><br><span class="line">ctrl + z 挂起当前会话</span><br></pre></td></tr></table></figure><h2 id="nginx"><a class="markdownIt-Anchor" href="#nginx"></a> nginx</h2><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo systemctl status nginx</span><br></pre></td></tr></table></figure><h2 id="gunicorn-部署"><a class="markdownIt-Anchor" href="#gunicorn-部署"></a> gunicorn 部署</h2><h3 id="nginx-收集静态文件"><a class="markdownIt-Anchor" href="#nginx-收集静态文件"></a> nginx 收集静态文件</h3><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">STATIC_ROOT = os.path.join(BASE_DIR, <span class="string">'static'</span>)</span><br></pre></td></tr></table></figure><h3 id="gunicorn-部署-2"><a class="markdownIt-Anchor" href="#gunicorn-部署-2"></a> gunicorn 部署</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">pip install gunicorn</span><br></pre></td></tr></table></figure><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">conda run gunicorn darwinproject.wsgi -w 2 -k gthread -b 0.0.0.0:8000</span><br></pre></td></tr></table></figure><p>收集静态文件</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">python manage.py collectstatic</span><br></pre></td></tr></table></figure>]]></content>
<categories>
<category> Django </category>
</categories>
<tags>
<tag> Django </tag>
</tags>
</entry>
<entry>
<title>快速创建一个Django项目并进行相应配置</title>
<link href="/2020/11/09/%E5%BF%AB%E9%80%9F%E5%88%9B%E5%BB%BA%E4%B8%80%E4%B8%AADjango%E9%A1%B9%E7%9B%AE%E5%B9%B6%E8%BF%9B%E8%A1%8C%E7%9B%B8%E5%BA%94%E9%85%8D%E7%BD%AE/"/>
<url>/2020/11/09/%E5%BF%AB%E9%80%9F%E5%88%9B%E5%BB%BA%E4%B8%80%E4%B8%AADjango%E9%A1%B9%E7%9B%AE%E5%B9%B6%E8%BF%9B%E8%A1%8C%E7%9B%B8%E5%BA%94%E9%85%8D%E7%BD%AE/</url>
<content type="html"><![CDATA[<h1 id="start-a-project"><a class="markdownIt-Anchor" href="#start-a-project"></a> start a project</h1><h2 id="django-基本命令"><a class="markdownIt-Anchor" href="#django-基本命令"></a> django 基本命令</h2><ul><li>输入以下命令新建一个django project</li></ul><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">django-admin startproject xxx</span><br></pre></td></tr></table></figure><ul><li>新建一个app</li></ul><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">python manage.py startapp polls</span><br></pre></td></tr></table></figure><ul><li>创建超级用户</li></ul><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">python manage.py createsuperuser</span><br></pre></td></tr></table></figure><ul><li>删除数据库</li></ul><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">rm -f db.sqlite3</span><br><span class="line">rm -r snippets/migrations</span><br><span class="line">python manage.py makemigrations snippets</span><br><span class="line">python manage.py migrate</span><br></pre></td></tr></table></figure><h2 id="msql"><a class="markdownIt-Anchor" href="#msql"></a> msql</h2><h3 id="windows-django20"><a class="markdownIt-Anchor" href="#windows-django20"></a> windows django2.0</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">pip install mysql-connector-python</span><br></pre></td></tr></table></figure><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">DATABASES = {</span><br><span class="line"> <span class="string">'default'</span>: {</span><br><span class="line"> <span class="string">'ENGINE'</span>: <span class="string">'mysql.connector.django'</span>, <span class="comment"># 数据库引擎</span></span><br><span class="line"> <span class="string">'NAME'</span>: <span class="string">'django_project'</span>, <span class="comment"># 数据库名,先前创建的</span></span><br><span class="line"> <span class="string">'USER'</span>: <span class="string">'lll'</span>, <span class="comment"># 用户名,可以自己创建用户</span></span><br><span class="line"> <span class="string">'PASSWORD'</span>: <span class="string">'123456'</span>, <span class="comment"># 密码</span></span><br><span class="line"> <span class="string">'HOST'</span>: <span class="string">'127.0.0.1'</span>, <span class="comment"># mysql服务所在的主机ip</span></span><br><span class="line"> <span class="string">'PORT'</span>: <span class="string">'3306'</span>, <span class="comment"># mysql服务端口</span></span><br><span class="line"> }</span><br><span class="line">}</span><br><span class="line"></span><br></pre></td></tr></table></figure><h3 id="windows-django30"><a class="markdownIt-Anchor" href="#windows-django30"></a> windows django3.0</h3><p>把mysqlclient 更新到最新版,用Linux的配置就可以</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">pip install mysqlclient==1.4.6 </span><br></pre></td></tr></table></figure><h3 id="linux"><a class="markdownIt-Anchor" href="#linux"></a> linux</h3><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">DATABASES = {</span><br><span class="line"> <span class="string">'default'</span>: {</span><br><span class="line"> <span class="string">'ENGINE'</span>: <span class="string">'django.db.backends.mysql'</span>, <span class="comment"># 数据库引擎</span></span><br><span class="line"> <span class="string">'NAME'</span>: <span class="string">'darwin'</span>, <span class="comment"># 数据库名,先前创建的</span></span><br><span class="line"> <span class="string">'USER'</span>: <span class="string">'lll'</span>, <span class="comment"># 用户名,可以自己创建用户</span></span><br><span class="line"> <span class="string">'PASSWORD'</span>: <span class="string">'123456'</span>, <span class="comment"># 密码</span></span><br><span class="line"> <span class="string">'HOST'</span>: <span class="string">'127.0.0.1'</span>, <span class="comment"># mysql服务所在的主机ip</span></span><br><span class="line"> <span class="string">'PORT'</span>: <span class="string">'3306'</span>, <span class="comment"># mysql服务端口</span></span><br><span class="line"> }</span><br><span class="line">}</span><br></pre></td></tr></table></figure><h3 id="一些方法"><a class="markdownIt-Anchor" href="#一些方法"></a> 一些方法</h3><ul><li><code>.is_valid()</code></li></ul><h2 id="rest-framework"><a class="markdownIt-Anchor" href="#rest-framework"></a> rest framework</h2><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">pip install djangorestframework</span><br><span class="line">pip install markdown # Markdown support for the browsable API.</span><br><span class="line">pip install django-filter # Filtering support</span><br></pre></td></tr></table></figure><p>web api 框架</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">超链接关系 很好的RESTful设计 -- HyperlinkedModelSerializer</span><br></pre></td></tr></table></figure><h2 id="分页器"><a class="markdownIt-Anchor" href="#分页器"></a> 分页器</h2><p>分页器允许你控制每页返回的数据条数。添加以下配置到 <code>tutorial/settings.py</code> 中使之生效</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">REST_FRAMEWORK = {</span><br><span class="line"> 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',</span><br><span class="line"> 'PAGE_SIZE': 10</span><br><span class="line">}</span><br></pre></td></tr></table></figure><p>产生如下效果:</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line">{</span><br><span class="line"> "count": 2,</span><br><span class="line"> "next": null,</span><br><span class="line"> "previous": null,</span><br><span class="line"> "results": [</span><br><span class="line"> {</span><br><span class="line"> "email": "[email protected]",</span><br><span class="line"> "groups": [],</span><br><span class="line"> "url": "http://127.0.0.1:8000/users/1/",</span><br><span class="line"> "username": "admin"</span><br><span class="line"> },</span><br><span class="line"> {</span><br><span class="line"> "email": "[email protected]",</span><br><span class="line"> "groups": [ ],</span><br><span class="line"> "url": "http://127.0.0.1:8000/users/2/",</span><br><span class="line"> "username": "tom"</span><br><span class="line"> }</span><br><span class="line"> ]</span><br><span class="line">}</span><br></pre></td></tr></table></figure><h2 id="xadmin"><a class="markdownIt-Anchor" href="#xadmin"></a> xadmin</h2><p>替换掉admin的一种选择</p><h2 id="mysql"><a class="markdownIt-Anchor" href="#mysql"></a> Mysql</h2><h3 id="进入数据库"><a class="markdownIt-Anchor" href="#进入数据库"></a> 进入数据库</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo mysql -u root -p</span><br></pre></td></tr></table></figure><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#</span><span class="bash"><span class="comment">#1 创建数据库weixx</span></span></span><br><span class="line">CREATE DATABASE darwin CHARACTER SET utf8;</span><br><span class="line"><span class="meta">#</span><span class="bash"><span class="comment">#2 创建用户wxx(密码123456) mysql 5.7</span></span></span><br><span class="line">并允许wxx用户可以从任意机器上登入mysql的weixx数据库</span><br><span class="line"> GRANT ALL PRIVILEGES ON darwin.* TO anadem@"%" IDENTIFIED BY "123456"; </span><br><span class="line"><span class="meta">#</span><span class="bash"><span class="comment"># mysql 8.0</span></span></span><br><span class="line">create user 'anadem'@'%' identified by '123456';</span><br><span class="line">grant all privileges on *.* to 'anadem'@'%';</span><br></pre></td></tr></table></figure><h3 id="数据库迁移"><a class="markdownIt-Anchor" href="#数据库迁移"></a> 数据库迁移</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">python manage.py dumpdata > data.json</span><br></pre></td></tr></table></figure><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">python manage.py loaddata data.json</span><br></pre></td></tr></table></figure><h2 id="跨域"><a class="markdownIt-Anchor" href="#跨域"></a> 跨域</h2><p>百度吧,挺多的。</p>]]></content>
<categories>
<category> Django </category>
</categories>
<tags>
<tag> Django </tag>
</tags>
</entry>
<entry>
<title>什么是光栅化?</title>
<link href="/2020/11/02/%E4%BB%80%E4%B9%88%E6%98%AF%E5%85%89%E6%A0%85%E5%8C%96%EF%BC%9F/"/>
<url>/2020/11/02/%E4%BB%80%E4%B9%88%E6%98%AF%E5%85%89%E6%A0%85%E5%8C%96%EF%BC%9F/</url>
<content type="html"><![CDATA[<h1 id="光栅化"><a class="markdownIt-Anchor" href="#光栅化"></a> 光栅化</h1><p>首先,光栅化(Rasterize/rasteriztion)。这个词儿Adobe官方翻译成栅格化或者像素化。没错,就是把矢量图形转化成像素点儿的过程。我们屏幕上显示的画面都是由像素组成,而三维物体都是点线面构成的。要让点线面,变成能在屏幕上显示的像素,就需要Rasterize这个过程。就是从矢量的点线面的描述,变成像素的描述。如下图,这是一个放大了1200%的屏幕,前面是告诉计算机我有一个圆形,后面就是计算机把圆形转换成可以显示的像素点。这个过程就是Rasterize。</p><h1 id="参考链接"><a class="markdownIt-Anchor" href="#参考链接"></a> 参考链接</h1><p><a href="https://www.zhihu.com/question/29163054/answer/46695506">如何理解 OpenGL 中着色器、渲染管线、光栅化等概念? - Benjamin Hsu的回答 - 知乎</a></p>]]></content>
<categories>
<category> 图形学 </category>
</categories>
<tags>
<tag> 图形学 </tag>
</tags>
</entry>
<entry>
<title>最短寻道时间优先算法(SSTF)</title>
<link href="/2020/10/22/%E6%9C%80%E7%9F%AD%E5%AF%BB%E9%81%93%E6%97%B6%E9%97%B4%E4%BC%98%E5%85%88%E7%AE%97%E6%B3%95%EF%BC%88SSTF%EF%BC%89/"/>
<url>/2020/10/22/%E6%9C%80%E7%9F%AD%E5%AF%BB%E9%81%93%E6%97%B6%E9%97%B4%E4%BC%98%E5%85%88%E7%AE%97%E6%B3%95%EF%BC%88SSTF%EF%BC%89/</url>
<content type="html"><![CDATA[<h1 id="sstf问题描述"><a class="markdownIt-Anchor" href="#sstf问题描述"></a> SSTF问题描述:</h1><p>SSTF算法选择调度处理的磁道是与当前磁头所在磁道距离最近的磁道,以使每次的寻找时间最短。当然,总是选择最小寻找时间并不能保证平均寻找时间最小,但是能提供比FCFS算法更好的性能。这种算法会产生“饥饿”现象。</p><h2 id="优点"><a class="markdownIt-Anchor" href="#优点"></a> 优点</h2><p>改善了磁盘平均服务时间。</p><h2 id="缺点"><a class="markdownIt-Anchor" href="#缺点"></a> 缺点</h2><p>优先级低的进程会发生“饥饿”现象。因为新进程请求到达,且其所要访问的磁道与磁头当前所在的磁道距离较近,必先优先满足。</p><h2 id="思想"><a class="markdownIt-Anchor" href="#思想"></a> 思想:</h2><p>本算法是对输入的磁道首先进行非递减排序,然后判断当前磁头所在的磁道是否在将要寻找的磁道中,分别进行最短寻道时间计算。(如下图示,表示SSTF示意图)</p><p><img src="https://img-blog.csdnimg.cn/img_convert/c6cfa3e29a043259e598dbd5c36eaec2.png" alt="" /></p><h1 id="不是最优的例子"><a class="markdownIt-Anchor" href="#不是最优的例子"></a> 不是最优的例子:</h1><p>若干个等待访问磁盘者依次要访问的磁道为 100,142,150,155,170,300,当前磁头位于 150 号柱面,若用最短寻道时间优先磁盘调度算法,则访问序列为<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mo stretchy="false">[</mo><mn>150</mn><mo separator="true">,</mo><mn>155</mn><mo separator="true">,</mo><mn>142</mn><mo separator="true">,</mo><mn>170</mn><mo separator="true">,</mo><mn>100</mn><mo separator="true">,</mo><mn>300</mn><mo stretchy="false">]</mo></mrow><annotation encoding="application/x-tex">[150,155,142,170,100,300]</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">[</span><span class="mord">1</span><span class="mord">5</span><span class="mord">0</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord">1</span><span class="mord">5</span><span class="mord">5</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord">1</span><span class="mord">4</span><span class="mord">2</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord">1</span><span class="mord">7</span><span class="mord">0</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord">1</span><span class="mord">0</span><span class="mord">0</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord">3</span><span class="mord">0</span><span class="mord">0</span><span class="mclose">]</span></span></span></span></p><hr /><p>根据最短寻道时间优先磁盘调度算法,每次在寻找下一个磁道时,都要选择离自己最近的,所以当前磁头位于40号,下一道选择与40绝对值最小的,即40,再下一道选择43,差值为3,以此类推,最后的访问序列应该为,<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mo stretchy="false">[</mo><mn>150</mn><mo separator="true">,</mo><mn>155</mn><mo separator="true">,</mo><mn>142</mn><mo separator="true">,</mo><mn>170</mn><mo separator="true">,</mo><mn>100</mn><mo separator="true">,</mo><mn>300</mn><mo stretchy="false">]</mo></mrow><annotation encoding="application/x-tex">[150,155,142,170,100,300]</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">[</span><span class="mord">1</span><span class="mord">5</span><span class="mord">0</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord">1</span><span class="mord">5</span><span class="mord">5</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord">1</span><span class="mord">4</span><span class="mord">2</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord">1</span><span class="mord">7</span><span class="mord">0</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord">1</span><span class="mord">0</span><span class="mord">0</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord">3</span><span class="mord">0</span><span class="mord">0</span><span class="mclose">]</span></span></span></span><br />hexo</p><p>SSTF算法选择调度处理的磁道是与当前磁头所在磁道距离最近的磁道,以使每次的寻找时间最短。当然,总是选择最小寻找时间并不能保证平均寻找时间最小,但是能提供比FCFS算法更好的性能。这种算法会产生“饥饿”现象。</p><h2 id="简单想"><a class="markdownIt-Anchor" href="#简单想"></a> 简单想:</h2><p>可以想象这样一个序列,磁头目前在最中间。</p><ol><li>第一次寻道,离磁头最近磁道的在中点的左边,磁头移动到该位置。</li><li>第二次寻道,离磁头最近磁道的在中点的右边,磁头移动到该位置。</li><li>第三次寻道,离磁头最近磁道的在中点的左边,磁头移动到该位置。</li><li>…</li></ol><p>如此,磁头一直在中点往复,显然不如寻完一侧的磁道再寻另一侧更优。<br /><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20201022165317231.png" style="zoom: 30%;" /></p>]]></content>
<categories>
<category> 操作系统 </category>
</categories>
<tags>
<tag> 操作系统 </tag>
</tags>
</entry>
<entry>
<title>图形学 glut 一些库的理解(持续更新)</title>
<link href="/2020/10/12/%E5%9B%BE%E5%BD%A2%E5%AD%A6-glut-%E4%B8%80%E4%BA%9B%E5%BA%93%E7%9A%84%E7%90%86%E8%A7%A3%EF%BC%88%E6%8C%81%E7%BB%AD%E6%9B%B4%E6%96%B0%EF%BC%89/"/>
<url>/2020/10/12/%E5%9B%BE%E5%BD%A2%E5%AD%A6-glut-%E4%B8%80%E4%BA%9B%E5%BA%93%E7%9A%84%E7%90%86%E8%A7%A3%EF%BC%88%E6%8C%81%E7%BB%AD%E6%9B%B4%E6%96%B0%EF%BC%89/</url>
<content type="html"><![CDATA[<p><ul class="markdownIt-TOC"><li><ul><li><a href="#void-glutdisplayfunc">void glutDisplayFunc()</a></li></ul></li><li><a href="#glclearcolor-%E8%AE%BE%E7%BD%AE%E9%A2%9C%E8%89%B2%E7%BC%93%E5%AD%98%E7%9A%84%E6%B8%85%E9%99%A4%E5%80%BC">glClearColor ( )设置颜色缓存的清除值</a></li><li><a href="#glclear-%E5%B0%86%E7%BC%93%E5%AD%98%E6%B8%85%E9%99%A4%E4%B8%BA%E9%A2%84%E5%85%88%E7%9A%84%E8%AE%BE%E7%BD%AE%E5%80%BC">glClear ( ) 将缓存清除为预先的设置值</a></li><li><a href="#glcolor">glColor ( )</a></li><li><a href="#glshademodel-2">glShadeModel ( )</a></li><li><a href="#glcleardepth-%E8%AE%BE%E7%BD%AE%E6%B7%B1%E5%BA%A6%E7%BC%93%E5%AD%98%E7%9A%84%E6%B8%85%E9%99%A4%E5%80%BC">glClearDepth ( ) 设置深度缓存的清除值</a></li><li><a href="#gldepthfunc-%E6%8C%87%E5%AE%9A%E7%94%A8%E4%BA%8E%E6%B7%B1%E5%BA%A6%E7%BC%93%E5%86%B2%E7%9A%84%E6%AF%94%E8%BE%83%E5%80%BC">glDepthFunc ( ) 指定用于深度缓冲的比较值</a></li></ul></p><h1 id="glmatrixmode"><a class="markdownIt-Anchor" href="#glmatrixmode"></a> glMatrixMode</h1><p>GL_PROJECTION 投影, GL_MODELVIEW 模型视图, GL_TEXTURE 纹理.</p><p><a href="https://www.jianshu.com/p/6bd2f4628b37">glMatrixMode参考链接</a></p><h1 id="glshademodel"><a class="markdownIt-Anchor" href="#glshademodel"></a> glShadeModel</h1><p><img src="https://img-blog.csdnimg.cn/img_convert/58b470be7bd90b576e90e627a8f8f81e.png" alt="GL_FLAT GL_SMOOTH" /></p><p>GL_SMOOTH会出现过渡效果,GL_FLAT则只是以指定的某一点的单一色绘制其他所有点</p><p><a href="https://blog.csdn.net/chenqiai0/article/details/8316258">glShadeModel参考链接</a></p><h1 id="回调函数"><a class="markdownIt-Anchor" href="#回调函数"></a> 回调函数</h1><h3 id="void-glutdisplayfunc"><a class="markdownIt-Anchor" href="#void-glutdisplayfunc"></a> void glutDisplayFunc()</h3><p>注册当前窗口的显示回调函数</p><p>这个函数告诉GLUT当窗口内容必须被绘制时,那个函数将被调用。当窗口改变大小或者从被覆盖的状态</p><p><a href="https://blog.csdn.net/xianhua7877/article/details/81271618">回调函数参考链接</a></p><h1 id="颜色"><a class="markdownIt-Anchor" href="#颜色"></a> 颜色</h1><h2 id="glclearcolor-设置颜色缓存的清除值"><a class="markdownIt-Anchor" href="#glclearcolor-设置颜色缓存的清除值"></a> glClearColor ( )设置颜色缓存的清除值</h2><p>glClearColor ( ) 就是用来设置这个 “ 底色 ” 的,即所谓的背景颜色。glClearColor ( ) 只起到Set 的作用,并不Clear 任何。</p><p>glClearColor ( ) 的作用是指定刷新颜色缓冲区时所用的颜色,所以完成一个刷新的过程是要 glClearColor ( COLOR) 与glClear ( GL_COLOR_BUFFER_BIT) 配合使用。</p><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">glClearColor</span>(<span class="number">1.0</span>, <span class="number">0.0</span>, <span class="number">0.0</span>, <span class="number">1.0</span>);<span class="comment">//红色</span></span><br><span class="line"><span class="built_in">glClear</span>(GL_COLOR_BUFFER_BIT); <span class="comment">//GL_COLOR_BUFFER_BIT 是缓冲标志位,表明需要清除的缓冲是颜色缓冲</span></span><br></pre></td></tr></table></figure><p>清除颜色缓冲区的作用是防止缓冲区中原有的颜色信息影响本次绘图(注意:即使认为可以直接覆盖原值,也是有可能会有影响),当绘图区域为整个窗口时,就是通常看到的,颜色缓冲区的清除值就是窗口的背景颜色。所以,这两条清除指令并不是必须的,比如对于静态画面只需设置一次,比如不需要背景色 / 背景色为白色。</p><p>另外,glClear ( ) 比手动涂抹一个背景画布效率高且省力,所以通常使用这种方式。</p><h2 id="glclear-将缓存清除为预先的设置值"><a class="markdownIt-Anchor" href="#glclear-将缓存清除为预先的设置值"></a> glClear ( ) 将缓存清除为预先的设置值</h2><table><thead><tr><th><strong>mask</strong></th><th><strong>说明</strong></th></tr></thead><tbody><tr><td>GL_COLOR_BUFFER_BIT</td><td>指定当前被激活为写操作的颜色缓存</td></tr><tr><td>GL_DEPTH_BUFFER_BIT</td><td>指定深度缓存</td></tr><tr><td>GL_ACCUM_BUFFER_BIT</td><td>指定累加缓存</td></tr><tr><td>GL_STENCIL_BUFFER_BIT</td><td>指定模板缓存</td></tr></tbody></table><h2 id="glcolor"><a class="markdownIt-Anchor" href="#glcolor"></a> glColor ( )</h2><p>glColor ( ) 是用来设置画笔的颜色,即绘图颜色。属于RGBA模式。</p><h2 id="glshademodel-2"><a class="markdownIt-Anchor" href="#glshademodel-2"></a> glShadeModel ( )</h2><p>glShadeModel ( ) 函数用于控制 opengl 中绘制指定两点间其他点颜色的过渡模式。</p><p>参数一般为 GL_SMOOLH ( 默认 ) 或 GL_FLAT。</p><p>如果两点的颜色相同,则使用这两个参数效果相同;</p><p>如果两点颜色不同,GL_SMOOLH 会出现过渡效果; GL_FLAT 则以指定的某一点的单一色绘制其他所有点。</p><h2 id="glcleardepth-设置深度缓存的清除值"><a class="markdownIt-Anchor" href="#glcleardepth-设置深度缓存的清除值"></a> glClearDepth ( ) 设置深度缓存的清除值</h2><p>depth 指定清除深度缓存时使用的深度值,值范围在[ 0 , 1 ] 之间,初始值为1。该值将被用于glClear ( ) 函数清理深度缓冲区</p><h2 id="gldepthfunc-指定用于深度缓冲的比较值"><a class="markdownIt-Anchor" href="#gldepthfunc-指定用于深度缓冲的比较值"></a> glDepthFunc ( ) 指定用于深度缓冲的比较值</h2><table><thead><tr><th>func值</th><th>含义</th></tr></thead><tbody><tr><td>GL_NEVER</td><td>不通过(输入的深度值不取代参考值)</td></tr><tr><td>GL_LESS</td><td>如果输入的深度值小于参考值,则通过</td></tr><tr><td>GL_EQUAL</td><td>如果输入的深度值等于参考值,则通过</td></tr><tr><td>GL_LEQUAL</td><td>如果输入的深度值小于或等于参考值,则通过</td></tr><tr><td>GL_GREATER</td><td>如果输入的深度值大于参考值,则通过</td></tr><tr><td>GL_NOTE_QUAL</td><td>如果输入的深度值不等于参考值,则通过</td></tr><tr><td>GL_GEQUAL</td><td>如果输入的深度值大于或等于参考值,则通过</td></tr><tr><td>GL_ALWAYS</td><td>总是通过(输入的深度值取代参考值)</td></tr></tbody></table><h1 id="画线-gl_lines-gl_line_strip-gl_line_loop"><a class="markdownIt-Anchor" href="#画线-gl_lines-gl_line_strip-gl_line_loop"></a> 画线 GL_LINES & GL_LINE_STRIP & GL_LINE_LOOP</h1><ul><li>GL_LINES :每一对顶点被解释为一条直线</li><li>GL_LINE_STRIP: 一系列的连续直线</li><li>GL_LINE_LOOP:一系列的连续直线,且首尾相接</li></ul><p><a href="https://blog.csdn.net/xiaoxiaoyusheng2012/article/details/44197283">OpenGL绘线方式 GL_LINES与GL_LINE_STRIP的区别</a></p>]]></content>
<categories>
<category> 图形学 </category>
</categories>
<tags>
<tag> 图形学 </tag>
</tags>
</entry>
<entry>
<title>什么是简单路径?</title>
<link href="/2020/10/10/%E4%BB%80%E4%B9%88%E6%98%AF%E7%AE%80%E5%8D%95%E8%B7%AF%E5%BE%84%EF%BC%9F/"/>
<url>/2020/10/10/%E4%BB%80%E4%B9%88%E6%98%AF%E7%AE%80%E5%8D%95%E8%B7%AF%E5%BE%84%EF%BC%9F/</url>
<content type="html"><![CDATA[<h1 id="ans"><a class="markdownIt-Anchor" href="#ans"></a> Ans</h1><p>如果路径上的各顶点均不互相重复,称这样的路径为<strong>简单路径</strong>。如果路径上的第一个顶点与最后一个顶点重合,这样的路径称为回路(cycle)或环或圈。</p>]]></content>
<categories>
<category> 图论 </category>
</categories>
<tags>
<tag> 图论 </tag>
</tags>
</entry>
<entry>
<title>terminal shell tty console 的区别</title>
<link href="/2020/09/25/terminal-shell-tty-console-%E7%9A%84%E5%8C%BA%E5%88%AB/"/>
<url>/2020/09/25/terminal-shell-tty-console-%E7%9A%84%E5%8C%BA%E5%88%AB/</url>
<content type="html"><![CDATA[<p>A terminal is at the end of an electric wire, a shell is the home of a turtle, tty is a strange abbreviation and a console is a kind of cabinet.</p><p>Well, etymologically speaking, anyway.</p><p>In unix terminology, the short answer is that</p><ul><li>terminal = tty = text input/output environment</li><li>console = physical terminal</li><li>shell = command line interpreter</li></ul><hr /><p>Console ,terminal 和tty密切相关。 最初,它们是指一种设备,您可以通过它与计算机进行交互:在unix的早期,这意味着类似于打字机的电传打字机式设备,有时也称为电传打字机,或简称为“ tty”。 从电子的角度来看,“终端”这个名字,从家具的角度来看,这个名字是“Console”。 在Unix历史的早期,电子键盘和显示器成为终端的规范。</p><p>用Unix术语来说,tty是一种特殊的设备文件,它实现了除读写之外的许多其他命令(ioctl)。 在其最常见的含义中,terminal是tty的同义词。 某些tty由内核代表硬件设备提供,例如,输入来自键盘,输出进入文本模式屏幕,或者输入和输出通过串行线路传输。 其他tty,有时也称为伪tty,由称为终端仿真器的程序(通过薄内核层)提供,例如Xterm(在X Window系统中运行),Screen(在程序和另一个终端之间提供隔离层) ),Ssh(将一台计算机上的终端与另一台计算机上的程序连接),Expect(用于脚本化终端交互)。</p><p>终端一词还可以具有一种设备的更传统的含义,通过该设备,人们可以与计算机(通常是键盘和显示器)进行交互。 例如,X终端是一种瘦客户机,是一台专用计算机,其唯一用途是驱动键盘,显示器,鼠标以及偶尔其他人机交互外围设备,而实际应用程序则在另一台功能更强大的计算机上运行。</p><p>Console通常是物理意义上的终端,根据某种定义,它是直接连接到机器的主要终端。 Console在操作系统中显示为(内核实现的)tty。 在某些系统上,例如Linux和FreeBSD,控制台显示为多个tty(特殊的组合键在这些tty之间切换)。 只是为了混淆,给每个特定tty赋予的名称可以是“Console”,”virtual console”,”virtual terminal”,和其他变体。</p><hr /><p>Shell是用户登录时看到的主要界面,其主要目的是启动其他程序。 (我不知道最初的隐喻是shell是用户的家庭环境,还是该shell是其他程序在其中运行。)</p><p>在Unix圈子中,shell专门指命令行外壳,以输入要启动的应用程序的名称为中心,然后输入应用程序应作用的文件或其他对象的名称,然后按Enter键。 其他类型的环境不使用“外壳”一词; 例如,窗口系统涉及“窗口管理器”和“桌面环境”,而不涉及“外壳”。</p><p>有许多不同的unix shell。 交互式使用的流行shell包括Bash(大多数Linux安装中的默认设置),zsh(强调功能和可定制性)和fish(强调简单性)。</p><p>命令行外壳包含用于组合命令的流控制构造。 除了在交互式提示下键入命令外,用户还可以编写脚本。 最常见的Shell具有基于Bourne_shell的通用语法。 在讨论“ shell编程”时,几乎总是暗示该外壳是Bourne风格的外壳。 一些经常用于脚本编写但缺少高级交互功能的外壳包括Korn外壳(ksh)和许多ash变体。 几乎所有类似Unix的系统都有Bourne风格的shell安装为/ bin / sh,通常是ash,ksh或bash。</p><p>在unix系统管理中,用户的外壳程序是他们登录时调用的程序。普通用户帐户具有命令行外壳程序,但是访问受限的用户可能具有受限的外壳程序或某些其他特定命令(例如,用于文件传输) -仅帐户)。</p><hr /><p>The division of labor between the terminal and the shell is not completely obvious. Here are their main tasks.</p><ul><li>Input: the terminal converts keys into control sequences (e.g. Left → <code>\e[D</code>). The shell converts control sequences into commands (e.g. <code>\e[D</code> → <code>backward-char</code>).</li><li>Line editing, input history and completion are provided by the shell.<ul><li>The terminal may provide its own line editing, history and completion instead, and only send a line to the shell when it’s ready to be executed. The only common terminal that operates in this way is <code>M-x shell</code> in Emacs.</li></ul></li><li>Output: the shell emits instructions such as “display <code>foo</code>”, “switch the foreground color to green”, “move the cursor to the next line”, etc. The terminal acts on these instructions.</li><li>The prompt is purely a shell concept.</li><li>The shell never sees the output of the commands it runs (unless redirected). Output history (scrollback) is purely a terminal concept.</li><li>Inter-application copy-paste is provided by the terminal (usually with the mouse or key sequences such as Ctrl+Shift+V or Shift+Insert). The shell may have its own internal copy-paste mechanism as well (e.g. Meta+W and Ctrl+Y).</li><li><a href="http://en.wikipedia.org/wiki/Job_control">Job control</a> (launching programs in the background and managing them) is mostly performed by the shell. However, it’s the terminal that handles key combinations like Ctrl+C to kill the foreground job and Ctrl+Z to suspend it.</li></ul><h1 id="翻译自"><a class="markdownIt-Anchor" href="#翻译自"></a> 翻译自:</h1><p><a href="https://unix.stackexchange.com/a/4132">https://unix.stackexchange.com/a/4132</a></p>]]></content>
<categories>
<category> 操作系统 </category>
</categories>
<tags>
<tag> 操作系统 </tag>
</tags>
</entry>
<entry>
<title>【操作系统】中断 异常 陷入 程序调用 之间的关系</title>
<link href="/2020/09/23/%E3%80%90%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E3%80%91%E4%B8%AD%E6%96%AD-%E5%BC%82%E5%B8%B8-%E9%99%B7%E5%85%A5-%E7%A8%8B%E5%BA%8F%E8%B0%83%E7%94%A8-%E4%B9%8B%E9%97%B4%E7%9A%84%E5%85%B3%E7%B3%BB/"/>
<url>/2020/09/23/%E3%80%90%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E3%80%91%E4%B8%AD%E6%96%AD-%E5%BC%82%E5%B8%B8-%E9%99%B7%E5%85%A5-%E7%A8%8B%E5%BA%8F%E8%B0%83%E7%94%A8-%E4%B9%8B%E9%97%B4%E7%9A%84%E5%85%B3%E7%B3%BB/</url>
<content type="html"><![CDATA[<h1 id="前言"><a class="markdownIt-Anchor" href="#前言"></a> 前言:</h1><p>关于终端、异常、陷入三者之间的关系,网上有很多种分类,很多种解释。</p><p>本文对三者关系的阐述根据山东大学杨兴强教授教授的操作系统时的思路整理。</p><h1 id="外部中断-异常-陷入"><a class="markdownIt-Anchor" href="#外部中断-异常-陷入"></a> 外部中断、异常、陷入:</h1><p>简单的来说,中断分为<strong>陷入、异常、外部中断(外部设备的中断)</strong>。即这三者统称为中断。</p><p>其中陷入、异常又称为内部中断。</p><h2 id="外部中断"><a class="markdownIt-Anchor" href="#外部中断"></a> 外部中断:</h2><p>最容易被混淆,我们平常所说的<strong>中断</strong>既指大概念上的中断,又指的外部中断,这个要根据上下文推断。</p><h2 id="异常"><a class="markdownIt-Anchor" href="#异常"></a> 异常:</h2><p>CPU执行时出错,发出中断。是被动发生中断事件。</p><h2 id="陷入"><a class="markdownIt-Anchor" href="#陷入"></a> 陷入</h2><p>CPU主动跳转,比如断点调试和trap指令。使程序主动进入某一条指令流。</p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200923204042213.png" alt="不同类型中断事件的比较" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200923204435951.png" alt="中断响应过程" /></p><h2 id="内部-外部的关系"><a class="markdownIt-Anchor" href="#内部-外部的关系"></a> 内部、外部的关系?</h2><p>内部中断指的是CPU自身产生的中断。</p><p>外部中断指的外设产生的中断。</p><h1 id="中断和程序调用的区别"><a class="markdownIt-Anchor" href="#中断和程序调用的区别"></a> 中断和程序调用的区别</h1><ul><li><p>中断是CPU从执行某一程序流到执行另一程序流的过程。也就是从执行程序A到执行程序B,换了一个程序。</p></li><li><p>程序调用则不是这样,他还是在执行同一程序,可能是发生子函数调用等事件。</p></li></ul><h1 id="硬中断和软中断"><a class="markdownIt-Anchor" href="#硬中断和软中断"></a> 硬中断和软中断</h1><p>当然网上关于硬中断和软中断的概念划分有很多,各有道理。而我们认为:<strong>硬中断指的是外部设备中断,软中断指的异常和陷入。</strong></p>]]></content>
<categories>
<category> 操作系统 </category>
</categories>
<tags>
<tag> 操作系统 </tag>
</tags>
</entry>
<entry>
<title>Win 下 VSCode 配置 LaTeX format 自动格式化</title>
<link href="/2020/09/21/Win-%E4%B8%8B-VSCode-%E9%85%8D%E7%BD%AE-LaTeX-format-%E8%87%AA%E5%8A%A8%E6%A0%BC%E5%BC%8F%E5%8C%96/"/>
<url>/2020/09/21/Win-%E4%B8%8B-VSCode-%E9%85%8D%E7%BD%AE-LaTeX-format-%E8%87%AA%E5%8A%A8%E6%A0%BC%E5%BC%8F%E5%8C%96/</url>
<content type="html"><![CDATA[<h1 id="前言"><a class="markdownIt-Anchor" href="#前言"></a> 前言</h1><p>网上关于 win 下 VSCode 配置 LaTeX 自动格式化博客较少,现搜集相关资料整理了一个较简单的教程</p><h1 id="步骤"><a class="markdownIt-Anchor" href="#步骤"></a> 步骤</h1><h2 id="第一步下载latexindent"><a class="markdownIt-Anchor" href="#第一步下载latexindent"></a> 第一步:下载latexindent</h2><p><a href="https://ctan.org/tex-archive/support/latexindent">latexindent下载地址</a></p><h2 id="第二步解压缩文件放到自己常用目录"><a class="markdownIt-Anchor" href="#第二步解压缩文件放到自己常用目录"></a> 第二步:解压缩文件放到自己常用目录</h2><p><img src="https://img-blog.csdnimg.cn/img_convert/0ec73f7c0143ed4a91d3c7026d4dc2c4.png" alt="" /></p><h2 id="第三步在vscode用户json文件中添加如下"><a class="markdownIt-Anchor" href="#第三步在vscode用户json文件中添加如下"></a> 第三步:在VSCode用户Json文件中添加如下:</h2><h3 id="按f1输入settingsjson"><a class="markdownIt-Anchor" href="#按f1输入settingsjson"></a> 按F1,输入settings.json</h3><p><img src="https://img-blog.csdnimg.cn/img_convert/c37d6d05b522daaa472d865497ee06d9.png" alt="" /></p><h3 id="加入如下字段"><a class="markdownIt-Anchor" href="#加入如下字段"></a> 加入如下字段:</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">"latex-workshop.latexindent.path": "D:\\LLL\\latex\\latexindent\\latexindent.exe",</span><br></pre></td></tr></table></figure><p><img src="https://img-blog.csdnimg.cn/img_convert/fcdfcc88ef8bf94c9040e9c459e331a1.png" alt="" /></p><p><strong>大功告成</strong></p>]]></content>
<categories>
<category> LaTeX </category>
</categories>
<tags>
<tag> LaTeX </tag>
</tags>
</entry>
<entry>
<title>【数学建模】因子分析</title>
<link href="/2020/09/09/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91%E5%9B%A0%E5%AD%90%E5%88%86%E6%9E%90/"/>
<url>/2020/09/09/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91%E5%9B%A0%E5%AD%90%E5%88%86%E6%9E%90/</url>
<content type="html"><![CDATA[<h1 id="因子分析模型"><a class="markdownIt-Anchor" href="#因子分析模型"></a> 因子分析模型</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200909104908688.png" alt="" /></p><h2 id="因子分析和主成分分析的对比"><a class="markdownIt-Anchor" href="#因子分析和主成分分析的对比"></a> 因子分析和主成分分析的对比</h2><blockquote><p>因子分析结果不是唯一的,主成分分析是唯一的</p><p>主成分分析能做的因子分析都能做</p><p>且因子分析更容易解释,因此因子分析更加常用。</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200909105722940.png" alt="" /></p><h1 id="原理"><a class="markdownIt-Anchor" href="#原理"></a> 原理:</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200909110529575.png" alt="" /></p><p><span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>u</mi></mrow><annotation encoding="application/x-tex">u</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.43056em;vertical-align:0em;"></span><span class="mord mathdefault">u</span></span></span></span>是均值</p><h1 id="参数估计spss的使用"><a class="markdownIt-Anchor" href="#参数估计spss的使用"></a> 参数估计(SPSS的使用)</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200909112139204.png" alt="" /></p><h1 id="因子旋转的方法更好解释因子含义"><a class="markdownIt-Anchor" href="#因子旋转的方法更好解释因子含义"></a> 因子旋转的方法(更好解释因子含义)</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200909112318115.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200909112500443.png" alt="" /></p><blockquote><p>论文中使用的最多是最大方差法</p></blockquote><h1 id="因子得分"><a class="markdownIt-Anchor" href="#因子得分"></a> 因子得分</h1><blockquote><p>虽然和主成分分析很像,但并不一样</p><p>因子分析限制更多</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200909112637056.png" alt="" /></p><h1 id="例子"><a class="markdownIt-Anchor" href="#例子"></a> 例子:</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200909113408718.png" alt="" /></p><h2 id="参数解释"><a class="markdownIt-Anchor" href="#参数解释"></a> 参数解释:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200909113332757.png" alt="" /></p><h2 id="根据碎石图确定因子个数"><a class="markdownIt-Anchor" href="#根据碎石图确定因子个数"></a> 根据碎石图确定因子个数</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200909113851916.png" alt="" /></p><h2 id="小技巧标准化后的符号"><a class="markdownIt-Anchor" href="#小技巧标准化后的符号"></a> 小技巧:标准化后的符号:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200909114543247.png" alt="" /></p><h2 id="因子分析和主成分分析一样不能用于综合评价"><a class="markdownIt-Anchor" href="#因子分析和主成分分析一样不能用于综合评价"></a> 因子分析和主成分分析一样,不能用于综合评价:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200909114644498.png" alt="" /></p>]]></content>
<categories>
<category> 数学建模 </category>
</categories>
<tags>
<tag> 数学建模 </tag>
<tag> 因子分析 </tag>
</tags>
</entry>
<entry>
<title>【数学建模】主成分分析</title>
<link href="/2020/09/08/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91%E4%B8%BB%E6%88%90%E5%88%86%E5%88%86%E6%9E%90/"/>
<url>/2020/09/08/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91%E4%B8%BB%E6%88%90%E5%88%86%E5%88%86%E6%9E%90/</url>
<content type="html"><![CDATA[<h1 id="主成分分析"><a class="markdownIt-Anchor" href="#主成分分析"></a> 主成分分析</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200908205748343.png" alt="" /></p><h1 id="问题的提出"><a class="markdownIt-Anchor" href="#问题的提出"></a> 问题的提出:</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200908210002357.png" alt="" /></p><h2 id="降为的优点"><a class="markdownIt-Anchor" href="#降为的优点"></a> 降为的优点:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200908210852284.png" alt="" /></p><h1 id="例子"><a class="markdownIt-Anchor" href="#例子"></a> 例子:</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200908210905448.png" alt="" /></p><h2 id="主成分分析的思想"><a class="markdownIt-Anchor" href="#主成分分析的思想"></a> 主成分分析的思想:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200908211019073.png" alt="" /></p><p><img src="C:%5CUsers%5CAnadem%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5Cimage-20200908211207191.png" alt="" /></p><h2 id="写在论文中的内容"><a class="markdownIt-Anchor" href="#写在论文中的内容"></a> 写在论文中的内容</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200908211313682.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200908211347819.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200908211712615.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200908211650168.png" alt="" /></p><h1 id="例题1"><a class="markdownIt-Anchor" href="#例题1"></a> 例题1:</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200908212119491.png" alt="" /></p><h2 id="主成分简要分析"><a class="markdownIt-Anchor" href="#主成分简要分析"></a> 主成分简要分析</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200908213759220.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200908213948336.png" alt="" /></p><h1 id="例题2"><a class="markdownIt-Anchor" href="#例题2"></a> 例题2:</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200908214149755.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200908223412955.png" alt="" /></p><h1 id="误区不能用于求得分"><a class="markdownIt-Anchor" href="#误区不能用于求得分"></a> 误区,不能用于求得分:</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200908223620203.png" alt="" /></p><h1 id="应用聚类"><a class="markdownIt-Anchor" href="#应用聚类"></a> 应用:聚类:</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200908223642163.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200908224002827.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200908224357951.png" alt="" /></p>]]></content>
<categories>
<category> 数学建模 </category>
</categories>
<tags>
<tag> 数学建模 </tag>
<tag> 主成分分析 </tag>
</tags>
</entry>
<entry>
<title>【数学建模】预测模型 - 灰色模型</title>
<link href="/2020/09/08/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91%E9%A2%84%E6%B5%8B%E6%A8%A1%E5%9E%8B-%E7%81%B0%E8%89%B2%E6%A8%A1%E5%9E%8B/"/>
<url>/2020/09/08/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91%E9%A2%84%E6%B5%8B%E6%A8%A1%E5%9E%8B-%E7%81%B0%E8%89%B2%E6%A8%A1%E5%9E%8B/</url>
<content type="html"><![CDATA[<h1 id="预测模型-灰色模型"><a class="markdownIt-Anchor" href="#预测模型-灰色模型"></a> 预测模型 - 灰色模型·</h1><h1 id="前言"><a class="markdownIt-Anchor" href="#前言"></a> 前言:</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200908204044308.png" alt="灰、白、黑系统的区别" /></p><h1 id="什么时候用灰度预测"><a class="markdownIt-Anchor" href="#什么时候用灰度预测"></a> 什么时候用灰度预测?</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200908205259520.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200908205310456.png" alt="" /></p><h1 id="预测题目的套路"><a class="markdownIt-Anchor" href="#预测题目的套路"></a> 预测题目的套路</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200908205343486.png" alt="" /></p>]]></content>
<categories>
<category> 数学建模 </category>
</categories>
<tags>
<tag> 数学建模 </tag>
<tag> 预测模型 </tag>
</tags>
</entry>
<entry>
<title>【数学建模】时间序列分析:指数平滑和ARIMA模型</title>
<link href="/2020/09/07/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91%E6%97%B6%E9%97%B4%E5%BA%8F%E5%88%97%E6%A8%A1%E5%9E%8B/"/>
<url>/2020/09/07/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91%E6%97%B6%E9%97%B4%E5%BA%8F%E5%88%97%E6%A8%A1%E5%9E%8B/</url>
<content type="html"><![CDATA[<h1 id="时间序列分析"><a class="markdownIt-Anchor" href="#时间序列分析"></a> 时间序列分析</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200906154108021.png" alt="" /></p><h2 id="前言"><a class="markdownIt-Anchor" href="#前言"></a> 前言</h2><p>很多人认为index{ARIMA-ETS equivalences}ARIMA模型相较于指数平滑模型(ETS)更为一般化,这其实是一个较为普遍的错误认识。虽然线性指数平滑模型其实都是 ARIMA 模型的特例,但是非线性的指数平滑模型在 ARIMA 模型中并没有对应的部分。另一方面,也有很多 ARIMA 模型不包含指数平滑的部分。二者还有一个重要区别:所有指数平滑模型都是非平稳的,而有些ARIMA模型是平稳的。</p><h2 id="拥有季节性或者非衰减趋势的指数平滑模型拥有两个单位根即它们需要进行两次差分来实现平稳其他所有指数平滑模型只有一个单位根它们需要一次差分来实现平稳"><a class="markdownIt-Anchor" href="#拥有季节性或者非衰减趋势的指数平滑模型拥有两个单位根即它们需要进行两次差分来实现平稳其他所有指数平滑模型只有一个单位根它们需要一次差分来实现平稳"></a> 拥有季节性或者非衰减趋势的指数平滑模型拥有两个单位根(即它们需要进行两次差分来实现平稳),其他所有指数平滑模型只有一个单位根(它们需要一次差分来实现平稳)。</h2><p>ARIMA模型提供了另一种时间序列预测的方法。指数平滑模型(exponential smoothing)和ARIMA模型是应用最为广泛的两种时间序列预测方法,基于对这两种预测方法的拓展,很多其他的预测方法得以诞生。与指数平滑模型针对于数据中的趋势(trend)和季节性(seasonality)不同,ARIMA模型旨在描绘数据的自回归性(autocorrelations)。</p><p>在引入ARIMA模型之前,我们需要先讨论平稳性(stationarity)和差分时间序列(differencing time series)的相关知识。</p><h2 id="时期序列和时点序列的概念"><a class="markdownIt-Anchor" href="#时期序列和时点序列的概念"></a> 时期序列和时点序列的概念</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200906154222910.png" alt="" /></p><blockquote><p>时期序列可加,时点不可加</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200906154602399.png" alt="" /></p><h1 id="时间序列分解"><a class="markdownIt-Anchor" href="#时间序列分解"></a> 时间序列分解</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200906154651244.png" alt="" /></p><h1 id="叠加模型和乘积模型"><a class="markdownIt-Anchor" href="#叠加模型和乘积模型"></a> 叠加模型和乘积模型</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200906155114618.png" alt="" /></p><h1 id="如何处理缺失值"><a class="markdownIt-Anchor" href="#如何处理缺失值"></a> 如何处理缺失值</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200906155419412.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200906155618803.png" alt="" /></p><h1 id="具体步骤"><a class="markdownIt-Anchor" href="#具体步骤"></a> 具体步骤:</h1><blockquote><p>周期要小于一年</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200906161642741.png" alt="" /></p><h1 id="指数回归模型"><a class="markdownIt-Anchor" href="#指数回归模型"></a> 指数回归模型:</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200906170115430.png" alt="" /></p><h1 id="一元时间序列分析模型"><a class="markdownIt-Anchor" href="#一元时间序列分析模型"></a> 一元时间序列分析模型</h1><blockquote><p>为了引出ARIMA模型</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200907091542329.png" alt="" /></p><h1 id="建模过程"><a class="markdownIt-Anchor" href="#建模过程"></a> 建模过程:</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200907224923649.png" alt="" /></p>]]></content>
<categories>
<category> 数学建模 </category>
</categories>
<tags>
<tag> 数学建模 </tag>
</tags>
</entry>
<entry>
<title>【数学建模】聚类模型 - DBSCAN</title>
<link href="/2020/09/06/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91%E8%81%9A%E7%B1%BB%E6%A8%A1%E5%9E%8B-DBSCAN/"/>
<url>/2020/09/06/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91%E8%81%9A%E7%B1%BB%E6%A8%A1%E5%9E%8B-DBSCAN/</url>
<content type="html"><![CDATA[<h1 id="可视化网址"><a class="markdownIt-Anchor" href="#可视化网址"></a> 可视化网址</h1><p><a href="https://www.naftaliharris.com/blog/visualizing">聚类可视化网址</a></p><h1 id="dbscan"><a class="markdownIt-Anchor" href="#dbscan"></a> DBSCAN</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200906140717337.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200906141324719.png" alt="" /></p><h1 id="和其他算法的区别"><a class="markdownIt-Anchor" href="#和其他算法的区别"></a> 和其他算法的区别</h1><blockquote><p>K-means 和 系统算法是基于距离的</p><p>DBSCAN是基于密度的</p></blockquote><h2 id="优点"><a class="markdownIt-Anchor" href="#优点"></a> 优点</h2><ul><li>可以发现任意形状的簇</li><li>可以发现噪点</li></ul><h1 id="总结"><a class="markdownIt-Anchor" href="#总结"></a> 总结:</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200906142303750.png" alt="" /></p><ul><li>如果数据表现的很有形状就用DBSCAN</li><li>其他情况用系统聚类</li><li>K-means 论文上可以写的东西比较稀少</li></ul>]]></content>
<categories>
<category> 数学建模 </category>
</categories>
<tags>
<tag> 数学建模 </tag>
<tag> 聚类模型 </tag>
</tags>
</entry>
<entry>
<title>【数学建模】聚类模型 - K-means & 系统(层次)算法</title>
<link href="/2020/09/06/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91%E8%81%9A%E7%B1%BB%E6%A8%A1%E5%9E%8B-K-means-%E7%B3%BB%E7%BB%9F%EF%BC%88%E5%B1%82%E6%AC%A1%EF%BC%89%E7%AE%97%E6%B3%95/"/>
<url>/2020/09/06/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91%E8%81%9A%E7%B1%BB%E6%A8%A1%E5%9E%8B-K-means-%E7%B3%BB%E7%BB%9F%EF%BC%88%E5%B1%82%E6%AC%A1%EF%BC%89%E7%AE%97%E6%B3%95/</url>
<content type="html"><![CDATA[<h1 id="聚类和分类的区别"><a class="markdownIt-Anchor" href="#聚类和分类的区别"></a> 聚类和分类的区别</h1><p>聚类是不知道类别,自己分类</p><p>分类是已知类别的</p><h1 id="聚类模型"><a class="markdownIt-Anchor" href="#聚类模型"></a> 聚类模型</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200906102956654.png" alt="" /></p><h1 id="k-means聚类"><a class="markdownIt-Anchor" href="#k-means聚类"></a> K-means聚类</h1><blockquote><p>数据对象即样本</p><p>聚类中心即重心</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200906103044052.png" alt="" /></p><p><strong>PS:和我们初始化选择的中心有很大关系</strong></p><h2 id="如何写在论文里"><a class="markdownIt-Anchor" href="#如何写在论文里"></a> 如何写在论文里</h2><blockquote><p>因为算法步骤太长了,而且易被查重</p></blockquote><p>因为算法太长了,放流程图:</p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200906103629642.png" alt="一样的意思,但是更让人喜欢" /></p><h2 id="优缺点"><a class="markdownIt-Anchor" href="#优缺点"></a> 优缺点:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200906103719030.png" alt="" /></p><h1 id="改进-k-means算法"><a class="markdownIt-Anchor" href="#改进-k-means算法"></a> 改进 K-means++算法</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200906103837670.png" alt="" /></p><h2 id="k值这么定量纲不一样怎么办"><a class="markdownIt-Anchor" href="#k值这么定量纲不一样怎么办"></a> K值这么定,量纲不一样怎么办?</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200906105112225.png" alt="" /></p><h1 id="不需要指定k的算法系统层次算法"><a class="markdownIt-Anchor" href="#不需要指定k的算法系统层次算法"></a> 不需要指定K的算法:系统(层次)算法</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200906105928985.png" alt="" /></p><h2 id="样本和样本直接的距离如何计算"><a class="markdownIt-Anchor" href="#样本和样本直接的距离如何计算"></a> 样本和样本直接的距离如何计算</h2><h3 id="样本和样本之间的距离"><a class="markdownIt-Anchor" href="#样本和样本之间的距离"></a> 样本和样本之间的距离</h3><blockquote><p>绝对值距离和欧式距离最常用</p><p>绝对值距离更多的用于网状数据</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200906111013007.png" alt="" /></p><h3 id="指标和指标之间的距离不常用-用于指标分类"><a class="markdownIt-Anchor" href="#指标和指标之间的距离不常用-用于指标分类"></a> 指标和指标之间的距离(不常用、用于指标分类)</h3><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200906111149539.png" alt="指标分类,不常用" /></p><h3 id="类与类之间的距离"><a class="markdownIt-Anchor" href="#类与类之间的距离"></a> 类与类之间的距离</h3><blockquote><p>因为样本和样本被划分为不同的类,就被划分到不同的类了</p><p>组间、组内用的多</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200906111334490.png" alt="" /></p><h2 id="系统聚类的流程图"><a class="markdownIt-Anchor" href="#系统聚类的流程图"></a> 系统聚类的流程图</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200906111652432.png" alt="流程图" /></p><h2 id="需要注意的问题"><a class="markdownIt-Anchor" href="#需要注意的问题"></a> 需要注意的问题:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200906112249195.png" alt="" /></p><h1 id="有没有算法能帮助我们确定k的值肘部法则"><a class="markdownIt-Anchor" href="#有没有算法能帮助我们确定k的值肘部法则"></a> 有没有算法能帮助我们确定k的值:肘部法则</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200906113001015.png" alt="" /></p><h2 id="论文里如何解释"><a class="markdownIt-Anchor" href="#论文里如何解释"></a> 论文里如何解释?</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200906113700284.png" alt="" /></p>]]></content>
<categories>
<category> 数学建模 </category>
</categories>
<tags>
<tag> 数学建模 </tag>
<tag> 聚类模型 </tag>
</tags>
</entry>
<entry>
<title>【数学建模】分类模型</title>
<link href="/2020/09/06/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91%E5%88%86%E7%B1%BB%E6%A8%A1%E5%9E%8B/"/>
<url>/2020/09/06/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91%E5%88%86%E7%B1%BB%E6%A8%A1%E5%9E%8B/</url>
<content type="html"><![CDATA[<h1 id="分类模型"><a class="markdownIt-Anchor" href="#分类模型"></a> 分类模型</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200906083817575.png" alt="" /></p><h1 id="线性概率模型lpm的问题"><a class="markdownIt-Anchor" href="#线性概率模型lpm的问题"></a> 线性概率模型LPM的问题</h1><blockquote><p>内生性问题</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200906084548144.png" alt="" /></p><h2 id="二点分布"><a class="markdownIt-Anchor" href="#二点分布"></a> 二点分布</h2><blockquote><p>求期望</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200906084650581.png" alt="" /></p><h2 id="值域为0~1的函数"><a class="markdownIt-Anchor" href="#值域为0~1的函数"></a> 值域为0~1的函数</h2><blockquote><p>一般用逻辑回归(因为简单</p><p>这里又是概率论的内容了,下面要求极大似然估计</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200906085029497.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200906085040705.png" alt="" /></p><h2 id="预测结果很差怎么办"><a class="markdownIt-Anchor" href="#预测结果很差怎么办"></a> 预测结果很差怎么办?</h2><blockquote><p>因为是预测性回归,不是解释性回归</p><p>因此可以加入平方项、交互项</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200906090548182.png" alt="" /></p><h3 id="问题过拟合"><a class="markdownIt-Anchor" href="#问题过拟合"></a> 问题:过拟合</h3><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200906090713692.png" alt="" /></p><h3 id="优化"><a class="markdownIt-Anchor" href="#优化"></a> 优化</h3><blockquote><p>机器学习</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200906090750047.png" alt="" /></p><h1 id="fisher线性判别分析"><a class="markdownIt-Anchor" href="#fisher线性判别分析"></a> Fisher线性判别分析</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200906091145161.png" alt="" /></p><h2 id="不同超平面选取的差异"><a class="markdownIt-Anchor" href="#不同超平面选取的差异"></a> 不同超平面选取的差异</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200906091442434.png" alt="" /></p><h1 id="多分类问题"><a class="markdownIt-Anchor" href="#多分类问题"></a> 多分类问题:</h1><blockquote><p>多分类从1开始分类,二分类从0开始分类</p><p>以上两个方法均可以处理多分类问题</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200906091925939.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200906092211171.png" alt="" /></p><p><strong>注意过拟合问题</strong></p>]]></content>
<categories>
<category> 数学建模 </category>
</categories>
<tags>
<tag> 数学建模 </tag>
<tag> 分类模型 </tag>
</tags>
</entry>
<entry>
<title>【数学建模】数学规划模型 - 非线性规划 & 最大最小化问题</title>
<link href="/2020/09/05/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91%E6%95%B0%E5%AD%A6%E8%A7%84%E5%88%92%E6%A8%A1%E5%9E%8B-%E9%9D%9E%E7%BA%BF%E6%80%A7%E8%A7%84%E5%88%92-%E6%9C%80%E5%A4%A7%E6%9C%80%E5%B0%8F%E5%8C%96%E9%97%AE%E9%A2%98/"/>
<url>/2020/09/05/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91%E6%95%B0%E5%AD%A6%E8%A7%84%E5%88%92%E6%A8%A1%E5%9E%8B-%E9%9D%9E%E7%BA%BF%E6%80%A7%E8%A7%84%E5%88%92-%E6%9C%80%E5%A4%A7%E6%9C%80%E5%B0%8F%E5%8C%96%E9%97%AE%E9%A2%98/</url>
<content type="html"><![CDATA[<h1 id="非线性规划"><a class="markdownIt-Anchor" href="#非线性规划"></a> 非线性规划</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200905094005840.png" alt="" /></p><h2 id="matlab-求解"><a class="markdownIt-Anchor" href="#matlab-求解"></a> matlab 求解:</h2><blockquote><p>因为非线性规划对初始值很敏感</p><p>使用蒙特卡洛模拟<strong>方法</strong>(不是算法)获得初始值</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200905095323658.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200905095958305.png" alt="" /></p><h2 id="写作技巧"><a class="markdownIt-Anchor" href="#写作技巧"></a> 写作技巧:</h2><p>不同的算法有其名自的优缺点和适用情况,我们可以改变求解的算法来看求解的结量是否变好了。(这可以体现出稳健性,也是你的优点)</p><h1 id="最大最小化问题"><a class="markdownIt-Anchor" href="#最大最小化问题"></a> 最大最小化问题</h1><blockquote><p>不就是二分吗?</p><p>PS:不是二分,因为这个函数可以是非线性函数,二分函数必须得单调</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200905103018607.png" alt="" /></p><h2 id="matlab求解"><a class="markdownIt-Anchor" href="#matlab求解"></a> matlab求解</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200905103645791.png" alt="" /></p>]]></content>
<categories>
<category> 数学建模 </category>
</categories>
<tags>
<tag> 数学建模 </tag>
<tag> 数学规划模型 </tag>
</tags>
</entry>
<entry>
<title>【数学建模】数学规划模型 - 线性规划 & 整数规划</title>
<link href="/2020/09/04/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91%E6%95%B0%E5%AD%A6%E8%A7%84%E5%88%92%E6%A8%A1%E5%9E%8B-%E7%BA%BF%E6%80%A7%E8%A7%84%E5%88%92-%E6%95%B4%E6%95%B0%E8%A7%84%E5%88%92/"/>
<url>/2020/09/04/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91%E6%95%B0%E5%AD%A6%E8%A7%84%E5%88%92%E6%A8%A1%E5%9E%8B-%E7%BA%BF%E6%80%A7%E8%A7%84%E5%88%92-%E6%95%B4%E6%95%B0%E8%A7%84%E5%88%92/</url>
<content type="html"><![CDATA[<h1 id="数学规划模型"><a class="markdownIt-Anchor" href="#数学规划模型"></a> 数学规划模型</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200904205752052.png" alt="" /></p><h1 id="概述"><a class="markdownIt-Anchor" href="#概述"></a> 概述</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200904205910896.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200904210202583.png" alt="" /></p><h1 id="线性规划问题求解matlab"><a class="markdownIt-Anchor" href="#线性规划问题求解matlab"></a> 线性规划问题求解(MATLAB):</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200904210749120.png" alt="" /></p><h2 id="代码"><a class="markdownIt-Anchor" href="#代码"></a> 代码:</h2><blockquote><p>不是所有线性规划都有唯一解</p><p>matlab 会返回其中的一个解</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200904211734852.png" alt="" /></p><h2 id="如果出现-和-怎么办"><a class="markdownIt-Anchor" href="#如果出现-和-怎么办"></a> 如果出现 > 和 < 怎么办</h2><p>放松一下<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>x</mi><mo>≥</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">x \ge 0</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7719400000000001em;vertical-align:-0.13597em;"></span><span class="mord mathdefault">x</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">≥</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:0.64444em;vertical-align:0em;"></span><span class="mord">0</span></span></span></span> 变成 $ x > 0.0001$</p><h1 id="整数规划"><a class="markdownIt-Anchor" href="#整数规划"></a> 整数规划</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200904232156423.png" alt="" /></p>]]></content>
<categories>
<category> 数学建模 </category>
</categories>
<tags>
<tag> 数学建模 </tag>
<tag> 数学规划模型 </tag>
</tags>
</entry>
<entry>
<title>【数学建模】蒙特卡洛模拟</title>
<link href="/2020/08/27/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91%E8%92%99%E7%89%B9%E5%8D%A1%E6%B4%9B%E6%A8%A1%E6%8B%9F/"/>
<url>/2020/08/27/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91%E8%92%99%E7%89%B9%E5%8D%A1%E6%B4%9B%E6%A8%A1%E6%8B%9F/</url>
<content type="html"><![CDATA[<h1 id="我的总结"><a class="markdownIt-Anchor" href="#我的总结"></a> 我的总结:</h1><p>蒙特卡罗模型如果换一个名字就是计算机仿真,(计算机仿真现在的概念要大一点,可以理解为做大型工程的,两者不太一样,但在建模中类似)。</p><p>个人感觉也可以说蒙特卡洛模型是模拟退火、蚁群等算法的原型。</p><p>个人感觉这个经常放在论文的模型验证部分。</p><h1 id="前言"><a class="markdownIt-Anchor" href="#前言"></a> 前言:</h1><p>蒙特卡洛模拟实际上就是计算机仿真,它可以解决超级多的建模问题。</p><p>公众号:数学建模学习交流。</p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200826223620952.png" alt="" /></p><h2 id="引例布峰投针实验"><a class="markdownIt-Anchor" href="#引例布峰投针实验"></a> 引例:布峰投针实验</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200826224011324.png" alt="" /></p><h1 id="蒙特卡洛概述"><a class="markdownIt-Anchor" href="#蒙特卡洛概述"></a> 蒙特卡洛概述:</h1><blockquote><p>蒙特卡洛是一个思想,而不是算法</p><p>建模里就不去别计算机仿真和蒙特卡洛模拟了</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200826230436266.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200826230527426.png" alt="" /></p><ul><li>可以求规划问题</li><li>可能会陷入局部最优</li></ul><h1 id="应用三门问题"><a class="markdownIt-Anchor" href="#应用三门问题"></a> 应用:三门问题</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200826233109665.png" alt="" /></p><h1 id="模拟排队论"><a class="markdownIt-Anchor" href="#模拟排队论"></a> 模拟:排队论</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200826233534076.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200826233710104.png" alt="" /></p>]]></content>
<categories>
<category> 数学建模 </category>
</categories>
<tags>
<tag> 数学建模 </tag>
<tag> 蒙特卡洛模拟 </tag>
</tags>
</entry>
<entry>
<title>【数学建模】多元线性回归模型 - 序</title>
<link href="/2020/08/26/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91%E5%A4%9A%E5%85%83%E7%BA%BF%E6%80%A7%E5%9B%9E%E5%BD%92%E6%A8%A1%E5%9E%8B-%E5%BA%8F/"/>
<url>/2020/08/26/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91%E5%A4%9A%E5%85%83%E7%BA%BF%E6%80%A7%E5%9B%9E%E5%BD%92%E6%A8%A1%E5%9E%8B-%E5%BA%8F/</url>
<content type="html"><![CDATA[<h1 id="回归系数的解释"><a class="markdownIt-Anchor" href="#回归系数的解释"></a> 回归系数的解释:</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200825232427118.png" alt="" /></p><h2 id="什么时候取对数"><a class="markdownIt-Anchor" href="#什么时候取对数"></a> 什么时候取对数:</h2><blockquote><p>这个规定充满主观性,但是是专家给的,就专业了</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200825232536480.png" alt="" /></p><h2 id="四类模型回归系数解释"><a class="markdownIt-Anchor" href="#四类模型回归系数解释"></a> 四类模型回归系数解释:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200825232745075.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200825232908915.png" alt="" /></p><h3 id="特殊变量解释定性变量"><a class="markdownIt-Anchor" href="#特殊变量解释定性变量"></a> 特殊变量解释(定性变量):</h3><blockquote><p>定性变量 转化维 定量变量: 引入虚拟变量</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200825233020196.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200825233157843.png" alt="" /></p><h4 id="多分类虚拟变量"><a class="markdownIt-Anchor" href="#多分类虚拟变量"></a> 多分类虚拟变量:</h4><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200825233419919.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200825233453828.png" alt="" /></p><h3 id="交互项"><a class="markdownIt-Anchor" href="#交互项"></a> 交互项:</h3><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200825233910486.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200825234128728.png" alt="" /></p><h1 id="例子分析幼儿奶粉数据"><a class="markdownIt-Anchor" href="#例子分析幼儿奶粉数据"></a> 例子:分析幼儿奶粉数据:</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200825234148670.png" alt="" /></p><h2 id="数据"><a class="markdownIt-Anchor" href="#数据"></a> 数据:</h2><blockquote><p>只有三个定量指标,其它都是定性指标</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200825234245257.png" alt="" /></p><h2 id="软件"><a class="markdownIt-Anchor" href="#软件"></a> 软件:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200825234535886.png" alt="" /></p><h2 id="技巧"><a class="markdownIt-Anchor" href="#技巧"></a> 技巧:</h2><blockquote><p>比如商品量太多了,就不要做虚拟变量了</p></blockquote><h2 id="拟合度r2很低怎么办"><a class="markdownIt-Anchor" href="#拟合度r2很低怎么办"></a> 拟合度<span class="katex"><span class="katex-mathml"><math><semantics><mrow><msup><mi>R</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">R^2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8141079999999999em;vertical-align:0em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.00773em;">R</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141079999999999em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span></span></span></span>很低怎么办?:</h2><blockquote><p>一般的时候我们更多的是解释性回归,不看重<span class="katex"><span class="katex-mathml"><math><semantics><mrow><msup><mi>R</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">R^2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8141079999999999em;vertical-align:0em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.00773em;">R</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141079999999999em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span></span></span></span>了。预测性的我们用的别的模型(比如拟合来做)</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200826002421785.png" alt="" /></p><h2 id="标准化回归系数"><a class="markdownIt-Anchor" href="#标准化回归系数"></a> 标准化回归系数:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200826002740699.png" alt="" /></p>]]></content>
<categories>
<category> 数学建模 </category>
</categories>
<tags>
<tag> 数学建模 </tag>
<tag> 多元线性回归模型 </tag>
</tags>
</entry>
<entry>
<title>【数学建模】多元线性回归模型 - 一元线性回归</title>
<link href="/2020/08/25/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91%E5%A4%9A%E5%85%83%E7%BA%BF%E6%80%A7%E5%9B%9E%E5%BD%92%E6%A8%A1%E5%9E%8B-%E4%B8%80%E5%85%83%E7%BA%BF%E6%80%A7%E5%9B%9E%E5%BD%92/"/>
<url>/2020/08/25/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91%E5%A4%9A%E5%85%83%E7%BA%BF%E6%80%A7%E5%9B%9E%E5%BD%92%E6%A8%A1%E5%9E%8B-%E4%B8%80%E5%85%83%E7%BA%BF%E6%80%A7%E5%9B%9E%E5%BD%92/</url>
<content type="html"><![CDATA[<h1 id="什么是回归分析"><a class="markdownIt-Anchor" href="#什么是回归分析"></a> 什么是回归分析?</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200824220934892.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200824221013183.png" alt="" /></p><h2 id="相关性-因果性"><a class="markdownIt-Anchor" href="#相关性-因果性"></a> 相关性 ≠ 因果性</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200824221247970.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200824221158760.png" alt="" /></p><h2 id="自变量y"><a class="markdownIt-Anchor" href="#自变量y"></a> 自变量Y:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200824221331403.png" alt="" /></p><h2 id="自变量x"><a class="markdownIt-Anchor" href="#自变量x"></a> 自变量X:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200824221515600.png" alt="" /></p><h2 id="回归分析的用处"><a class="markdownIt-Anchor" href="#回归分析的用处"></a> 回归分析的用处:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200824221805404.png" alt="" /></p><blockquote><p>这里要注意,因为涉及到不同自变量的权重,所以一般要去量纲,不然没意义。</p></blockquote><h2 id="回归分析的分类"><a class="markdownIt-Anchor" href="#回归分析的分类"></a> 回归分析的分类:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200824222103880.png" alt="" /></p><h1 id="多元线性回归"><a class="markdownIt-Anchor" href="#多元线性回归"></a> 多元线性回归:</h1><h2 id="不同数据的处理"><a class="markdownIt-Anchor" href="#不同数据的处理"></a> 不同数据的处理:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200824222636484.png" alt="" /></p><ul><li>横截面数据:多元线性回归</li><li>时间序列数据:最常用的是ARMA</li></ul><h3 id="横截面数据"><a class="markdownIt-Anchor" href="#横截面数据"></a> 横截面数据:</h3><p><img src="figures/%E5%A4%9A%E5%85%83%E7%BA%BF%E6%80%A7%E5%9B%9E%E5%BD%92%E6%A8%A1%E5%9E%8B/image-20200824222649255.png" alt="" /></p><h3 id="时间序列数据"><a class="markdownIt-Anchor" href="#时间序列数据"></a> 时间序列数据:</h3><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200824232125474.png" alt="" /></p><h3 id="面板数据"><a class="markdownIt-Anchor" href="#面板数据"></a> 面板数据:</h3><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200824232207424.png" alt="" /></p><h1 id="数据的收集"><a class="markdownIt-Anchor" href="#数据的收集"></a> 数据的收集:</h1><p><a href="https://link.jiandaoyun.com/f/5cc652cc2cf3b22fb7819189">【简道云汇总】110+数据网站</a></p><p><a href="http://data.chongbuluo.com/">虫部落数据搜索</a></p><p><a href="https://link.jiandaoyun.com/f/5b35d05ff7f6ef2604d39a93">【汇总】数据来源/大数据平台</a></p><p><a href="">大数据工具导航工具</a>(<a href="http://hao.199it.com/">http://hao.199it.com/</a>)</p><p><a href="http://www.hippter.com/data.html">数据平台</a></p><hr /><p>上面的数据多半都是宏观数据,微观数据市面上很少</p><p><a href="https://bbs.pinggu.org/">大家可以在人大经济论坛搜索</a></p><h1 id="一元线性回归"><a class="markdownIt-Anchor" href="#一元线性回归"></a> 一元线性回归:</h1><h2 id="一元线性回归和一元线性函数拟合区别"><a class="markdownIt-Anchor" href="#一元线性回归和一元线性函数拟合区别"></a> 一元线性回归和一元线性函数拟合区别:</h2><blockquote><p>定义不一样,本质是一样的</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200824233403563.png" alt="" /></p><h2 id="对线性的理解"><a class="markdownIt-Anchor" href="#对线性的理解"></a> 对线性的理解:</h2><blockquote><p>线性是对参数说的</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200824233753623.png" alt="" /></p><h2 id="回归系数的解释"><a class="markdownIt-Anchor" href="#回归系数的解释"></a> 回归系数的解释:</h2><blockquote><p>求系数很简单</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200824234327393.png" alt="" /></p><ul><li>这里的<span class="katex"><span class="katex-mathml"><math><semantics><mrow><msub><mi>y</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">y_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.19444em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.03588em;">y</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.31166399999999994em;"><span style="top:-2.5500000000000003em;margin-left:-0.03588em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathdefault mtight">i</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>的<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>i</mi></mrow><annotation encoding="application/x-tex">i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.65952em;vertical-align:0em;"></span><span class="mord mathdefault">i</span></span></span></span>是对每个个体而言,也可以去掉,转换成对总体而言</li></ul><h3 id="内生性"><a class="markdownIt-Anchor" href="#内生性"></a> 内生性:</h3><blockquote><p>无偏性和一致性</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200824234753326.png" alt="" /></p><h4 id="u_i是什么"><a class="markdownIt-Anchor" href="#u_i是什么"></a> <span class="katex"><span class="katex-mathml"><math><semantics><mrow><msub><mi>u</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">u_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.58056em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathdefault">u</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.31166399999999994em;"><span style="top:-2.5500000000000003em;margin-left:0em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathdefault mtight">i</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>是什么?</h4><p><img src="figures/%E5%A4%9A%E5%85%83%E7%BA%BF%E6%80%A7%E5%9B%9E%E5%BD%92%E6%A8%A1%E5%9E%8B/image-20200824235144988.png" alt="" /></p><h2 id="蒙特卡洛验证是否有内生性"><a class="markdownIt-Anchor" href="#蒙特卡洛验证是否有内生性"></a> 蒙特卡洛验证是否有内生性:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200824235429966.png" alt="" /></p><h3 id="matlab"><a class="markdownIt-Anchor" href="#matlab"></a> matlab:</h3><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200825000304873.png" alt="" /></p><h2 id="降低内生性要求"><a class="markdownIt-Anchor" href="#降低内生性要求"></a> 降低内生性要求:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200825000558498.png" alt="" /></p>]]></content>
<categories>
<category> 数学建模 </category>
</categories>
<tags>
<tag> 数学建模 </tag>
<tag> 多元线性回归模型 </tag>
</tags>
</entry>
<entry>
<title>【数学建模】相关性分析 - 皮尔逊相关系数 & 斯皮尔曼相关系数</title>
<link href="/2020/08/24/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91%E7%9B%B8%E5%85%B3%E6%80%A7%E5%88%86%E6%9E%90-%E7%9A%AE%E5%B0%94%E9%80%8A%E7%9B%B8%E5%85%B3%E7%B3%BB%E6%95%B0-%E6%96%AF%E7%9A%AE%E5%B0%94%E6%9B%BC%E7%9B%B8%E5%85%B3%E7%B3%BB%E6%95%B0/"/>
<url>/2020/08/24/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91%E7%9B%B8%E5%85%B3%E6%80%A7%E5%88%86%E6%9E%90-%E7%9A%AE%E5%B0%94%E9%80%8A%E7%9B%B8%E5%85%B3%E7%B3%BB%E6%95%B0-%E6%96%AF%E7%9A%AE%E5%B0%94%E6%9B%BC%E7%9B%B8%E5%85%B3%E7%B3%BB%E6%95%B0/</url>
<content type="html"><![CDATA[<h1 id="前言"><a class="markdownIt-Anchor" href="#前言"></a> 前言:</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200823231157301.png" alt="" /></p><h1 id="皮尔逊person相关系-要求数据满足正态分布"><a class="markdownIt-Anchor" href="#皮尔逊person相关系-要求数据满足正态分布"></a> 皮尔逊Person相关系 (要求数据满足正态分布</h1><h2 id="总体和样本"><a class="markdownIt-Anchor" href="#总体和样本"></a> 总体和样本</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200823231257297.png" alt="" /></p><h2 id="总体皮尔逊person相关系数"><a class="markdownIt-Anchor" href="#总体皮尔逊person相关系数"></a> 总体皮尔逊Person相关系数</h2><blockquote><p>一般说的相关系数就是皮尔逊相关系数</p><p>就是概率论的知识</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200823231359070.png" alt="" /></p><p>消除量纲影响:</p><h3 id="总体"><a class="markdownIt-Anchor" href="#总体"></a> 总体:</h3><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200823231514139.png" alt="" /></p><h3 id="样本"><a class="markdownIt-Anchor" href="#样本"></a> 样本:</h3><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200823231841379.png" alt="" /></p><h2 id="意义"><a class="markdownIt-Anchor" href="#意义"></a> 意义:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200823231931125.png" alt="" /></p><h2 id="误区"><a class="markdownIt-Anchor" href="#误区"></a> 误区:</h2><blockquote><p>用于衡量线性</p><p><strong>两个变量必须线性相关。</strong></p><p>不是线性相关函数,不一样</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200823232246241.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200823232028972.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200823232203860.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200823232424387.png" alt="" /></p><h2 id="总结"><a class="markdownIt-Anchor" href="#总结"></a> 总结:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200823232540515.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200823232647798.png" alt="很多教材以0.7相关" /></p><h1 id="例题"><a class="markdownIt-Anchor" href="#例题"></a> 例题:</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200823232800453.png" alt="" /></p><blockquote><p>MATLAB EXCEL SPSS都能做</p></blockquote><h2 id="matlab"><a class="markdownIt-Anchor" href="#matlab"></a> MATLAB</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200823233537865.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200823233303792.png" alt="一个很好的习惯" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200823234041854.png" alt="" /></p><h2 id="spss"><a class="markdownIt-Anchor" href="#spss"></a> SPSS</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200823233848566.png" alt="" /></p><blockquote><p>C(n,2) 的散点图可以用spss计算</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200823234339264.png" alt="" /></p><h1 id="假设检验"><a class="markdownIt-Anchor" href="#假设检验"></a> 假设检验:</h1><blockquote><p>概率论内容,考过的</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200823235346159.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200824000231388.png" alt="" /></p><h1 id="对皮尔逊相关系数进行假设检验"><a class="markdownIt-Anchor" href="#对皮尔逊相关系数进行假设检验"></a> 对皮尔逊相关系数进行假设检验</h1><h2 id="条件"><a class="markdownIt-Anchor" href="#条件"></a> 条件:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200824002028537.png" alt="" /></p><h2 id="第一步第二步"><a class="markdownIt-Anchor" href="#第一步第二步"></a> 第一步,第二步:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200824000329110.png" alt="" /></p><h2 id="第三步"><a class="markdownIt-Anchor" href="#第三步"></a> 第三步:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200824000506002.png" alt="" /></p><h2 id="第四步"><a class="markdownIt-Anchor" href="#第四步"></a> 第四步:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200824000620295.png" alt="" /></p><h2 id="第五步"><a class="markdownIt-Anchor" href="#第五步"></a> 第五步:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200824000742044.png" alt="" /></p><h2 id="更好用的方法p值判断法"><a class="markdownIt-Anchor" href="#更好用的方法p值判断法"></a> 更好用的方法:P值判断法</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200824000823479.png" alt="" /></p><h2 id="matlab-2"><a class="markdownIt-Anchor" href="#matlab-2"></a> matlab:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200824001115009.png" alt="" /></p><h2 id="spss-2"><a class="markdownIt-Anchor" href="#spss-2"></a> spss</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200824001828642.png" alt="image-20200824001828642" /></p><h1 id="如何检验数据是不是正态分布"><a class="markdownIt-Anchor" href="#如何检验数据是不是正态分布"></a> 如何检验数据是不是正态分布:</h1><h2 id="正态分布jb检验样本n30"><a class="markdownIt-Anchor" href="#正态分布jb检验样本n30"></a> 正态分布JB检验(样本n>30)</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200824002213034.png" alt="" /></p><h3 id="matlab-3"><a class="markdownIt-Anchor" href="#matlab-3"></a> matlab:</h3><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200824002642802.png" alt="" /></p><h2 id="shapiro-wikl检验"><a class="markdownIt-Anchor" href="#shapiro-wikl检验"></a> Shapiro-wikl检验:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200824003312812.png" alt="" /></p><h2 id="q-q图数据量非常大不推荐用"><a class="markdownIt-Anchor" href="#q-q图数据量非常大不推荐用"></a> Q-Q图(数据量非常大,不推荐用:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200824003542231.png" alt="" /></p><h1 id="斯皮尔曼spearman相关系数不要求正态分布"><a class="markdownIt-Anchor" href="#斯皮尔曼spearman相关系数不要求正态分布"></a> 斯皮尔曼spearman相关系数(不要求正态分布</h1><blockquote><p>不要求是正态分布</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/112d8172e1d44c3e0a271e01fe1943b1.svg" alt="img" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200824004004862.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200824004216828.png" alt="" /></p><h2 id="第二种定义matlab用的"><a class="markdownIt-Anchor" href="#第二种定义matlab用的"></a> 第二种定义(matlab用的</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/3077d509a28f0c638e01a3be025aa653.svg" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200824004318249.png" alt="" /></p><h2 id="matlab-4"><a class="markdownIt-Anchor" href="#matlab-4"></a> MATLAB</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200824004610707.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200824005232578.png" alt="" /></p><h1 id="斯皮尔曼显著检验"><a class="markdownIt-Anchor" href="#斯皮尔曼显著检验"></a> 斯皮尔曼显著检验:</h1><h2 id="小样本"><a class="markdownIt-Anchor" href="#小样本"></a> 小样本</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200824004912349.png" alt="" /></p><h2 id="大样本"><a class="markdownIt-Anchor" href="#大样本"></a> 大样本:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200824005040748.png" alt="image-20200824005040748" /></p><h1 id="总结-2"><a class="markdownIt-Anchor" href="#总结-2"></a> 总结:</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200824005520813.png" alt="" /></p>]]></content>
<categories>
<category> 数学建模 </category>
</categories>
<tags>
<tag> 数学建模 </tag>
<tag> 相关性分析 </tag>
</tags>
</entry>
<entry>
<title>【计算机组成原理】微命令 微操作 微指令 微程序</title>
<link href="/2020/08/23/%E3%80%90%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%BB%84%E6%88%90%E5%8E%9F%E7%90%86%E3%80%91%E5%BE%AE%E5%91%BD%E4%BB%A4-%E5%BE%AE%E6%93%8D%E4%BD%9C-%E5%BE%AE%E6%8C%87%E4%BB%A4-%E5%BE%AE%E7%A8%8B%E5%BA%8F/"/>
<url>/2020/08/23/%E3%80%90%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%BB%84%E6%88%90%E5%8E%9F%E7%90%86%E3%80%91%E5%BE%AE%E5%91%BD%E4%BB%A4-%E5%BE%AE%E6%93%8D%E4%BD%9C-%E5%BE%AE%E6%8C%87%E4%BB%A4-%E5%BE%AE%E7%A8%8B%E5%BA%8F/</url>
<content type="html"><![CDATA[<h1 id="前言"><a class="markdownIt-Anchor" href="#前言"></a> 前言</h1><p>复习机组的时候发现<font color=red>微命令</font>、<font color=#34a853>微指令</font>、<font color=#fbbc05>微操作</font>、<font color=#4285f4>微程序</font>、甚至控制信号这几个概念容易搞混。现在整理如下。</p><h1 id="总结"><a class="markdownIt-Anchor" href="#总结"></a> 总结</h1><blockquote><p><font color=red> 微命令</font> -><font color=#34a853> 微指令</font> -> <font color=#4285f4>微程序</font> A -> B表示由A组成B</p></blockquote><p>控制部件通过控制线向执行部件发出各种控制命令,通常这种控制命令叫做<font color=red>微命令</font>,是最小单位,组成<font color=#34a853>微指令</font> 。<br />在机器的一个CPU周期中,一组实现一定操作功能的<font color=red>微命令</font>的组合,构成一条<font color=#34a853>微指令</font><br />事实上一条机器指令的功能是由许多条<font color=#34a853>微指令</font>组成的序列来实现的。这个<font color=#34a853>微指令</font>序列通常叫做<font color=#4285f4>微程序</font>。</p><ul><li><font color=#fbbc05>微操作</font>:指令执行时必须完成的基本操作。例如,PC→AR,PC+1→ PC,RAM→IR。</li></ul><h1 id="自己的理解"><a class="markdownIt-Anchor" href="#自己的理解"></a> 自己的理解</h1><p>一条机器指令是由多个<font color=#34a853>微指令</font>组成的。这多个<font color=#34a853>微指令</font>序列又称作<font color=#4285f4>微程序</font>。</p><p>一条微指令是由多个<font color=red> 微命令</font>组成的。<font color=red> 微命令</font>又称作控制信号,<font color=red> 微命令</font>序列即控制信号序列。</p><hr /><h2 id="微操作和微指令的区别询问张瑞华老师得知"><a class="markdownIt-Anchor" href="#微操作和微指令的区别询问张瑞华老师得知"></a> 微操作和微指令的区别(询问张瑞华老师得知):</h2><ul><li><p>一个<font color=#fbbc05>微操作</font>对应一条<font color=#34a853>微指令</font>,一条<font color=#34a853>微指令</font>可能有多个<font color=red>微命令</font>。</p></li><li><p><font color=#fbbc05>微操作</font>是动作,<font color=#34a853>微指令</font>是个编码。</p></li><li><p><font color=#fbbc05>微操作</font>是<font color=red>微命令</font>作用在硬件上的一个动作。课本上的<font color=#fbbc05>微操作</font>是在写指令流程时一条即一个箭头,这粒度比较粗。</p></li></ul><h1 id="参考"><a class="markdownIt-Anchor" href="#参考"></a> 参考</h1><p><a href="https://www.cnblogs.com/psymacome/p/8004756.html">微命令、微操作、微指令、微程序</a><br /><a href="https://zhidao.baidu.com/question/430749690.html">微程序 微命令 微指令概念区别</a></p>]]></content>
<categories>
<category> 计算机组成原理 </category>
</categories>
<tags>
<tag> 计算机组成原理 </tag>
</tags>
</entry>
<entry>
<title>【数学建模】拟合算法</title>
<link href="/2020/08/23/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91%E6%8B%9F%E5%90%88%E7%AE%97%E6%B3%95/"/>
<url>/2020/08/23/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91%E6%8B%9F%E5%90%88%E7%AE%97%E6%B3%95/</url>
<content type="html"><![CDATA[<h1 id="前言"><a class="markdownIt-Anchor" href="#前言"></a> 前言:</h1><p><img src="figures/%E6%8B%9F%E5%90%88%E7%AE%97%E6%B3%95/image-20200822232315265.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200822232605096.png" alt="" /></p><h2 id="拟合和插值的区别"><a class="markdownIt-Anchor" href="#拟合和插值的区别"></a> 拟合和插值的区别</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200822232330488.png" alt="" /></p><ul><li>插值要经过所有点</li><li>拟合不需要,只要这个曲线接近过所有点即可,只要保证误差足够小就可以。</li></ul><h2 id="最小二乘老生常谈了"><a class="markdownIt-Anchor" href="#最小二乘老生常谈了"></a> 最小二乘(老生常谈了</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200822234917506.png" alt="" /></p><blockquote><p><span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>a</mi><mi>r</mi><mi>g</mi></mrow><annotation encoding="application/x-tex">arg</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.19444em;"></span><span class="mord mathdefault">a</span><span class="mord mathdefault" style="margin-right:0.02778em;">r</span><span class="mord mathdefault" style="margin-right:0.03588em;">g</span></span></span></span>的意思是使我们函数最小的参数</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200822235203575.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200822235412968.png" alt="Matlab求解最小二乘" /></p><h2 id="如何评价拟合的好坏"><a class="markdownIt-Anchor" href="#如何评价拟合的好坏"></a> 如何评价拟合的好坏</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200823001031412.png" alt="" /></p><ul><li>选取多个函数求<span class="katex"><span class="katex-mathml"><math><semantics><mrow><msup><mi>R</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">R^2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8141079999999999em;vertical-align:0em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.00773em;">R</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141079999999999em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span></span></span></span></li><li>做一个取舍,不是次方越高越好,目的是让函数简单。</li><li><strong>并不是所有的函数都有<span class="katex"><span class="katex-mathml"><math><semantics><mrow><msup><mi>R</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">R^2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8141079999999999em;vertical-align:0em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.00773em;">R</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141079999999999em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span></span></span></span></strong>,不是线性函数一般不能用。</li></ul><h3 id="什么是线性函数我们指的是对参数为线性而不是对变量为线性"><a class="markdownIt-Anchor" href="#什么是线性函数我们指的是对参数为线性而不是对变量为线性"></a> 什么是线性函数?(我们指的是对参数为线性,而不是对变量为线性)</h3><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200823001106906.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200823001242735.png" alt="" /></p><h3 id="计算r2的代码"><a class="markdownIt-Anchor" href="#计算r2的代码"></a> 计算<span class="katex"><span class="katex-mathml"><math><semantics><mrow><msup><mi>R</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">R^2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8141079999999999em;vertical-align:0em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.00773em;">R</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141079999999999em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span></span></span></span>的代码</h3><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200823001517809.png" alt="" /></p><h1 id="matlab-工具箱"><a class="markdownIt-Anchor" href="#matlab-工具箱"></a> matlab 工具箱</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200823001809078.png" alt="" /></p><p><img src="figures/%E6%8B%9F%E5%90%88%E7%AE%97%E6%B3%95/image-20200823002020869.png" alt="" /></p><blockquote><p>点估计和区间估计</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200823002553166.png" alt="" /></p><h2 id="中心化"><a class="markdownIt-Anchor" href="#中心化"></a> 中心化</h2><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200823002524265.png" style="zoom:33%;" /><h1 id="例题"><a class="markdownIt-Anchor" href="#例题"></a> 例题:</h1><blockquote><p><span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>x</mi><mo>=</mo><mi>f</mi><mo stretchy="false">(</mo><mi>t</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">x=f(t)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.43056em;vertical-align:0em;"></span><span class="mord mathdefault">x</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathdefault" style="margin-right:0.10764em;">f</span><span class="mopen">(</span><span class="mord mathdefault">t</span><span class="mclose">)</span></span></span></span></p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200823002917315.png" alt="" /></p><p>这里<span class="katex"><span class="katex-mathml"><math><semantics><mrow><msup><mi>R</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">R^2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8141079999999999em;vertical-align:0em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.00773em;">R</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8141079999999999em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span></span></span></span>没有意义(不是线性函数</p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200823003727472.png" alt="" /></p><h2 id="论文使用"><a class="markdownIt-Anchor" href="#论文使用"></a> 论文使用:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200823004836146.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200823004916611.png" alt="" /></p>]]></content>
<categories>
<category> 数学建模 </category>
</categories>
<tags>
<tag> 数学建模 </tag>
</tags>
</entry>
<entry>
<title>【数学建模】插值算法</title>
<link href="/2020/08/22/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91%E6%8F%92%E5%80%BC%E7%AE%97%E6%B3%95/"/>
<url>/2020/08/22/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91%E6%8F%92%E5%80%BC%E7%AE%97%E6%B3%95/</url>
<content type="html"><![CDATA[<h1 id="前言"><a class="markdownIt-Anchor" href="#前言"></a> 前言</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200822224142580.png" alt="" /></p><h2 id="一维插值问题"><a class="markdownIt-Anchor" href="#一维插值问题"></a> 一维插值问题</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200822224245521.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200822224333723.png" alt="" /></p><blockquote><p>最常见的就是分段插值</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200822224447942.png" alt="原理" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200822224501850.png" alt="" /></p><blockquote><p>一般给n+1个点用n阶多项式</p></blockquote><h2 id="拉格朗日插值法"><a class="markdownIt-Anchor" href="#拉格朗日插值法"></a> 拉格朗日插值法:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200822224902577.png" alt="拉格朗日乘法" /></p><h3 id="缺陷龙格现象"><a class="markdownIt-Anchor" href="#缺陷龙格现象"></a> 缺陷:龙格现象</h3><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200822225037684.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200822225135878.png" alt="" /></p><blockquote><p>因此用分段插值</p></blockquote><h2 id="分段插值"><a class="markdownIt-Anchor" href="#分段插值"></a> 分段插值</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200822225228954.png" alt="分段插值" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200822225319316.png" alt="分段二次插值\分段跑误插值" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200822225444170.png" alt="牛顿插值法,不是牛顿提出的" /></p><h2 id="拉格朗日插值-牛顿插值"><a class="markdownIt-Anchor" href="#拉格朗日插值-牛顿插值"></a> 拉格朗日插值、牛顿插值</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200822225554372.png" alt="与拉格朗日插值法相比,有继承性" /></p><blockquote><p>牛顿插值和拉格朗日插值法都有龙格现象</p></blockquote><h2 id="埃尔米特插值法重要"><a class="markdownIt-Anchor" href="#埃尔米特插值法重要"></a> 埃尔米特插值法(重要)</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200822225704274.png" alt="埃尔米特特插值" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200822225725177.png" alt="" /></p><h1 id="最常用分段三次埃尔米特插值和三次样条插值"><a class="markdownIt-Anchor" href="#最常用分段三次埃尔米特插值和三次样条插值"></a> 最常用:分段三次埃尔米特插值和三次样条插值</h1><h2 id="分段三次埃尔米特插值"><a class="markdownIt-Anchor" href="#分段三次埃尔米特插值"></a> 分段三次埃尔米特插值</h2><blockquote><p>matlab 种 pchip 有现成函数</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200822225942589.png" alt="" /></p><h2 id="三次样条插值"><a class="markdownIt-Anchor" href="#三次样条插值"></a> 三次样条插值:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200822230735222.png" alt="" /></p><blockquote><p>条件很苛刻</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200822230801664.png" alt="matlab方法" /></p><h2 id="对比"><a class="markdownIt-Anchor" href="#对比"></a> 对比:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200822231152794.png" alt="" /></p><h2 id="n维数据插值"><a class="markdownIt-Anchor" href="#n维数据插值"></a> n维数据插值:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200822231325373.png" alt="" /></p><h2 id="小技巧可以预测"><a class="markdownIt-Anchor" href="#小技巧可以预测"></a> 小技巧:可以预测</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200822231538496.png" alt="" /></p><h1 id="实例"><a class="markdownIt-Anchor" href="#实例"></a> 实例:</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200822231858847.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200822231931921.png" alt="" /></p>]]></content>
<categories>
<category> 数学建模 </category>
</categories>
<tags>
<tag> 数学建模 </tag>
</tags>
</entry>
<entry>
<title>【数学建模】模糊综合评价模型</title>
<link href="/2020/08/22/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91%E6%A8%A1%E7%B3%8A%E7%BB%BC%E5%90%88%E8%AF%84%E4%BB%B7%E6%A8%A1%E5%9E%8B/"/>
<url>/2020/08/22/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91%E6%A8%A1%E7%B3%8A%E7%BB%BC%E5%90%88%E8%AF%84%E4%BB%B7%E6%A8%A1%E5%9E%8B/</url>
<content type="html"><![CDATA[<h1 id="模糊综合评价模型"><a class="markdownIt-Anchor" href="#模糊综合评价模型"></a> 模糊综合评价模型</h1><p><strong>综合:多个指标,有多个权重</strong></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200821212648015.png" alt="" /></p><h1 id="概述引子"><a class="markdownIt-Anchor" href="#概述引子"></a> 概述(引子</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200821212841494.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200821213032085.png" alt="量就是各种数字" /></p><p>PS:量就是数字</p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200821213134182.png" alt="" /></p><h1 id="模糊集合"><a class="markdownIt-Anchor" href="#模糊集合"></a> 模糊集合</h1><h2 id="经典集合"><a class="markdownIt-Anchor" href="#经典集合"></a> 经典集合:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200821213454247.png" alt="" /></p><p>特征函数?</p><h2 id="模糊集合-2"><a class="markdownIt-Anchor" href="#模糊集合-2"></a> 模糊集合:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200821214009814.png" alt="" /></p><ul><li>用<strong>隶属度</strong>来描述元素在不在集合里。</li><li><strong>隶属函数</strong>充满随意性😁,没有约定俗成的方法,只要合理就可以了。</li></ul><blockquote><p>模糊集合的三种表示法(不重要</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200821214709945.png" alt="" /></p><ul><li>Zadeh 这里只是一种计发,数学意义不强。这样放便积分</li><li>第二种计法不方便表示无穷的集合</li></ul><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200821215102453.png" alt="" /></p><ul><li>论域$\mho $可以是无限个元素</li></ul><h1 id="隶属函数的三种确定方法"><a class="markdownIt-Anchor" href="#隶属函数的三种确定方法"></a> 隶属函数的三种确定方法</h1><blockquote><p>虽然隶属函数充满随意性,但还是有三种方法的</p></blockquote><h2 id="模糊统计法数模中用的很少"><a class="markdownIt-Anchor" href="#模糊统计法数模中用的很少"></a> 模糊统计法(数模中用的很少</h2><p>因为需要统计,所以数模不咋用。但是发论文就会用到了</p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200821215823457.png" alt="因为需要统计,所以数模不咋用。但是发论文就会用到了" /></p><h2 id="借助已有的客观尺度"><a class="markdownIt-Anchor" href="#借助已有的客观尺度"></a> 借助已有的客观尺度</h2><blockquote><p>找到合适的指标</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200821220043524.png" alt="" /></p><h2 id="指派法主观性强但建模中80都用这个"><a class="markdownIt-Anchor" href="#指派法主观性强但建模中80都用这个"></a> 指派法(主观性强,但建模中80%都用这个)</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200821220303239.png" alt="image-20200821220303239" /></p><ul><li>用的比较多的是梯形分布</li></ul><h3 id="用的比较多的梯形分布"><a class="markdownIt-Anchor" href="#用的比较多的梯形分布"></a> 用的比较多的梯形分布</h3><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200821220638211.png" alt="梯形分布例题" style="zoom:80%;" /><ul><li>求出一个值在每一个等级的隶属度</li></ul><h1 id="应用评价问题的概述"><a class="markdownIt-Anchor" href="#应用评价问题的概述"></a> 应用:评价问题的概述</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200821232831047.png" alt="" /></p><ul><li>应用部分,符号发生了点变化,以这个为主。</li><li>因素集的<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.43056em;vertical-align:0em;"></span><span class="mord mathdefault">n</span></span></span></span>和评语集的<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>m</mi></mrow><annotation encoding="application/x-tex">m</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.43056em;vertical-align:0em;"></span><span class="mord mathdefault">m</span></span></span></span>没有关系。</li></ul><h1 id="应用1一级综合模糊评价模型一个员工进行考核隶属度采用模糊统计法"><a class="markdownIt-Anchor" href="#应用1一级综合模糊评价模型一个员工进行考核隶属度采用模糊统计法"></a> 应用1:一级综合模糊评价模型:一个员工进行考核(隶属度采用:模糊统计法)</h1><blockquote><p>注意这个例子是对一个员工进行考核</p><p>一个员工有<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.43056em;vertical-align:0em;"></span><span class="mord mathdefault">n</span></span></span></span>个指标【业务能力,政治能力】</p><p>一个员工有<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>m</mi></mrow><annotation encoding="application/x-tex">m</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.43056em;vertical-align:0em;"></span><span class="mord mathdefault">m</span></span></span></span>种可能的评语【优秀,良好】</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200821233421488.png" alt="" /></p><h2 id="步骤一确定因素集n5相关性不强"><a class="markdownIt-Anchor" href="#步骤一确定因素集n5相关性不强"></a> 步骤一:确定因素集(n<=5,相关性不强)</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200821233548764.png" alt="" /></p><h2 id="步骤二确定评语集"><a class="markdownIt-Anchor" href="#步骤二确定评语集"></a> 步骤二:确定评语集</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200821233600547.png" alt="" /></p><h2 id="步骤三确定权重"><a class="markdownIt-Anchor" href="#步骤三确定权重"></a> 步骤三:确定权重</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200821233620425.png" alt="" /></p><h3 id="司守奎教授怎么做"><a class="markdownIt-Anchor" href="#司守奎教授怎么做"></a> 司守奎教授怎么做</h3><ul><li>Delphi法:不断反馈,专家赋权</li></ul><hr /><h3 id="我们怎么做"><a class="markdownIt-Anchor" href="#我们怎么做"></a> 我们怎么做:</h3><ul><li>无数据:层次分析法</li><li>有数据:熵权法</li></ul><h2 id="步骤四确定模糊判断矩阵"><a class="markdownIt-Anchor" href="#步骤四确定模糊判断矩阵"></a> 步骤四:确定模糊判断矩阵</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200821233834594.png" alt="" /></p><p>例如:</p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200821233901046.png" style="zoom: 67%;" /><h2 id="步骤五综合评判"><a class="markdownIt-Anchor" href="#步骤五综合评判"></a> 步骤五:综合评判</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200821234208591.png" alt="" /></p><p>矩阵<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>B</mi></mrow><annotation encoding="application/x-tex">B</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.68333em;vertical-align:0em;"></span><span class="mord mathdefault" style="margin-right:0.05017em;">B</span></span></span></span>相当于要评价的<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>m</mi></mrow><annotation encoding="application/x-tex">m</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.43056em;vertical-align:0em;"></span><span class="mord mathdefault">m</span></span></span></span>个评语(对象),对于各个<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.43056em;vertical-align:0em;"></span><span class="mord mathdefault">n</span></span></span></span>个因素(指标的)权重的隶属度。</p><h2 id="例子"><a class="markdownIt-Anchor" href="#例子"></a> 例子</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200821234936426.png" alt="" /></p><blockquote><p>确定权重不要忘记一致性检验</p></blockquote><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200821235504476.png" style="zoom:80%;" /><h1 id="应用2一级综合模糊评价模型-单日空气质量评测隶属度采用指派法"><a class="markdownIt-Anchor" href="#应用2一级综合模糊评价模型-单日空气质量评测隶属度采用指派法"></a> 应用2:一级综合模糊评价模型 :单日空气质量评测(隶属度采用:指派法)</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200821235927773.png" alt="" /></p><h2 id="计算"><a class="markdownIt-Anchor" href="#计算"></a> 计算:</h2><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200822000320842.png" style="zoom:80%;" /><blockquote><p>这里注意,四个评语的隶属度的和不一定为1</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200822000416619.png" alt="" /></p><h1 id="应用3一级综合模糊评价模型-露天矿采有约束a指标权重矩阵可以用熵权法"><a class="markdownIt-Anchor" href="#应用3一级综合模糊评价模型-露天矿采有约束a指标权重矩阵可以用熵权法"></a> 应用3:一级综合模糊评价模型 :露天矿采(有约束|A指标权重矩阵可以用熵权法)</h1><h2 id="确定隶属函数"><a class="markdownIt-Anchor" href="#确定隶属函数"></a> 确定隶属函数</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200822000628259.png" alt="" /></p><p>偏大型:越大越好</p><p>偏小型:越小越好(也得转化成偏大型,有点类似正向化</p><blockquote><p>写作技巧:</p><p>根据专家的建议</p><p>根据他人写的文章</p></blockquote><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200822001327420.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200822001406210.png" alt="" /></p><blockquote><p>这里B和R加权不为1很正常</p></blockquote><h1 id="应用4二级综合模糊评价模型-学生奖学金评价"><a class="markdownIt-Anchor" href="#应用4二级综合模糊评价模型-学生奖学金评价"></a> 应用4:二级综合模糊评价模型 :学生奖学金评价</h1><p>指标太多,相关性很强。(10个指标,没分类。采用层次分析法就得两两比较)</p><h2 id="二级综合评价模型例子"><a class="markdownIt-Anchor" href="#二级综合评价模型例子"></a> 二级综合评价模型例子:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200822002209890.png" alt="" /></p><h2 id="步骤"><a class="markdownIt-Anchor" href="#步骤"></a> 步骤</h2><h3 id="第一步划分因素集"><a class="markdownIt-Anchor" href="#第一步划分因素集"></a> 第一步:划分因素集</h3><p>主观性强,看相关性</p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200822002401836.png" alt="" /></p><h3 id="第二步确定评语集"><a class="markdownIt-Anchor" href="#第二步确定评语集"></a> 第二步:确定评语集</h3><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200822002441488.png" alt="" /></p><p>把二级当一级来操作</p><h3 id="第三步再对一级尽速进行综合评判得出结果"><a class="markdownIt-Anchor" href="#第三步再对一级尽速进行综合评判得出结果"></a> 第三步:再对一级尽速进行综合评判得出结果</h3><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200822002654377.png" alt="" /></p><h2 id="应用4三级综合模糊评价模型-陶瓷评判"><a class="markdownIt-Anchor" href="#应用4三级综合模糊评价模型-陶瓷评判"></a> 应用4:三级综合模糊评价模型 :陶瓷评判</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200822003456700.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200822003820226.png" alt="PS:指标必须进行正向话(指标越大越好)" /></p><blockquote><p>PS:指标必须进行正向话(指标越大越好)</p></blockquote><h1 id="总结"><a class="markdownIt-Anchor" href="#总结"></a> 总结:</h1><p>如果没有数据,评价数太多,尽量必要使用模糊综合评价模型(时间不够)</p>]]></content>
<categories>
<category> 数学建模 </category>
</categories>
<tags>
<tag> 数学建模 </tag>
</tags>
</entry>
<entry>
<title>【数学建模】灰色关联分析</title>
<link href="/2020/08/20/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91%E7%81%B0%E8%89%B2%E5%85%B3%E8%81%94%E5%88%86%E6%9E%90/"/>
<url>/2020/08/20/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91%E7%81%B0%E8%89%B2%E5%85%B3%E8%81%94%E5%88%86%E6%9E%90/</url>
<content type="html"><![CDATA[<h1 id="概述"><a class="markdownIt-Anchor" href="#概述"></a> 概述</h1><p>进行系统分析和综合评价。</p><p>根据图形相似程度进行分析。(灰色系统是国内的人提出的,回归分析是国外人推荐的。)</p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200820220922615.png" alt="概述" /></p><h1 id="步骤"><a class="markdownIt-Anchor" href="#步骤"></a> 步骤</h1><h2 id="步骤一画统计图-进行一些简单的分析"><a class="markdownIt-Anchor" href="#步骤一画统计图-进行一些简单的分析"></a> 步骤一:画统计图、进行一些简单的分析</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200820221737569.png" alt="" /></p><p>用回归分析的多重共线性问题?</p><h2 id="步骤二确定分析序列"><a class="markdownIt-Anchor" href="#步骤二确定分析序列"></a> 步骤二:确定分析序列</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200820221851322.png" alt="" /></p><h2 id="步骤三对数据进行预处理去量纲-简化计算"><a class="markdownIt-Anchor" href="#步骤三对数据进行预处理去量纲-简化计算"></a> 步骤三:对数据进行预处理(去量纲、简化计算)</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200820221935947.png" alt="为什么这样做(解释不清,大家都这么用)" /></p><h2 id="步骤四计算子序列和母序列的关联系数"><a class="markdownIt-Anchor" href="#步骤四计算子序列和母序列的关联系数"></a> 步骤四:计算子序列和母序列的关联系数</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200820222525637.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200820222637406.png" alt="" /></p><p>注意分辨系数<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>ρ</mi></mrow><annotation encoding="application/x-tex">\rho</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.19444em;"></span><span class="mord mathdefault">ρ</span></span></span></span></p><h2 id="步骤五计算灰色关联度"><a class="markdownIt-Anchor" href="#步骤五计算灰色关联度"></a> 步骤五:计算灰色关联度</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200820223239840.png" alt="" /></p><h2 id="步骤六看谁关联度最大"><a class="markdownIt-Anchor" href="#步骤六看谁关联度最大"></a> 步骤六:看谁关联度最大</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200820223310561.png" alt="" /></p><h1 id="讨论"><a class="markdownIt-Anchor" href="#讨论"></a> 讨论:</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200820223801106.png" alt="" /></p><h1 id="灰色关联分析用于综合评价"><a class="markdownIt-Anchor" href="#灰色关联分析用于综合评价"></a> 灰色关联分析用于综合评价</h1><ul><li><p>AHP用于没有数据</p></li><li><p>TOPSIS用于有数据</p></li><li><p>灰色关联分析用于有数据</p></li></ul><hr /><p>TOPSIS 确定熵权:</p><ul><li>层次分析法(AHP</li><li>熵权法</li><li><s>灰色关联度(忽略掉,极少用)</s></li></ul><h2 id="步骤-2"><a class="markdownIt-Anchor" href="#步骤-2"></a> 步骤:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200820224423285.png" alt="步骤" /></p><p>步骤二的预处理是灰色关联分析的预处理</p><h3 id="matlab的技巧"><a class="markdownIt-Anchor" href="#matlab的技巧"></a> matlab的技巧</h3><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200820225207492.png" alt="用于求每列最大值" /></p><h1 id="归一化和标准化的区别"><a class="markdownIt-Anchor" href="#归一化和标准化的区别"></a> 归一化和标准化的区别</h1><p>归一化:方便度量、方便分析</p><p>标准化:去掉量纲</p>]]></content>
<categories>
<category> 数学建模 </category>
</categories>
<tags>
<tag> 数学建模 </tag>
</tags>
</entry>
<entry>
<title>【数学建模】熵权法</title>
<link href="/2020/08/20/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91%E7%86%B5%E6%9D%83%E6%B3%95/"/>
<url>/2020/08/20/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91%E7%86%B5%E6%9D%83%E6%B3%95/</url>
<content type="html"><![CDATA[<h1 id="熵权法"><a class="markdownIt-Anchor" href="#熵权法"></a> 熵权法</h1><h1 id="问题的提出层次分析法主观性太强"><a class="markdownIt-Anchor" href="#问题的提出层次分析法主观性太强"></a> 问题的提出:层次分析法主观性太强</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200820212240743.png" alt="" /></p><p>变异程度是方差(变化不大</p><h2 id="如何衡量信息量的大小为什么是方差"><a class="markdownIt-Anchor" href="#如何衡量信息量的大小为什么是方差"></a> 如何衡量信息量的大小(为什么是方差?</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200820212448869.png" alt="image-20200820212448869" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200820212932888.png" alt="" /></p><h3 id="信息熵"><a class="markdownIt-Anchor" href="#信息熵"></a> 信息熵:</h3><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200820213257527.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200820213438001.png" alt="" /></p><h1 id="熵权法的步骤"><a class="markdownIt-Anchor" href="#熵权法的步骤"></a> 熵权法的步骤</h1><h2 id="第一步判断矩阵中是否有负数"><a class="markdownIt-Anchor" href="#第一步判断矩阵中是否有负数"></a> 第一步:判断矩阵中是否有负数</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200820213636433.png" alt="" /></p><h2 id="第二部计算概率感觉有点问题但大家都这样"><a class="markdownIt-Anchor" href="#第二部计算概率感觉有点问题但大家都这样"></a> 第二部:计算概率(感觉有点问题,但大家都这样</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200820213712434.png" alt="感觉这样做有待商榷,但都这样用" /></p><h3 id="第三步计算信息熵并归一化得到熵权"><a class="markdownIt-Anchor" href="#第三步计算信息熵并归一化得到熵权"></a> 第三步:计算信息熵,并归一化得到熵权</h3><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200820213922636.png" alt="" /></p><h2 id="背后原理"><a class="markdownIt-Anchor" href="#背后原理"></a> 背后原理</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200820214025623.png" alt="" /></p><h1 id="熵权法和层次分析法"><a class="markdownIt-Anchor" href="#熵权法和层次分析法"></a> 熵权法和层次分析法</h1><h2 id="熵权法-2"><a class="markdownIt-Anchor" href="#熵权法-2"></a> 熵权法:</h2><p>不一定太科学,值得商榷。</p><h2 id="层次分析法"><a class="markdownIt-Anchor" href="#层次分析法"></a> 层次分析法:</h2><p>专家赋权,太主观。</p><h2 id="总结"><a class="markdownIt-Anchor" href="#总结"></a> 总结:</h2><p>我觉得比赛可以俩都用,毕竟熵权法可以直接调用。</p><p>解决综合评价的 层次分析法和TOPSIS<br />熵权法可以用来给TOPSIS赋权</p>]]></content>
<categories>
<category> 数学建模 </category>
</categories>
<tags>
<tag> 数学建模 </tag>
</tags>
</entry>
<entry>
<title>【数学建模】TOPSIS|优劣解距离法</title>
<link href="/2020/08/19/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91TOPSIS-%E4%BC%98%E5%8A%A3%E8%A7%A3%E8%B7%9D%E7%A6%BB%E6%B3%95/"/>
<url>/2020/08/19/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91TOPSIS-%E4%BC%98%E5%8A%A3%E8%A7%A3%E8%B7%9D%E7%A6%BB%E6%B3%95/</url>
<content type="html"><![CDATA[<h1 id="topsis"><a class="markdownIt-Anchor" href="#topsis"></a> TOPSIS</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200819214718017.png" alt="前言" /></p><h2 id="层次分析法的局限"><a class="markdownIt-Anchor" href="#层次分析法的局限"></a> 层次分析法的局限:</h2><ul><li>决策层不能太多</li><li>如果又数据已知,不能利用这些数据</li></ul><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200819214852267.png" alt="层次分析法局限性" /></p><h1 id="问题的提出"><a class="markdownIt-Anchor" href="#问题的提出"></a> 问题的提出:</h1><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200819215436539.png" alt="提出问题" /></p><h2 id="为什么要这样算"><a class="markdownIt-Anchor" href="#为什么要这样算"></a> 为什么要这样算:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200819215559782.png" alt="归一化" /></p><p>为什么制表 要 max min</p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200819215623623.png" alt="为什么要这样归一化" /></p><h2 id="极大型效益型指标和极小型成本型指标"><a class="markdownIt-Anchor" href="#极大型效益型指标和极小型成本型指标"></a> 极大型(效益型)指标和极小型(成本型)指标:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200819215855541.png" alt="" /></p><h3 id="统一指标类型"><a class="markdownIt-Anchor" href="#统一指标类型"></a> 统一指标类型</h3><p><strong>指标正向化</strong>(最常用)(PS:当然可以反过来</p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200819220105950.png" alt="" /></p><h3 id="标准化消去量纲"><a class="markdownIt-Anchor" href="#标准化消去量纲"></a> 标准化(消去量纲):</h3><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200819220413290.png" alt="标准化(消去量纲)" /></p><h2 id="如何计算"><a class="markdownIt-Anchor" href="#如何计算"></a> 如何计算:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200819220607697.png" alt="" /></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200819220719914.png" alt="" /></p><p>看似麻烦,其实很简单。就是每取出每一列的最大值和最小值形成单独的向量<span class="katex"><span class="katex-mathml"><math><semantics><mrow><msup><mi>Z</mi><mo>+</mo></msup></mrow><annotation encoding="application/x-tex">Z^+</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.771331em;vertical-align:0em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.07153em;">Z</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.771331em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mbin mtight">+</span></span></span></span></span></span></span></span></span></span></span> 和<span class="katex"><span class="katex-mathml"><math><semantics><mrow><msup><mi>Z</mi><mo>−</mo></msup></mrow><annotation encoding="application/x-tex">Z^-</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.771331em;vertical-align:0em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.07153em;">Z</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.771331em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mbin mtight">−</span></span></span></span></span></span></span></span></span></span></span>然后每一行去用欧式距离算量<span class="katex"><span class="katex-mathml"><math><semantics><mrow><msubsup><mi>D</mi><mi>i</mi><mo>+</mo></msubsup></mrow><annotation encoding="application/x-tex">D_i^+</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.088326em;vertical-align:-0.276864em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.02778em;">D</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.811462em;"><span style="top:-2.4231360000000004em;margin-left:-0.02778em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathdefault mtight">i</span></span></span><span style="top:-3.1031310000000003em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mbin mtight">+</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.276864em;"><span></span></span></span></span></span></span></span></span></span> 和<span class="katex"><span class="katex-mathml"><math><semantics><mrow><msubsup><mi>D</mi><mi>i</mi><mo>−</mo></msubsup></mrow><annotation encoding="application/x-tex">D_i^-</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.088326em;vertical-align:-0.276864em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.02778em;">D</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.811462em;"><span style="top:-2.4231360000000004em;margin-left:-0.02778em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathdefault mtight">i</span></span></span><span style="top:-3.1031310000000003em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mbin mtight">−</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.276864em;"><span></span></span></span></span></span></span></span></span></span></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200819221322949.png" alt="" /></p><h2 id="因此topsis被称为优劣解距离法"><a class="markdownIt-Anchor" href="#因此topsis被称为优劣解距离法"></a> 因此TOPSIS被称为优劣解距离法:</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200819221413159.png" alt="TOPSIS介绍" /></p><h1 id="深入topsis"><a class="markdownIt-Anchor" href="#深入topsis"></a> 深入:TOPSIS</h1><h2 id="第一步原始矩阵正向话"><a class="markdownIt-Anchor" href="#第一步原始矩阵正向话"></a> 第一步:原始矩阵正向话</h2><h3 id="常见的四种指标"><a class="markdownIt-Anchor" href="#常见的四种指标"></a> 常见的四种指标</h3><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200819221521514.png" alt="" /></p><h3 id="极小型到极大型"><a class="markdownIt-Anchor" href="#极小型到极大型"></a> 极小型到极大型</h3><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200819221623113.png" alt="" /></p><h3 id="中间型到极大型"><a class="markdownIt-Anchor" href="#中间型到极大型"></a> 中间型到极大型</h3><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200819221657855.png" alt="" /></p><h3 id="区间型到最大型"><a class="markdownIt-Anchor" href="#区间型到最大型"></a> 区间型到最大型</h3><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200819221910539.png" alt="" /></p><h2 id="第二步正向化标准矩阵消除量纲影响"><a class="markdownIt-Anchor" href="#第二步正向化标准矩阵消除量纲影响"></a> 第二步:正向化标准矩阵(消除量纲影响</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200819222148109.png" alt="" /></p><h2 id="第三步计算得分并归一化"><a class="markdownIt-Anchor" href="#第三步计算得分并归一化"></a> 第三步:计算得分并归一化</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200819222219776.png" alt="" /></p><h3 id="为什么要归一化"><a class="markdownIt-Anchor" href="#为什么要归一化"></a> 为什么要归一化?</h3><ul><li>在基于梯度下降的算法中,使用特征归一化方法将特征统一量纲,能够提高模型收敛速度和最终的模型精度。</li><li>归一化目的就是将不同尺度上的评判结果统一到一个尺度上,从而可以作比较,作计算</li><li>矢量是归一化比较常见的使用场景。因为一般矢量只关心方向,距离,长度没有意义。因此归一化就是将x,y,z3个值放入0-1.0的范围内。</li></ul><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200819222926875.png" alt="" /></p><h1 id="模型扩展上面是默认所有指标权重相同"><a class="markdownIt-Anchor" href="#模型扩展上面是默认所有指标权重相同"></a> 模型扩展(上面是默认所有指标权重相同):</h1><h2 id="带权重的topsis用层次分析法赋予指标权重"><a class="markdownIt-Anchor" href="#带权重的topsis用层次分析法赋予指标权重"></a> 带权重的TOPSIS(用层次分析法赋予指标权重</h2><p>因为各个指标有不同权重,只需用层次分析法求出<span class="katex"><span class="katex-mathml"><math><semantics><mrow><msub><mi>w</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">w_i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.58056em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.02691em;">w</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.31166399999999994em;"><span style="top:-2.5500000000000003em;margin-left:-0.02691em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathdefault mtight">i</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span>稍作修改模型即可:</p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200819223523864.png" alt="" /></p>]]></content>
<categories>
<category> 数学建模 </category>
</categories>
<tags>
<tag> 数学建模 </tag>
</tags>
</entry>
<entry>
<title>【数学建模】排队论&层次分析法(AHP</title>
<link href="/2020/08/19/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91%E6%8E%92%E9%98%9F%E8%AE%BA-%E5%B1%82%E6%AC%A1%E5%88%86%E6%9E%90/"/>
<url>/2020/08/19/%E3%80%90%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E3%80%91%E6%8E%92%E9%98%9F%E8%AE%BA-%E5%B1%82%E6%AC%A1%E5%88%86%E6%9E%90/</url>
<content type="html"><![CDATA[<h1 id="排队论"><a class="markdownIt-Anchor" href="#排队论"></a> 排队论</h1><p>这篇博客写的太好了,我就偷懒一点:</p><p><a href="https://blog.csdn.net/sunyueqinghit/article/details/81562138">数学建模之排队论</a></p><p>排队论的一般模型:</p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/20180810130528383.jpg" alt="img" /></p><p>这里要注意,分析清除排队论种的排队顾客具体是谁。19年国赛C的顾客就是<strong>汽车司机</strong>,不是乘客。</p><h2 id="排队系统的组成和特征"><a class="markdownIt-Anchor" href="#排队系统的组成和特征"></a> 排队系统的组成和特征</h2><p>一般的排队过程都由输入过程、排队规则、服务过程三部分组成</p><h3 id="排队规则"><a class="markdownIt-Anchor" href="#排队规则"></a> 排队规则</h3><p>排队规则指到达排队系统的顾客按怎样的规则排队等待,可分为损失制,等待制和 混合制三种.</p><ol><li>损失制(消失制)。当顾客到达时,所有的服务台均被占用,顾客随即离去。</li><li>等待制。当顾客到达时,所有的服务台均被占用,顾客就排队等待,直到接 受完服务才离去。例如出故障的机器排队等待维修就是这种情况。</li></ol><p>排队方式还分为单列、多列和循环队列。</p><h3 id="服务过程"><a class="markdownIt-Anchor" href="#服务过程"></a> 服务过程</h3><ul><li><p>先到先服务 FCFS</p></li><li><p>后到先服务 LCFS (很少见)</p></li></ul><h3 id="排队模型的符号表示直接复制了"><a class="markdownIt-Anchor" href="#排队模型的符号表示直接复制了"></a> 排队模型的符号表示(直接复制了</h3><p>排队模型用六个符号表示,在符号之间用斜线隔开,即 X/Y/Z/A/B/C 。第一 个符号 X 表示顾客到达流或顾客到达间隔时间的分布;第二个符号Y 表示服务时间的 分布;第三个符号Z 表示服务台数目;第四个符号 A是系统容量限制;第五个符号B 是 顾客源数目;第六个符号C 是服务规则,如先到先服务 FCFS,后到先服务 LCFS 等。并 约定,如略去后三项,即指X/Y/Z/∞/∞/FCFS的情形。我们只讨论先到先服务 FCFS 的情形,所以略去第六项。<br />表示顾客到达间隔时间和服务时间的分布的约定符号为:<br />M —指数分布(M 是 Markov 的字头,因为指数分布具有无记忆性,即 Markov 性);<br />D—确定型(Deterministic);<br />Ek —k 阶爱尔朗(Erlang)分布;<br />G —一般(general)服务时间的分布;<br />GI —一般相互独立(General Independent)的时间间隔的分布。<br />例如,M/M/1表示相继到达间隔时间为指数分布、服务时间为指数分布、单服务台、等待制系统。<br />D/M/c/表示确定的到达时间、服务时间为指数分布、c个平行服务台(但顾客是一队)的模型。</p><h2 id="求解方法"><a class="markdownIt-Anchor" href="#求解方法"></a> 求解方法:</h2><h3 id="简单时公式推导"><a class="markdownIt-Anchor" href="#简单时公式推导"></a> 简单时,公式推导:</h3><h3 id="多服务台模型-mms也是19年c会用到的模型"><a class="markdownIt-Anchor" href="#多服务台模型-mms也是19年c会用到的模型"></a> 多服务台模型( M/M/s/∞)(也是19年C会用到的模型</h3><p>设顾客单个到达,相继到达时间间隔服从参数为<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>λ</mi></mrow><annotation encoding="application/x-tex">λ</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.69444em;vertical-align:0em;"></span><span class="mord mathdefault">λ</span></span></span></span> 的负指数分布,系统中共有s个 服务台,每个服务台的服务时间相互独立,且服从参数为<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>μ</mi></mrow><annotation encoding="application/x-tex">μ</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.625em;vertical-align:-0.19444em;"></span><span class="mord mathdefault">μ</span></span></span></span> 的负指数分布。当顾客到达时,若有空闲的服务台则马上接受服务,否则便排成一个队列等待,等待时间为无限。</p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/20180810133729317.jpg" alt="img" /></p><h3 id="复杂时计算机模拟"><a class="markdownIt-Anchor" href="#复杂时计算机模拟"></a> 复杂时,计算机模拟:</h3><p>我把代码放在了Dropbox里</p><h1 id="层次分析法ahp"><a class="markdownIt-Anchor" href="#层次分析法ahp"></a> 层次分析法(AHP</h1><p>这个清风老师的视频真的讲的太好了。感觉亏了一个亿</p><h2 id="解决评价类问题要想到的问题"><a class="markdownIt-Anchor" href="#解决评价类问题要想到的问题"></a> 解决评价类问题要想到的问题</h2><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200818235841311.png" alt="image-20200818235841311" /></p><p>评价类问题的核心就是要有这张权重表格:</p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200819000036572.png" alt="image-20200819000036572" /></p><p>在没有数据的情况下,可以采用层次分析法,来衡量这些参数:</p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200818220913536.png" alt="image-20200818220913536" /></p><h2 id="指标如何得出"><a class="markdownIt-Anchor" href="#指标如何得出"></a> 指标如何得出?</h2><p>核心求出<strong>判断矩阵</strong></p><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200818221216938.png" alt="" /></p><h3 id="权重计算方法的干活"><a class="markdownIt-Anchor" href="#权重计算方法的干活"></a> 权重计算方法的干活:</h3><p><img src="https://blog-img-lei.oss-cn-beijing.aliyuncs.com/img/image-20200819000241019.png" alt="image-20200819000241019" /></p><h2 id="ps"><a class="markdownIt-Anchor" href="#ps"></a> PS</h2><p>之前雅莉姐姐在 Week share 种介绍了用SPSS求解主成分分析,基本就是一键呆瓜式操作,明天试一试</p>]]></content>
<categories>
<category> 数学建模 </category>
</categories>
<tags>