<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <id>https://LinyongGAN.github.io</id>
    <title>Linyong GAN</title>
    <updated>2025-01-12T10:05:38.870Z</updated>
    <generator>https://github.com/jpmonette/feed</generator>
    <link rel="alternate" href="https://LinyongGAN.github.io"/>
    <link rel="self" href="https://LinyongGAN.github.io/atom.xml"/>
    <subtitle>年轻人，好好学习，不要心浮气躁的。——plk</subtitle>
    <logo>https://LinyongGAN.github.io/images/avatar.png</logo>
    <icon>https://LinyongGAN.github.io/favicon.ico</icon>
    <rights>All rights reserved 2025, Linyong GAN</rights>
    <entry>
        <title type="html"><![CDATA[The Impact of Opening the Chinese Mainland University Campus to the Public on Students and Policies Respectively]]></title>
        <id>https://LinyongGAN.github.io/post/the-impact-of-opening-the-chinese-mainland-university-campus-to-the-public-on-students-and-policies-respectively/</id>
        <link href="https://LinyongGAN.github.io/post/the-impact-of-opening-the-chinese-mainland-university-campus-to-the-public-on-students-and-policies-respectively/">
        </link>
        <updated>2024-12-28T07:12:01.000Z</updated>
        <content type="html"><![CDATA[<h2 id="abstract">Abstract</h2>
<p>While previous studies have contributed to the university campus layout outside of China, the current study investigated the impact of opening the Chinese mainland university campus to the public on students and the willingness and purposes of the public to visit the campuses in China to infer why Chinese people prefer to do that. By handing out a questionnaire, the results show that no evident impact could be found, which may be because of the complementarity. Moreover, the top visiting purposes are landscape viewing and experiencing the university atmosphere. Nevertheless, the opening could bring about several concerns. In response to that, some suggestions are provided in the paper.<br>
<strong>Keywords</strong>: open university campus, China mainland, willingness &amp; purposes, concerns, suggestions.</p>
<h2 id="introduction">Introduction</h2>
<p>University campuses are regarded as public common resources with massive value in academic, commercial, and landscape viewing. Gumprecht (2007) enumerated university campuses’ 3 functions as a landscape park, a social and cultural center, and a symbol. All these functions play a crucial role in public. However, it may disrupt students’ living. Ali and Kim (2020) reported that most students at Cairo University believed that an open campus negatively impacted their lives.<br>
Previous studies investigated building planning on campuses without gates, which is inconsistent with China's conditions. They focused on the relationship between universities and cities. Also, they focused on citizens' perspectives and concentrated predominantly on what the university could bring to citizens. However, the opinions of students, staff, and property management personnel are also important.<br>
This research aims to determine whether and how to construct an open university. By understanding the views of different personnel, this study handed out a questionnaire to collect data and analyze why the public wants to visit the campuses and what the consequences will be. Based on the findings, suggestions for the campus opening policies were provided.</p>
<h2 id="literature-review">Literature Review</h2>
<p>Rashidi (2013) emphasized the significance of the relationship between the University campus and the city. He stated that the socio-cultural functions of public open spaces consist of the value of, needs in, and rights in public space and that the university campus was a public space in the city. Moreover, many researchers are focusing on building planning. According to Lin (2014), while Venini designed the UBC campus as a pedestrian campus, the campus designer of SFU’s Burnaby campus tried to figure out the potential of shared space.<br>
However, according to Ali and Kim (2020), the survey suggested that most residents outside and students believe that the campus should not be open to the public due to the limited budget, high population density, and anti-terrorism reasons, even though the disagreement rate among residents is lower than that of students. Technically speaking, one-third of the students and a quarter of residents did not agree with opening, especially for special regions such as Zaafaran Palace (Administration Region), Green Spaces, or the action of taking down fences.<br>
Also, the researchers noticed that the universities prefer establishing membership-fee-paying spaces, which might help fight against misbehavior and bring revenue to the universities. Many universities in Hong Kong S.A.R. implement a membership system for gyms. According to the official website of Hong Kong University (HKU, 2024), every student, staff, and alum can take at most four people using sports facilities for HK$30 per visit/hour. Similarly, The Chinese University of Hong Kong (CUHK, 2024) also has a fee regulation for sports facilities.<br>
Previous studies discussed building layouts or countermeasures and investigated people’s opinions outside China. To bridge these research gaps, this research manages to figure out the actual impact of the policies on students and seeks a better solution to this problem for Chinese universities.</p>
<h2 id="research-questions">Research questions</h2>
<p>The research questions that guide the study are:</p>
<ol>
<li>What is the public’s willingness to visit the campus and the purposes for doing so?</li>
<li>What is the impact of campus opening on students?</li>
<li>How can we construct an open campus by making better policies?</li>
<li>How can we construct an open campus by designing a better streamline?</li>
</ol>
<h2 id="methods">Methods</h2>
<h3 id="participants">Participants</h3>
<p>Three hundred twenty-four informants returned the questionnaire, with 26.85% (87) of university-related staff and students and 73.15% (237) of others. 24.38% (79) are aged 18-22, and 41.98% (136) are aged 41-50. Some university-related personnel (10.8%) have experience working or studying abroad. Moreover, for the residual part, most (61.11%) of them have at least one child who derived or is pursuing a college degree or above.</p>
<h3 id="data-collection-and-procedure">Data Collection and Procedure</h3>
<p>First, our questionnaire was based on the &quot;Survey on Opening University Campus.&quot; For the public, besides their basic information, e.g., ages and educational background, the questions are concentrated on their visiting observations, attitude and reason for visiting, and favorable open-up policies. Moreover, for university-related populations, some extra questions related to the conditions of their universities were asked. Multiple choice questions were presented for conditions and observations, with a few situations provided. Scoring questions were presented for policies, scaling from totally disagreeable to totally agreeable.<br>
Apart from the questionnaire, the researcher counted the number of specific populations during particular periods at targeted spots, such as weekdays and weekends, at 12:00 and 17:00 on the shuffle buses and dining halls. Also, two semi-structured interviews with designers were conducted to explore the layout patterns of campuses.</p>
<h3 id="data-analysis">Data analysis</h3>
<p>Many statistical tools, such as Python and SPSS, were used to analyze the qualitative data. Some basic statistical methods, such as Pearson's Chi-Square Test, were used to test the correlation between variables. The dimension-reducing algorithm UMAP was used. The author transcribed the interview data and accordingly suggested the campus layout.</p>
<h2 id="results">Results</h2>
<h3 id="1the-current-conditions-under-different-campuses">1.	The current conditions under different campuses</h3>
<p>Eighty-seven university-related informants filled in the questionnaire in total. 45.98% (40) indicate that visitors can only visit at a specific time or place. 17.24% (15) indicate that visitors can visit any spot on their campus anytime without any appointment. Figure 1 demonstrates that students did not witness apparent congestion under current open policies.<br>
<img src="https://LinyongGAN.github.io/post-images/1735370176833.png" alt="" loading="lazy"></p>
<p><strong>Fig. 1. The opening policies disturb students' lives regarding traffic and the dining hall.</strong></p>
<h3 id="2attitude-towards-opening-up">2.	Attitude towards opening-up</h3>
<h4 id="avisiting-willingness-and-purposes">a)	Visiting willingness and purposes</h4>
<p><strong>Table 1. Visiting willingness from different age groups</strong></p>
<table>
<thead>
<tr>
<th style="text-align:center"></th>
<th style="text-align:center">12-18</th>
<th style="text-align:center">18-22</th>
<th style="text-align:center">22-25</th>
<th style="text-align:center">26-31</th>
<th style="text-align:center">32-40</th>
<th style="text-align:center">41-50</th>
<th style="text-align:center">50-60</th>
<th style="text-align:center">60~</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">Approval rate</td>
<td style="text-align:center">100.00</td>
<td style="text-align:center">89.87</td>
<td style="text-align:center">100.00</td>
<td style="text-align:center">100.00</td>
<td style="text-align:center">95.23</td>
<td style="text-align:center">97.06</td>
<td style="text-align:center">92.73</td>
<td style="text-align:center">80.00</td>
</tr>
<tr>
<td style="text-align:center">numApprove</td>
<td style="text-align:center">11</td>
<td style="text-align:center">71</td>
<td style="text-align:center">14</td>
<td style="text-align:center">3</td>
<td style="text-align:center">20</td>
<td style="text-align:center">132</td>
<td style="text-align:center">51</td>
<td style="text-align:center">4</td>
</tr>
<tr>
<td style="text-align:center">Total number</td>
<td style="text-align:center">11</td>
<td style="text-align:center">79</td>
<td style="text-align:center">14</td>
<td style="text-align:center">3</td>
<td style="text-align:center">21</td>
<td style="text-align:center">136</td>
<td style="text-align:center">55</td>
<td style="text-align:center">5</td>
</tr>
</tbody>
</table>
<p><strong>Table 2. Approval of opening of different age groups</strong></p>
<table>
<thead>
<tr>
<th style="text-align:center"></th>
<th style="text-align:center">12-18</th>
<th style="text-align:center">18-22</th>
<th style="text-align:center">22-25</th>
<th style="text-align:center">26-31</th>
<th style="text-align:center">32-40</th>
<th style="text-align:center">41-50</th>
<th style="text-align:center">50-60</th>
<th style="text-align:center">60~</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">Approval rate</td>
<td style="text-align:center">90.09</td>
<td style="text-align:center">81.01</td>
<td style="text-align:center">78.57</td>
<td style="text-align:center">100.00</td>
<td style="text-align:center">76.19</td>
<td style="text-align:center">84.56</td>
<td style="text-align:center">85.45</td>
<td style="text-align:center">60.00</td>
</tr>
<tr>
<td style="text-align:center"># Approve</td>
<td style="text-align:center">10</td>
<td style="text-align:center">64</td>
<td style="text-align:center">11</td>
<td style="text-align:center">3</td>
<td style="text-align:center">16</td>
<td style="text-align:center">115</td>
<td style="text-align:center">47</td>
<td style="text-align:center">3</td>
</tr>
<tr>
<td style="text-align:center">Total number</td>
<td style="text-align:center">11</td>
<td style="text-align:center">79</td>
<td style="text-align:center">14</td>
<td style="text-align:center">3</td>
<td style="text-align:center">21</td>
<td style="text-align:center">136</td>
<td style="text-align:center">55</td>
<td style="text-align:center">5</td>
</tr>
</tbody>
</table>
<p>According to the questionnaire, the relative opinions are shown in Tables 1 and 2, which show that most people support opening the campus. However, there is a minor difference in views among different age groups. People between 18 and 22 are relatively unwilling to visit other universities, while 22-25 and 32-40 age groups relatively disagree with opening the campuses. The reasons probably come from multiple aspects. The 12-18-year-old age group is going to university soon and is curious about the university. The 41 and above age groups experienced opening campus policy times. Moreover, the researcher observed slight differences between the two tables, which might have been caused by misbehavior or other reasons.</p>
<p><strong>Table 3. Correlation between attitude and study life experiences.</strong></p>
<table>
<thead>
<tr>
<th style="text-align:center">Correlation</th>
<th style="text-align:center">Living Aboard</th>
<th style="text-align:center">University-related</th>
<th style="text-align:center">Highest Qualification</th>
<th style="text-align:center">Children's Educational Background</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">Willingness</td>
<td style="text-align:center">-0.14*</td>
<td style="text-align:center">-0.01</td>
<td style="text-align:center">0.03</td>
<td style="text-align:center">-0.02</td>
</tr>
<tr>
<td style="text-align:center">Opinion to open</td>
<td style="text-align:center">-0.06</td>
<td style="text-align:center">-0.02</td>
<td style="text-align:center">0.08</td>
<td style="text-align:center">-0.08</td>
</tr>
</tbody>
</table>
<p>*p &lt; 0.05 **p &lt; 0.01</p>
<p>Similarly, using SPSS, we evaluated the correlation between the informants’ background or witnesses and their opinions by the Pearson Chi-Square Test. The results are shown in Table 3, which indicates no apparent correlation between the factors mentioned.</p>
<figure data-type="image" tabindex="1"><img src="https://LinyongGAN.github.io/post-images/1735370817050.png" alt="" loading="lazy"></figure>
<p><strong>Fig. 2. Purposes of visiting the campus</strong></p>
<p>Figure 2 shows that the most common (79.32%) purpose of visiting the campus is to feel the learning atmosphere, and the second most important (78.7%) is to visit the campus landscape. An interesting observation is that 17.9% (58) of people believe that taxpayer supervision is their purpose for visiting. Among that, 50% (29) are above 41 years old, which might also result from a specific time background.</p>
<h4 id="bdisadvantages-of-open-campus">b)	Disadvantages of open campus</h4>
<p><img src="https://LinyongGAN.github.io/post-images/1735370889565.png" alt="" loading="lazy"><br>
<strong>Fig. 3. Perspectives towards disadvantages of open campus</strong></p>
<p>According to Figure 3, most (79.74%) people believe that opening campuses disturbs students’ study and life, although the rate from the public was lower than the university-related population. Misbehavior (e.g., littering, spitting, etc.) is the second critical negative effect, with approval rates of 85.05% from the related population and 73.41% from the public. According to the questionnaire, 62.06% of students and 49.62% of the public witnessed misbehavior on campus.</p>
<h3 id="3policies-making">3.	policies making</h3>
<p><img src="https://LinyongGAN.github.io/post-images/1735370964779.png" alt="" loading="lazy"><br>
<strong>Fig. 4. Expected venues to open from the public</strong></p>
<p><img src="https://LinyongGAN.github.io/post-images/1735370970088.png" alt="" loading="lazy"><br>
<strong>Fig. 5. Perspective towards different statements</strong></p>
<p>With statements:</p>
<ol>
<li>No reservation is required, or the reservation policy is relaxed.</li>
<li>Visitors can only enter the campus on weekends or holidays.</li>
<li>Visitors can take lectures or borrow books from the library if they want.</li>
<li>Visitors can enter the university gym, such as a swimming pool, tennis court, etc.</li>
<li>Visitors should not drive cars onto the campus.</li>
<li>Visitors cannot take the campus shuffle bus or pay for that.</li>
<li>Visitors cannot use the dining hall, or at least one is for students and staff only.</li>
</ol>
<p>Figure 4 showcases that outdoor spaces, stores, sports venues, and dining halls are the most appealing spots. The library, study room, and lecture halls are also highly wanted. From Figure 5, we observed that most statements got scores in a nearly uniform distribution. However, more than half (68.82%) of informants agree that visitors can only visit on weekends or holidays, while 3 quarters of informants agree that vehicles are not allowed on the campus. That is probably because of safety reasons and to minimize the impact on students as much as possible.</p>
<p>To investigate the differences between personnel on policies, the researchers leveraged the UMAP tool (Li et al., 2024) with a random seed of 42, n_neighbors of 5, min_dist of 0.05, n_epoches of 2000, taking matric as Manhattan distance and applying standardization. With 1 and 2 representing university-related and unrelated groups, Figure 6 indicates no significant difference between groups can be seen.</p>
<p><img src="https://LinyongGAN.github.io/post-images/1735371103734.png" alt="" loading="lazy"><br>
<strong>Fig. 6. Different clusters between personnel</strong></p>
<h3 id="4interview-design-the-streamline-to-release-the-pressure-of-the-path">4.	interview: Design the streamline to release the pressure of the path</h3>
<p>One of the ways to reduce campus congestion is to design a better streamline. According to the interviews, the campuses always have a central avenue with essential buildings on both sides, such as dining rooms and conference buildings, which can satisfy most of the general visit purposes. Moreover, some lanes are designed to let students access different venues easily without using the central avenue and release the avenue stress.</p>
<h2 id="discussion">Discussion</h2>
<p>This study has addressed different personnel's perspectives on why and how to open the campus. While previous studies revealed that students and visitors disagreed with opening the campus in Arabic (Ali, Kim, 2020), the present study found that most Chinese students and the public (83.02%) approve that the campus should always be open to the public.</p>
<p>Firstly, opening Chinese campuses does not significantly affect students. One of the reasons could be complementarity. The researchers counted the number of people in dining halls and campus shuffling buses during regular weekdays and weekends in CUHKSZ. Then, we observed the complementarity of students and public groups. Namely, during holidays, although lots of the public are crammed into the campus, students would prefer to return home or stay on the upper campus, where visitors cannot enter. Due to the policies, the public cannot enter the campus during weekdays. This is consistent with the questionnaire feedback.</p>
<p>By testing the correlation, we can also conclude that no apparent correlation could be found between the approval rate of open-up and age, educational background, and abroad experience. Most Chinese wish to visit different university campuses, and the top purpose of visiting is to experience the university atmosphere. One of the reasons is that the percentage of junior college and above is still relatively low. The university is still a shining flame in many Chinese hearts. According to the Office of the Leading Group for the Seventh National Population Census of the State Council (2020), until 2020, 154.67 million Chinese people got Junior College and Above degrees, compared with a total population of more than 1400 million.</p>
<p>In terms of policies, universities should make good use of the reservation system because of its complementarity. Moreover, for safety reasons, private vehicles should be strictly restricted. The university could establish a blocklist system to cope with misbehavior, rejecting people who misbehave to enter the campus again.</p>
<p>Researchers discovered that many universities, such as Zhejiang University and Hangzhou Dianzi Technical University, followed the rules mentioned in the interview. These rules are also consistent with the Eastern Mediterranean (Amir, 2013). The only variation is the different shapes of the central road. Zhejiang University is a square with roads distributed on four sides. Hangzhou Dianzi Technical University is a long strip with a central road in the middle. Moreover, CUHK-Shenzhen, Shenzhen University, Zhejiang University of Technology, and Zhejiang Gongshang University follow similar rules.</p>
<h2 id="conclusion">Conclusion</h2>
<p>The current study supports that there is a strong demand for the opening of university campuses, which is an inevitable trend. Rather than a blanket ban, opening in order is better. The current study contributed to establishing a relatively complete policy system to respond to calls from university-related and unrelated populations. Further work could focus on gathering more data on all age groups. Therefore, an additional analysis could be conducted by collecting questionnaires from more population groups.</p>
<h2 id="references">References</h2>
<p>Ali M, Kim Y. (2020). Can a University Campus Work as a Public Space in the Metropolis of a Developing Country? The Case of Ain-Shams University, Cairo, Egypt. Sustainability. 12(17), 7229. https://doi.org/10.3390/su12177229<br>
CUHK PEU. (2024). Fee Regulation. CUHK. https://www.peu.cuhk.edu.hk/en-gb/facilities/fee-regulation<br>
Gumprecht, B. (2007). The campus as a public space in the American college town. Journal of Historical Geography, 33(1), 72-103.<br>
Hajrasouliha, A. H., &amp; Ewing, R. (2016). The campus does matter. Plann High Educ, 44, 30-45. https://restorativeworkplace.com/wp-content/uploads/2015/07/Campus_Does_Matter-2.pdf<br>
HKU CSE, (2024). Guest Policy &amp; Others Fees. HKU. https://cse.hku.hk/membership.asp?pageid=115<br>
Li, S., Zhao, Z., Miao, T., Li, X., Yu, S., Zhang, Y., Wei, J., &amp; Zou, K. (2024). Discrimination of Pb-Zn deposit types using the trace element data of galena based on deep learning. Ore Geology Reviews, 170, 106133. DOI:10.1016/j.oregeorev.2024.106133.<br>
Lin, Y. (2014). Investigating Accessibility of Public Campus Spaces at the University of British Columbia and Simon Fraser University. https://summit.sfu.ca/_flysystem/fedora/sfu_migrate/20408/etd20899.pdf<br>
Rashidi, A. (2013). University Campus as a Public Space of the City Case Study: Eastern Mediterranean University Campus. http://i-rep.emu.edu.tr:8080/xmlui/handle/11129/3333<br>
Office of the Leading Group for the Seventh National Population Census of the State Council. (2020). Major figures on the 2020 population census of China. https://www.stats.gov.cn/sj/pcsj/rkpc/d7c/202111/P020211126523667366751.pdf#page=23.00</p>
<h2 id="appendix">Appendix</h2>
<h3 id="questionnaire">Questionnaire</h3>
<p>Survey on Opening University Campus<br>
Hello! This questionnaire is designed to collect your opinions and suggestions on the Open campus University to help us promote a balance between students' learning and living standards and the rational use of campus resources. In this questionnaire, an open campus means that tourists can enter the university. We promise that all information will be used for academic research purposes only and will be kept confidential.</p>
<ol>
<li>Your age:	<br>
○12~18								○18~22 (Or pursuing a bachelor's degree)<br>
○22~25 (Or pursuing a master's degree)	○26~31 (Or pursuing a PhD. degree)	<br>
○32~40			○41~50			○51~60		○60 and above</li>
<li>Do you have experience living outside of China Mainland for over a month?<br>
○Yes, with university study experience○Yes, without university study experience	 ○No</li>
<li>Are you working in a university-related job (including a professor, university administrator, property manager, cleaner, etc.) or a student? ○ Yes	○ No</li>
<li>The highest academic qualification you have obtained (or are currently studying for) is:<br>
○High school and below	○College	○Undergraduate	○Masters' degree	○PhD. degree</li>
<li>Your children's educational background<br>
○At least one child has obtained (or is currently studying for) a college degree or above<br>
○Have children, but all of them are in high school or below<br>
○No children</li>
<li>Policy of your campus<br>
○ Visitors can visit any time spot without an appointment without an appointment or with a relaxed policy.<br>
○Visitors can walk freely on campus and eat in the dining hall but cannot do so in other spaces.<br>
○The previous option is met at certain times, but not most of the time (such as weekdays)<br>
○It is challenging to make an appointment (the number of people making an appointment does not match the number of places, or the school policy is limited)</li>
<li>Have you seen uncivilized behavior by outsiders on campus<br>
Never			○1			○2			○3			○4			○5			Always</li>
<li>The current open policy affects your study life<br>
totally disagree	○1			○2			○3			○4			○5   Totally agree</li>
<li>The current open policy makes the cafeteria (canteens, vending machines, etc.) crowded<br>
Totally disagree	○1			○2			○3			○4			○5 	Totally agree</li>
<li>The current open policy has led to traffic congestion on campus<br>
Totally disagree	○1			○2			○3			○4			○5 	Totally agree</li>
<li>If you have the opportunity, would you like to visit a university campus? 	○Yes ○No</li>
<li>Do you think universities should be open to the public?					○Yes ○No</li>
<li>What kind of universities would you like to visit?<br>
□Full of academic atmosphere	□Beautiful environment	<br>
□Any universities and colleges	□Others</li>
<li>Your purpose for entering the university<br>
□Academic exchanges (including but not limited to borrowing library books and attending classes)<br>
□Visit the campus landscape (including but not limited to walking and playing with children)<br>
□Use of university public facilities (such as the gymnasium) or participation in events (such as music festivals)<br>
□Feel the learning atmosphere of the university<br>
□As a taxpayer (Mainland only), I want to know where my money goes.<br>
□Others _________________</li>
<li>In the previous question, what is the primary purpose?<br>
○Academic Exchange	○Visit the campus landscape	○Use of university public facilities<br>
○Feel the learning atmosphere	○As a taxpayer (Mainland only), I want to know where my money goes.	○Others</li>
<li>What adverse effects might result from the public entering universities?<br>
□Misbehavior of some people (littering, spitting, etc.)<br>
□Causing losses to public or private finances (such as loss of library books, damage to public facilities, etc.<br>
□Disturbing lectures and students' lives	□unsafe	□high maintenance	□Others</li>
<li>Which places do you think universities should open?<br>
□University outdoor space, convenience store<br>
□Various sports venues (such as badminton halls)<br>
□Dining hall	□Library, study room, teaching building (if you can take classes)<br>
□dormitory		□Others _________________<br>
Please fill in your level of approval for the following options.</li>
<li>No reservation is required, or the reservation policy is relaxed.<br>
Totally Disagree	○1			○2			○3			○4			○5		Totally Agree</li>
<li>Visitors can only enter the campus on weekends or holidays.<br>
Totally Disagree	○1			○2			○3			○4			○5		Totally Agree</li>
<li>Visitors can take lectures or borrow books from the library if they want.<br>
Totally Disagree	○1			○2			○3			○4			○5		Totally Agree</li>
<li>Visitors can enter the university gym (including the swimming pool, tennis court, etc. ).<br>
Totally Disagree	○1			○2			○3			○4			○5	 	Totally Agree</li>
<li>Visitors cannot drive cars into the campus.<br>
Totally Disagree	○1			○2			○3			○4			○5		Totally Agree</li>
<li>Visitors cannot take the campus shuffle bus or pay for that (if they have one).<br>
Totally Disagree	○1			○2			○3			○4			○5 	Totally Agree</li>
<li>Visitors cannot use the dining hall; at least one is for students and staff only.<br>
Totally Disagree	○1			○2			○3			○4			○5	 	Totally Agree</li>
</ol>
<h3 id="semi-structured-interview-protocol">Semi-Structured Interview Protocol</h3>
<ol>
<li>Tell me a little about your background information.<br>
a)	How long have you been a designer?<br>
b)	How many projects have you done?</li>
<li>How to design a better streamline?</li>
<li>Why does it work?</li>
<li>Could you please provide some examples?</li>
</ol>
]]></content>
    </entry>
    <entry>
        <title type="html"><![CDATA[[100 challenge Array/List] P1222 Paired Up | ★ Solution]]></title>
        <id>https://LinyongGAN.github.io/post/100-challenge-arraylist-p1222-paired-up-or-solution/</id>
        <link href="https://LinyongGAN.github.io/post/100-challenge-arraylist-p1222-paired-up-or-solution/">
        </link>
        <updated>2024-11-21T01:29:59.000Z</updated>
        <content type="html"><![CDATA[<p>the idea is very straight forward. Choose the largest and the smallest to match a pair, so that it would be the optimal solution. leverage 2 pts to achieve that.</p>
<p>The most difficult part of this question is the domain of N and M.</p>
<h2 id="approach-1">Approach 1</h2>
<p>store y in an array one by one.</p>
<pre><code class="language-cpp">for(int i = 0; i &lt; n; i++)
{
    int x, long long y;
    scanf(&quot;%d%lld&quot;, &amp;x, &amp;y);
    for(int j = 0; j &lt; x; j++) cow[m++] = y;
}
</code></pre>
<p>however, M could up to 1e9, it's not acceptable for C++.</p>
<h2 id="approach-2">Approach 2</h2>
<p>store x and y in an array, and reduce that one by one.</p>
<pre><code class="language-cpp">while(l &lt; r || (l == r &amp;&amp; cow[l].x != 0))
{
    mx = max(mx, cow[l].y+cow[r].y);
    cow[l].x--, cow[r].x--;
    if(cow[l].x==0) l++;
    if(cow[r].x==0) r--;
}
</code></pre>
<p>however, reduce one by one is too slow. only 10 pts, but very approach to the solution.</p>
<h2 id="approach-3">Approach 3</h2>
<p>rather than reduce one by one, reduce the largest number.</p>
<pre><code class="language-cpp">while(...)
{
    mx = ...
    if(cow[l].x &gt; cow[r].x)
    {
        cow[l].x -= cow[r].x;
        r--;
    }
    else if(cow[r].x &gt; cow[l].x)
    {
        ...
    }
    else
    {
        l++, r--;
    }
}
</code></pre>
]]></content>
    </entry>
    <entry>
        <title type="html"><![CDATA[[100 challenge Array/List] P1214 Haybale Feast | ★ Solution]]></title>
        <id>https://LinyongGAN.github.io/post/100-challenge-arraylist-p1214-haybale-feast-or-solution/</id>
        <link href="https://LinyongGAN.github.io/post/100-challenge-arraylist-p1214-haybale-feast-or-solution/">
        </link>
        <updated>2024-09-16T05:40:41.000Z</updated>
        <content type="html"><![CDATA[<p><s>真丢脸这么简单的题目提交了五次</s><br>
一看到farmer John就知道这题肯定是出自USACO了。果不其然，出自USACO 2017的一道G题。</p>
<h2 id="题意">题意</h2>
<p>有若干个草堆线性排列，每个草堆都有风味F和辣值S两个参数。定义一道菜为连续的一个或若干个草堆，菜的风味值为所有风味的总和，辣值为所有草堆中最大的辣值。求在风味值超出给定的阈值的前提下最小的辣味值。<br>
注意到F和M的取值，三年oi一场空，不开longlong见祖宗。</p>
<h2 id="思路">思路</h2>
<h3 id="朴素的尺取法">朴素的尺取法</h3>
<p>尺取法又称双指针（2ptr），是两个指针滑动产生的算法，时间复杂度为O(n)。而它最大的优点在于可以快速抛弃后面的，加入前面的，这也是它的要求。因此对于原题中的数组顺序不可改变的、有大量区间异或值、求和、求积的题目，2ptr很有优势。这题涉及到了F求和，因此不妨一试。</p>
<pre><code class="language-java">import java.util.Scanner;

public class Main
{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		String[] tmp = sc.nextLine().split(&quot; &quot;);
		if(tmp[0].isEmpty()) tmp = sc.nextLine().split(&quot; &quot;);
		int n; long m;
		n = Integer.parseInt(tmp[0]); m = Long.parseLong(tmp[1]);
		long[] F = new long[n], S = new long[n];
		for(int i = 0; i &lt; n; i++)
		{
			tmp = sc.nextLine().split(&quot; &quot;);
			if(tmp[0].isEmpty()) tmp = sc.nextLine().split(&quot; &quot;);
			F[i] = Long.parseLong(tmp[0]); S[i] = Long.parseLong(tmp[1]);
		}
        // input over
		int p, q;
		p = q = 0;
		long sum = F[0], g_min = S[0];
		while(p &lt; n)
		{
			if(sum &lt; m)
			{
				if(p &lt; n-1) sum += F[++p];
				else break;
			}
			else
			{
				long max = S[p];
				for(int i = q; i &lt;= p; i++)
					if(S[i] &gt; max)
						max = S[i];
				if(max &lt; g_min) g_min = max;
				if(q &lt; p) sum -= F[q++];
				else break;
			}
		}
		System.out.println(g_min);
	}
}
</code></pre>
<p>显然这段代码并不work。虽然在求和方面很有优势，但求最大值最小值方面很不擅长，复杂度是直接O(n)了，那总的复杂度就变成了O(n^2)，是不能满足1e6的数据量的。</p>
<h3 id="二分法">二分法</h3>
<p>这题确实不容易想到二分，但单从复杂度上看似乎也能看出一些端倪。二分的复杂度是O(log)级别的，1e6的log也就20左右，再配合一个求min/max总的也只有O(nlogn)，看起来是完全胜任的。<br>
二分答案的前提是答案是有序的。举例来说，如果答案为10时可以，那么比10小的就一定可以，比10大的就一定不可以。注意这里的充要性。<br>
仔细想想这道题，答案一定在有限的、给定的S中取，而且是求最小值的，这也就意味着有很大可能性是可以二分的。于是我们写出二分的代码</p>
<pre><code class="language-cpp">int l = 0, r = n-1, mid;
while(l &lt; r)
{
    mid = (l+r) &gt;&gt; 1;
    if(check(mid)) // mid 是一个可行解，往小里找
        r = mid; // 注意到mid是可行解，因此保边界。注意这里的改动导致while的条件发生变化以防止死循环
    else
        l = mid + 1;
}
</code></pre>
<p>对于check函数，我们只需要从mid出发，找出两边不超过当前S的部分，只要加起来大于m，就找到了一组最优情况，返回true，如果最后还是没有找到，返回false</p>
<pre><code class="language-c++">bool check(int mid)
{
	int idx = hay[mid].idx;
	long sum = hay[mid].F;
	int p = idx+1;
	while(p &lt; n &amp;&amp; S[p] &lt; hay[mid].S)
	{
		sum += F[p++];
		if(sum &gt;= m)
			return true;
	}
	p = idx-1;
	while(p &gt;= 0 &amp;&amp; S[p] &lt; hay[mid].S)
	{
		sum += F[p--];
		if(sum &gt;= m)
			return true;
	}
	return false;
}
</code></pre>
<p>交了之后你会发现只有50分。我们不妨再思考一下，这样真的具有单调性吗？举个例子</p>
<pre><code>3 10
4 15
6 10
10 9
</code></pre>
<p>显然，正确答案是9，而且单独一个 <code>10 9</code> 就可以满足题意了。但是，我们会直接枚举到10，竟然发现是不合法的！因为只有4+6才具备效力，根本无法预见到还有F更大S更小的情况。<br>
那应该怎么办呢？调整check就可以了。check表达为“S不超过二分出来的最大值时能找到的最优方案。”代码如下</p>
<pre><code class="language-c++">bool check(long max)
{
    long sum = 0;
    for(int i = 0; i &lt; n; i++)
    {
        if(S[i] &lt;= max) sum += F[i];
        else sum = 0;
        if(sum &gt;= m) return true;
    }
    return false;
}
</code></pre>
<p>从而这题就解决了。</p>
<h3 id="再探尺取法">再探尺取法</h3>
<p>尺取法真的不可吗？其实未必。尺取法本身的复杂度是O(n)，是求min/max让他的复杂度再乘了一个n，那只需要把后面的那个n降到log n这题就能解决了。那查询最值有什么logn的办法吗？有。st表、QMR。因此很多人拿此题当st表的练手题，这也是评级是绿题的原因。由于st表并不在3100的考察范围内，而且有模板可背，这里就不再赘述了。</p>
<pre><code class="language-c++">#include &lt;bits/stdc++.h&gt;
using namespace std;

const int N = int(1e5+10);

long F[N], S[N];
int n;
long m;

long dp[N][22];
int Log[N];
long sum[N];

void init()
{
	Log[0]=-1;
	for(int i=1;i&lt;=n;i++)
		Log[i]=Log[i&gt;&gt;1]+1;
	for(int i=0;i&lt;n;i++)
		dp[i][0]=S[i];
	for(int j=1;j&lt;=20;j++)
		for(int i=1;i+(1&lt;&lt;j)-1&lt;=n;i++)
			dp[i][j]=max(dp[i][j-1],dp[i+(1&lt;&lt;j-1)][j-1]);
}
long query(int x,int y)
{
	int s=Log[y-x+1];
	return max(dp[x][s],dp[y-(1&lt;&lt;s)+1][s]);
}
int main()
{
	scanf(&quot;%d%ld&quot;, &amp;n, &amp;m);
	for(int i = 0; i &lt; n; i++) scanf(&quot;%ld%ld&quot;, &amp;F[i], &amp;S[i]);
	sum[0] = F[0];
	for(int i = 1; i &lt; n; i++) sum[i] = sum[i-1] + F[i];
	init();
	int p = 0, q = 0; // p in front; q back
	long res;
	for(int i = 0; i &lt; n; i++) res = max(S[i], res);
	for(q = 0; q &lt; n; q++)
	{
		while(p &lt; n &amp;&amp; sum[p]-sum[q-1] &lt; m) p++;
		if(p &lt; n) res = min(res, query(q, p-1));
	}
	printf(&quot;%ld\n&quot;, res);
	return 0;
}
</code></pre>
]]></content>
    </entry>
    <entry>
        <title type="html"><![CDATA[[100 challenge Array/List] P1024 Minesweeper | ★ Solution]]></title>
        <id>https://LinyongGAN.github.io/post/100-challenge-arraylist-p1024-minesweeper-or-solution/</id>
        <link href="https://LinyongGAN.github.io/post/100-challenge-arraylist-p1024-minesweeper-or-solution/">
        </link>
        <updated>2024-09-12T14:30:30.000Z</updated>
        <content type="html"><![CDATA[<h3 id="题意">题意</h3>
<p>雷区有两行，只有第一行有埋雷。现在给定第二行体现出来的周围雷的个数，求方案数。</p>
<h2 id="思路">思路</h2>
<p>显然（结合标签也可以看出来）是一道动态规划。动规难的就是状态的构建和转移，真正的代码实现并不复杂。</p>
<h3 id="动规方程构建">动规方程构建</h3>
<p>记 <code>dp[i][j]</code> 表示在 i 位置的状态为 j，前 i 个位置有的方案数。其中 j 为状态的代号，对应表如下：{0: .., 1: .*, 2: *., 3: **}。其中 <code>*</code> 为雷， <code>.</code> 为非雷。</p>
<h3 id="方程初始">方程初始</h3>
<p><code>dp[0][c] = 1 if c is valid w.r.t A[0] for any c</code><br>
<code>dp[0][c] = 0 if c is not valid w.r.t A[0] for any c</code></p>
<h3 id="方程转移">方程转移</h3>
<p><code>dp[i][c1] += dp[i-1][c2] for any c1, c2 and they are valid w.r.t A, i, c1, c2</code></p>
<h2 id="代码">代码</h2>
<pre><code class="language-java">import java.util.Scanner;

public class P1024Minesweeper
{
	public static int check_valid_first(int[] A, int i, int c)
	{
		if(A[i] == 0 &amp;&amp; c == 0) return 1;
		if(A[i] == 1 &amp;&amp; (c == 1 || c == 2)) return 1;
		if(A[i] == 2 &amp;&amp; c == 3) return 1;
		return 0;
	}
	public static int check_valid(int[] A, int i, int c1, int c2)
	{
		if(A[i] == 0 &amp;&amp; (c1 == 0 &amp;&amp; c2 == 0)) return 1;
		if(A[i] == 1 &amp;&amp; ((c1 == 1 &amp;&amp; c2 == 2) || (c1 == 0 &amp;&amp; c2 == 1) || (c1 == 2 &amp;&amp; c2 == 0))) return 1;
		if(A[i] == 2 &amp;&amp; ((c1 == 3 &amp;&amp; c2 == 2) || (c1 == 2 &amp;&amp; c2 == 1) || (c1 == 1 &amp;&amp; c2 == 3))) return 1;
		if(A[i] == 3 &amp;&amp; (c1 == 3 &amp;&amp; c2 == 3)) return 1;
		return 0;
	}
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.nextLine());
		String[] Astr = sc.nextLine().split(&quot; &quot;);
		int[] A = new int[n];
		for(int i = 0; i &lt; n; i++)
			A[i] = Integer.parseInt(Astr[i]);

		int[][] dp = new int[n][4];
		for(int i = 0; i &lt; 4; i++) dp[0][i] = check_valid_first(A, 0, i);
		
		for(int i = 1; i &lt; n; i++)
			for(int c1 = 0; c1 &lt; 4; c1++)
				for(int c2 = 0; c2 &lt; 4; c2++)
					dp[i][c1] += dp[i-1][c2] * check_valid(A, i, c1, c2);

		System.out.println(dp[n-1][0]+dp[n-1][1]+dp[n-1][2]+dp[n-1][3]);
	}
}
</code></pre>
<h2 id="反思">反思</h2>
<p>如何设计动规方程？显然会带一个位置信息，一维已经去了，最多还能来一维，而且不能是给位置相关的（不然就开不下了）。<br>
两种可能性：一是这题真就够了，直接用一个位置转移全；二是还必须要带一个要素，但不能占空间太大。<br>
显然这题不可能一个位置转移到底，因为这还跟雷的分布有很大的关系。<br>
很难的一点是如何把A的值和雷的分布去映射起来，而且dp中存的还应该是方案数。单纯的数学好像是不能解决了，所以用函数去判断是不是合法的，或者说是把雷的状态和A对应起来。<br>
这样看，第二维只需要记录雷的状态就可以了。先考虑只记录当前位置的状态。如果当前位置是雷，但不知道前后的情况，依然不能判断是不是合法，所以重新考虑把前后带进来。因此是记录当前和下一个，一共四种状态。<br>
这样状态方程就设计出来了。<br>
至于结论在什么位置，一般是取全部的总和、取全部的最大值或者取最后的状态。方案数想要转移，结果应该就是存在最后一个位置的。</p>
]]></content>
    </entry>
    <entry>
        <title type="html"><![CDATA[我们需要什么样的人才：从高考到申请制]]></title>
        <id>https://LinyongGAN.github.io/post/wo-men-xu-yao-shi-me-yang-de-ren-cai-cong-gao-kao-yan-kao-dao-gpa-zhi-du/</id>
        <link href="https://LinyongGAN.github.io/post/wo-men-xu-yao-shi-me-yang-de-ren-cai-cong-gao-kao-yan-kao-dao-gpa-zhi-du/">
        </link>
        <updated>2024-09-09T09:42:16.000Z</updated>
        <content type="html"><![CDATA[<h2 id="引入">引入</h2>
<p>人的一生有无数次考试，特别是初等教育阶段。我们不妨思考：考试的本质到底是什么？个人认为，考试的根本目的在于筛选，是一个将不同考生分成不同聚类的分类器，通常是按某一标准来衡量人的“优”与“劣”的。为了方便，我们理想化地将被分类器划定为“优”的人与“人才”画上等号。因此，各种考试细节也被众人广泛研究，塑造着各位考生，使得他们尽可能的向能获得高分的方向发展。<br>
考试制度纷繁复杂，大到国家，小到一个学生社团，都有专属的考试方式。中国的高考往往牵动着所有人的心。对于中国的家庭来说，一切事情都可能会向高考让步。高考往往发生在每一个孩子的十八岁那年，这意味着这是孩子的一次“成年考”；同时，高考是初等教育与高等教育的分水岭，是对十二年初等教育的一次简短而隆重的总结，大学是大部分孩子第一次远离寓居多年的家乡而独自生活的地方。另外的，当前“第一学历”歧视仍然屡见不鲜，好的高考成绩甚至能使人在找工作时得到红利，而坏的成绩则会被认为是一个人生污点，每每被提及只能面红耳赤、无地自容。<br>
根据黄文权（2004）的说法，美国学生一年可以参加七次高考（i.e. SAT），甚至可以从初中开始考，考到满意为止，考完后可以选取最满意的两次成绩提交给大学招办作为准入依据。这当然能为学生带去很多好处：更多的考试机会能更准确的体现出学生的平均水平，也能在很大程度上降低学生的考试压力，从而获得更准确的结果。自2014年起，浙江省开始筹办首考，即每名考生的七选三（从物理、化学、生物、政治、地理、历史、技术七门课程中选择三门作为选考科目，采取赋分制）和英语共四科可以在一月和六月参加两次考试，取两次成绩中的最高分为最终成绩（如未参加考试，则当次考试记零分）语文和数学只能在六月参加考试。这也就意味着除了减少学生成绩波动，增强成绩的可靠性外，学生还可在首考某些课程上得到满意成绩后将更多精力投入到剩下的课程中，从而获得更优的出口成绩。</p>
<p>当前的大学高等教育貌似也存在很大的问题。根据卢瑶等人（2023，绩点为王的思维代价：学习投入与本科生的学业表现和高阶思维能力）的报告，通过对不同学校不同GPA分数段的学生进行“全国本科生批判性思维能力测评”量表（无法根据引用找到对应量表）以衡量学生的批判性思维能力。研究表明，“学习投入带来的GPA高涨是以侵蚀批判性思维能力发展为代价的”。不过“批判性思维”究竟为何物？这是一张什么样的试卷（量表）？会不会导致学生对这张试卷产生应试效应？不知作者能否给出确切的回答。</p>
<h2 id="成绩不是衡量学生的唯一标准">成绩不是衡量学生的唯一标准</h2>
<p>“我认为中、美教育最大的区别就是培养考生还是培养学生。”（黄文权，2004，中美教育比较，第二章）我认为黄对考生和学生的区分是切中了肯綮的。在他的语境下，“考生”是关心考试胜过关心知识的，过度的刷题导致对常见的题型烂熟于心，考试成绩是光彩耀人的，面对各种试卷，总能答的又快又好。黄认为，这是我们的学生并不能获得诺奖的原因，因为诺奖需要学生有面向未知的勇气，而不是对着现成的答案磨刀霍霍。从某种意义上说，这是一种考生对考试的过拟合，高的考试成绩并不能直接揭示学生就具有高的学术水平。<br>
目前，中国高等教育广泛应用的绩点制度就是对解决这一过拟合现象的尝试。除了每一学期的期中期末考成绩外，学生的绩点还取决于日常课堂的签到与表现、平时的作业与小测等多方面的因素。<br>
不过，我并不认为高考制度是我们拿不了诺奖的罪魁祸首。诺奖的获奖周期约为四十到六十年，那会甚至可能高考制度都还没有启用。近几年，高考制度在不断的改革升级，高等教育改革的呼声也日渐高涨。不妨让我们有一些耐心，等待更多的人才从高考制度中涌现出来。<br>
当然，我也同意成绩不是衡量学生的唯一标准。更多元化的考察方式能获得更多获得考生的学习状态与品性，能更准确的辅助招办选取他们需要的人才。例如，在考察学生的高考成绩之外，再加入一些高考所不能获得的考核方式。全国广泛开展的强基计划，浙江的三位一体（广东的6-3-1）等，都在高考的基础上，额外增加一轮或多轮、笔试或面试的选拔机制，从而增强考试成绩的可靠性。</p>
<h2 id="绩点制度也有很大的改进空间">绩点制度也有很大的改进空间</h2>
<p>尽管这一制度的初衷是尽可能增加评价体系的多元化，减少期中期末考试失误对总分造成的影响，但是也意味着学生日常的一举一动都会被记录在案。在日常作业和小测人均满分的前提下，意味着在作业和小测中任意的疏忽失误都可能导致最终等第的降档。<br>
这一切的根源其实来自于曲线评分机制与不合理的评估计划（例如低到离谱的考试成绩方差和高到离谱的占比）。复旦大学教务处在2024年高考前夕发布了新版本科生成绩记载规定。主要修改了以下几点：一是规定了A+和A的占比不超过30%，但A-及以下的等第不设置人数上限；二是学生在本科期间最多可以将16学分的课程（每学期最多一门课）设置为PF制，也就是不计入绩点。这其实是对曲线评分机制的一次变革，意味着学生可以通过合理利用政策获得更高的绩点。</p>
<p>但是，曲线评分机制也是一种迫于无奈的妥协。对于一所学生出口主要依靠对外申请的大学来说，只有让GPA的区分度变得更大才可能让真正有能力值得倾注资源的人获得更高的GPA，这才是对学生真正的裨益。复旦大学此举将提高学生的整体绩点，可能会导致接收申请的学校对其分数与能力对应产生怀疑，因此此政策并不一定带来的全都是正面影响。不过，每所大学都有不同的情况，在此不做正确性的评判。</p>
<p>为了提升GPA与能力的对应情况，可以考虑改良曲线评分本身。曲线评分的最大受害者莫过于3.7至3.9分数段的学生。对于3.9以上的学生，他们往往在高中时就是学校里的佼佼者，维护一个高绩点对他们来说并不是难事；由于A-对应的绩点就是3.7，对于3.7至3.9分数段的学生，想要维护当前的分数段就必须保证每一门课都是A，否则就会导致总绩点下降。这势必会给这部分学生带去很高的不确定性与学习压力。因此，为了提升区分度，我认为可以降低档位之间的步长，让赋分变得更细致一些。例如，原本的A-（3.7）可以被分割成3.7、3.8、3.9三个分数段，这样能更细致的反映学生所处的位置，尽管可能争取不到4.0，也可以考虑争取3.9，而按照现有的方案，就会直接被赋上3.7了。</p>
<p><strong>同时也可以考虑改善评估计划。</strong> 理论上来说，评估计划中的每一项都应当尽量平均，考察项应当尽可能的多元化。例如我这学期正在上的一门课有这样的计划：<br>
签到和上课表现	5<br>
当堂小测 25<br>
作业项目1	10<br>
项目2	10<br>
项目3	12.5<br>
项目4	12.5<br>
期末考试	25<br>
这样的计划不仅有占比45%作业的，还有颇有趣味性的口头抢答。评估更加多元化，学生也不会因为一次考试跌倒而成千古恨。<br>
相对来说，其他科目就没有这么多元了。大部分的课程都是这样的：<br>
作业	20<br>
期中	30<br>
期末	50<br>
由于作业基本没有分选性，一次作业低分最后影响的可能只是零点几分；而期末考试一失误，可能丢掉的就是十多分，而折合到总分上则是非常可怕的数目。<br>
另外的，<strong>大学的职业与升学规划部门也可以多多为学生提出客制化建议</strong>，尽量发掘学生擅长的和热爱的，推动学生多元化发展。当前的申请有很强的套路色彩，几乎每一位学生到出口时都会有一段科研经历、一段实习经历、几个课程项目经历。对于目标院校的招办来说，对这些经历早已麻木，最后能比拼学生的就只剩下GPA了。如果能跳出GPA诅咒，多多发掘可能让目标院校眼前一亮的特色——当然更重要的是学生兴趣驱动——才能让学生学的开心、GPA的竞争压力变小的同时还能让申请结果得体，目标院校也得到了自己想要的人才。</p>
<h2 id="成绩就是衡量学生的唯一标准">成绩就是衡量学生的唯一标准</h2>
<h3 id="高考制度的优势在于高效与公平">高考制度的优势在于高效与公平</h3>
<p>讨论一切制度都需要提及其背景因素。目前来看，与我们的高考制度相对应的是申请制。根据黄（2004）提供的美国高考的情况，申请制强调不以成绩为唯一标准，而需要加入面试等其他各方面的因素。但是，个人认为这样的制度会出现以下两个问题：<br>
<strong>一是无法实现高效</strong>。考试可以同步进行，只需要保证题目没有泄露，在相同时间开启同一份试卷，哪怕考生在天涯海角，哪怕考生是千军万马，无非就是多印一些试卷罢了。而如果是面试，则需要考官一遍一遍地重复问题，一遍一遍听考生回答或许考官都能倒背如流的答案。这对与少数的考生回答有特色的试题或许是可行的（因此不少三位一体采用了面试方案），但作为面向数千万每年考生的高考来说，这显然是不能被接受的。<br>
<strong>二是无法保证公平</strong>。面试总是希望能体现学生的闪光点，也支持学生有千奇百怪的回答。但正是因为回答的千奇百怪，使得不同的观点并不一定能被统一。或许相同的回答在不同的面试官面前就会得到迥异的分数。</p>
<h3 id="考试既是检验也是评价">考试既是检验，也是评价</h3>
<p>黄提出：“在美国，考试是老师了解学生、发现学生，与学生交流的一种手段，所以不在乎你画什么，而且老师也参与。但是在中国，考试就是择优汰劣的最终极、最权威的教学行为。”（2004，中美教育比较——关于考试与考试制度，第三章）这一点我并不敢苟同。在中国，考试不仅是择优汰劣的手段，也可以是老师了解学生、发现学生的方式。对于最终会被计入人生档案的大考，这当然是一种终极而权威的评判，但对于日常的小考，自然应当被当做是与学生交流的手段。平常的考试同作业一起，都是用来暴露问题的。在知识层面上，会做就是会做，不会就是不会，每次把不会的都补充上了下次就会了。当然，平时的考试还会模拟一种大考的状态，包括时间的掌控和心理的调整。对老师来说，看到某道题学生错的多，就可能是上课没有讲清楚，或者大部分学生掌握的不是很好，那就在课堂上着重强调一下，这一样是对学生的关爱，并不见得就有多么明显的弱势。<br>
另外，从考试产生的初衷来看，其本质就是衡量学生的水平的。根据侯玉文《考试制度的起源》（2013），“考”更侧重考核，“试”更侧重评价，“考试”合在一起后，其内涵逐渐演变为特指考查知识或技能的方法和制度等。这也就意味着，“考试”就是为了分选而设定的，而分选的指标就是成绩，参加考试的唯一目的就是为了得到更高的分数。黄提到的他儿子在数学竞赛上为了啃难题而放弃了简单题本身就是对考试的一种亵渎。简单题你看不上，又如何证明你是真的看不上还是做不出来呢？就像姓费的那小子在纸上写下的那句“我确信已发现了一种美妙的证法，可惜这里空白的地方太小，写不下”，但谁又能知道他是不是真的写不下呢？人是需要有个性的，但太有个性则变成了固执己见冥顽不化。从某种意义上说，考试也有淘汰这一部分人的功能，毕竟谁也不希望将来自己的合作伙伴是一个喜欢说“空间太小，我写不下”的人。</p>
<h3 id="竞争并不是坏事">竞争并不是坏事</h3>
<p>竞争是必然存在的，因为竞争是与能力匹配的资源再分配。如果消解了竞争，意味着教育资源与受教育人群的错位，这是一种资源的浪费。我们不应该反对竞争，竞争不会造成关系的紧张。竞争并不意味着恶性竞争。在当前高考人数体量下，能竞争取代掉你的人绝不只是与你朝夕相处的同学。与其阻碍他人进步，不如提升自己。事实上，我们见过大部分取得优异成绩的结伴者都说他们之间是“相互竞争、相互学习、相互帮助、相互促进”的关系。</p>
<h3 id="与其抛弃考试不如改良试卷">与其抛弃考试，不如改良试卷</h3>
<p>随着近几年高考改革深入，高考试卷（主要是全国卷）已经变得非常值得推敲了。不过，高考作为每年一次的全国关注的大考，其试卷是大量教育专家通过大量时间打磨出来的结果，并不是每一场考试都能做到的。试卷的整体设计应当遵循尽可能以考纲为准绳，以增加区分度为蒿矢，努力让每一个学生的成绩都能更准确的反映其知识水平和学习能力。<br>
在试卷的整体布局上，应当要确保有简单、中等和困难三档题，每档题都应根据考试的对象设置合适的分值。应当在答案合理、符合正常人思维的前提下，尽可能使题目和答案客观、可量化，确保不同的改卷老师总是能给出相近的分数。例如，我最近参加的某门课程期末考试中，有72分（满分100）为基本题，还有大分值的题目可以在考场上通过验算检验，而剩下的题目都是难题，基本全靠运气和改卷人的仁慈，这也就意味着中位数会在72分附近徘徊。这对中位数附近的学生或许会有利，但对高分段的学生来说，想拿一个高分是何其困难。再加上一不小心在72分中随便错一些，那便是一学期的努力白费了。<br>
在试题设计上（尤其是大学的期末考试），我有以下几点建议：</p>
<ul>
<li><strong>首先，考试应当明确设立考纲</strong>，需要每一名学生清楚考试的范围、题型和难度，要留给学生充分的准备资料（例如历年试卷，如果可以的话还应该提供考试的复习资料）。</li>
<li><strong>其次，一切选拔制度的根本目的是选拔</strong>，而不是炫技或者是刻意为难考生。要尽量清晰地描述题意，并尽可能避免模糊表达。对因表述不清楚而导致大量学生丢分的情况，要积极承认并提出下一步的补救措施，可以接受的就接受，不能接受也要好好说话，而不是梗着脖子红着脸信口开河转移话题诬陷学生不来上课。</li>
<li><strong>同时，题目需要有足够的铺垫和小问</strong>，尤其是对于一些区分学生层次的难题。出一道题可能需要好几天，做题者却只有不超过二十分钟，做题者并不一定能完全对上出题人的思路。或许完整的想出一道题的思路能体现一个学生具有非凡的水平，但并不意味着有了铺垫就没有分选性。相反，有铺垫的试题更像是在圈定的范围内跳舞，更有针对性的体现学生对知识点的掌握情况。例如：<br>
<strong>2022年新高考II卷</strong> 22. 已知函数<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>=</mo><mi>x</mi><msup><mi>e</mi><mi>a</mi></msup><mi>x</mi><mo>−</mo><msup><mi>e</mi><mi>x</mi></msup></mrow><annotation encoding="application/x-tex">f(x)=xe^ax-e^x</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 mathdefault" style="margin-right:0.10764em;">f</span><span class="mopen">(</span><span class="mord mathdefault">x</span><span class="mclose">)</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.747722em;vertical-align:-0.08333em;"></span><span class="mord mathdefault">x</span><span class="mord"><span class="mord mathdefault">e</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.664392em;"><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 mathdefault mtight">a</span></span></span></span></span></span></span></span><span class="mord mathdefault">x</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span></span><span class="base"><span class="strut" style="height:0.664392em;vertical-align:0em;"></span><span class="mord"><span class="mord mathdefault">e</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.664392em;"><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 mathdefault mtight">x</span></span></span></span></span></span></span></span></span></span></span><br>
(1) 当<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>a</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">a=0</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">a</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>时，讨论<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo></mrow><annotation encoding="application/x-tex">f(x)</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 mathdefault" style="margin-right:0.10764em;">f</span><span class="mopen">(</span><span class="mord mathdefault">x</span><span class="mclose">)</span></span></span></span>的单调性<br>
(2) 当<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>x</mi><mo>&gt;</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">x&gt;0</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5782em;vertical-align:-0.0391em;"></span><span class="mord mathdefault">x</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">&gt;</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>时，<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>f</mi><mo>(</mo><mi>x</mi><mo>)</mo><mo>&lt;</mo><mo>−</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">f(x)&lt;-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 mathdefault" style="margin-right:0.10764em;">f</span><span class="mopen">(</span><span class="mord mathdefault">x</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">&lt;</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:0.72777em;vertical-align:-0.08333em;"></span><span class="mord">−</span><span class="mord">1</span></span></span></span>，求实数<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>a</mi></mrow><annotation encoding="application/x-tex">a</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">a</span></span></span></span>的取值范围<br>
(3) 设<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>n</mi><mo>∈</mo><msup><mi>N</mi><mo>∗</mo></msup></mrow><annotation encoding="application/x-tex">n\in N^*</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.5782em;vertical-align:-0.0391em;"></span><span class="mord mathdefault">n</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.688696em;vertical-align:0em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.10903em;">N</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.688696em;"><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> ,证明</li>
</ul>
<p class='katex-block'><span class="katex-display"><span class="katex"><span class="katex-mathml"><math><semantics><mrow><mfrac><mn>1</mn><msqrt><mrow><msup><mn>1</mn><mn>2</mn></msup><mo>+</mo><mn>1</mn></mrow></msqrt></mfrac><mo>+</mo><mfrac><mn>1</mn><msqrt><mrow><msup><mn>2</mn><mn>2</mn></msup><mo>+</mo><mn>2</mn></mrow></msqrt></mfrac><mo>+</mo><mfrac><mn>1</mn><msqrt><mrow><msup><mn>3</mn><mn>2</mn></msup><mo>+</mo><mn>3</mn></mrow></msqrt></mfrac><mo>+</mo><mo>⋯</mo><mo>+</mo><mfrac><mn>1</mn><msqrt><mrow><msup><mi>n</mi><mn>2</mn></msup><mo>+</mo><mi>n</mi></mrow></msqrt></mfrac><mo>&gt;</mo><mi>ln</mi><mo>⁡</mo><mi mathvariant="normal">⁡</mi><mo>(</mo><mi>n</mi><mo>+</mo><mn>1</mn><mo>)</mo></mrow><annotation encoding="application/x-tex">\frac{1}{\sqrt{1^2+1}}+\frac{1}{\sqrt{2^2+2}}+\frac{1}{\sqrt{3^2+3}}+⋯+\frac{1}{\sqrt{n^2+n}}&gt;\ln ⁡(n+1)
</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:2.25144em;vertical-align:-0.93em;"></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.196611em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord sqrt"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.913389em;"><span class="svg-align" style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord" style="padding-left:0.833em;"><span class="mord"><span class="mord">1</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.740108em;"><span style="top:-2.9890000000000003em;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 class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mord">1</span></span></span><span style="top:-2.873389em;"><span class="pstrut" style="height:3em;"></span><span class="hide-tail" style="min-width:0.853em;height:1.08em;"><svg width='400em' height='1.08em' viewBox='0 0 400000 1080' preserveAspectRatio='xMinYMin slice'><path d='M95,702c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,
-10,-9.5,-14c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54c44.2,-33.3,65.8,
-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10s173,378,173,378c0.7,0,
35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429c69,-144,104.5,-217.7,106.5,
-221c5.3,-9.3,12,-14,20,-14H400000v40H845.2724s-225.272,467,-225.272,467
s-235,486,-235,486c-2.7,4.7,-9,7,-19,7c-6,0,-10,-1,-12,-3s-194,-422,-194,-422
s-65,47,-65,47z M834 80H400000v40H845z'/></svg></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.12661100000000003em;"><span></span></span></span></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.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.93em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></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><span class="base"><span class="strut" style="height:2.25144em;vertical-align:-0.93em;"></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.196611em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord sqrt"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.913389em;"><span class="svg-align" style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord" style="padding-left:0.833em;"><span class="mord"><span class="mord">2</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.740108em;"><span style="top:-2.9890000000000003em;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 class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mord">2</span></span></span><span style="top:-2.873389em;"><span class="pstrut" style="height:3em;"></span><span class="hide-tail" style="min-width:0.853em;height:1.08em;"><svg width='400em' height='1.08em' viewBox='0 0 400000 1080' preserveAspectRatio='xMinYMin slice'><path d='M95,702c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,
-10,-9.5,-14c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54c44.2,-33.3,65.8,
-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10s173,378,173,378c0.7,0,
35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429c69,-144,104.5,-217.7,106.5,
-221c5.3,-9.3,12,-14,20,-14H400000v40H845.2724s-225.272,467,-225.272,467
s-235,486,-235,486c-2.7,4.7,-9,7,-19,7c-6,0,-10,-1,-12,-3s-194,-422,-194,-422
s-65,47,-65,47z M834 80H400000v40H845z'/></svg></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.12661100000000003em;"><span></span></span></span></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.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.93em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></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><span class="base"><span class="strut" style="height:2.25144em;vertical-align:-0.93em;"></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.196611em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord sqrt"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.913389em;"><span class="svg-align" style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord" style="padding-left:0.833em;"><span class="mord"><span class="mord">3</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.740108em;"><span style="top:-2.9890000000000003em;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 class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mord">3</span></span></span><span style="top:-2.873389em;"><span class="pstrut" style="height:3em;"></span><span class="hide-tail" style="min-width:0.853em;height:1.08em;"><svg width='400em' height='1.08em' viewBox='0 0 400000 1080' preserveAspectRatio='xMinYMin slice'><path d='M95,702c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,
-10,-9.5,-14c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54c44.2,-33.3,65.8,
-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10s173,378,173,378c0.7,0,
35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429c69,-144,104.5,-217.7,106.5,
-221c5.3,-9.3,12,-14,20,-14H400000v40H845.2724s-225.272,467,-225.272,467
s-235,486,-235,486c-2.7,4.7,-9,7,-19,7c-6,0,-10,-1,-12,-3s-194,-422,-194,-422
s-65,47,-65,47z M834 80H400000v40H845z'/></svg></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.12661100000000003em;"><span></span></span></span></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.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.93em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></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><span class="base"><span class="strut" style="height:0.66666em;vertical-align:-0.08333em;"></span><span class="minner">⋯</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span></span><span class="base"><span class="strut" style="height:2.25144em;vertical-align:-0.93em;"></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.196611em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord sqrt"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.913389em;"><span class="svg-align" style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mord" style="padding-left:0.833em;"><span class="mord"><span class="mord mathdefault">n</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.740108em;"><span style="top:-2.9890000000000003em;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 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">n</span></span></span><span style="top:-2.873389em;"><span class="pstrut" style="height:3em;"></span><span class="hide-tail" style="min-width:0.853em;height:1.08em;"><svg width='400em' height='1.08em' viewBox='0 0 400000 1080' preserveAspectRatio='xMinYMin slice'><path d='M95,702c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,
-10,-9.5,-14c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54c44.2,-33.3,65.8,
-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10s173,378,173,378c0.7,0,
35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429c69,-144,104.5,-217.7,106.5,
-221c5.3,-9.3,12,-14,20,-14H400000v40H845.2724s-225.272,467,-225.272,467
s-235,486,-235,486c-2.7,4.7,-9,7,-19,7c-6,0,-10,-1,-12,-3s-194,-422,-194,-422
s-65,47,-65,47z M834 80H400000v40H845z'/></svg></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.12661100000000003em;"><span></span></span></span></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.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.93em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">&gt;</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="mop">ln</span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord">⁡</span><span class="mopen">(</span><span class="mord mathdefault">n</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">1</span><span class="mclose">)</span></span></span></span></span></p>
<ul>
<li>
<p>多个知识点的综合应用也是考察的一个方向。例如：<br>
<strong>2021年新高考II卷</strong> 21.一种微生物群体可以经过自身繁殖不断生存下来，设一个这种微生物为第0代，经过一次繁殖后为第1代，再经过一次繁殖后为第2代……，该微生物每代繁殖的个数是相互独立的且有相同的分布列，设X表示1个微生物个体繁殖下一代的个数，<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>P</mi><mo>(</mo><mi>X</mi><mo>=</mo><mi>i</mi><mo>)</mo><mo>=</mo><msub><mi>p</mi><mi>i</mi></msub><mo>(</mo><mi>i</mi><mo>=</mo><mn>0</mn><mo separator="true">,</mo><mn>1</mn><mo separator="true">,</mo><mn>2</mn><mo separator="true">,</mo><mn>3</mn><mo>)</mo></mrow><annotation encoding="application/x-tex">P(X=i)=p_i (i=0,1,2,3)</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 mathdefault" style="margin-right:0.13889em;">P</span><span class="mopen">(</span><span class="mord mathdefault" style="margin-right:0.07847em;">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">i</span><span class="mclose">)</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"><span class="mord mathdefault">p</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 class="mopen">(</span><span class="mord mathdefault">i</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">0</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord">1</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord">2</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord">3</span><span class="mclose">)</span></span></span></span>.<br>
（1）已知<span class="katex"><span class="katex-mathml"><math><semantics><mrow><msub><mi>p</mi><mn>0</mn></msub><mo>=</mo><mn>0.4</mn><mo separator="true">,</mo><msub><mi>p</mi><mn>1</mn></msub><mo>=</mo><mn>0.3</mn><mo separator="true">,</mo><msub><mi>p</mi><mn>2</mn></msub><mo>=</mo><mn>0.2</mn><mo separator="true">,</mo><msub><mi>p</mi><mn>3</mn></msub><mo>=</mo><mn>0.1</mn></mrow><annotation encoding="application/x-tex">p_0=0.4,p_1=0.3,p_2=0.2,p_3=0.1</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">p</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.30110799999999993em;"><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 mtight">0</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 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.8388800000000001em;vertical-align:-0.19444em;"></span><span class="mord">0</span><span class="mord">.</span><span class="mord">4</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord"><span class="mord mathdefault">p</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.30110799999999993em;"><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 mtight">1</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 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.8388800000000001em;vertical-align:-0.19444em;"></span><span class="mord">0</span><span class="mord">.</span><span class="mord">3</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord"><span class="mord mathdefault">p</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.30110799999999993em;"><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 mtight">2</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 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.8388800000000001em;vertical-align:-0.19444em;"></span><span class="mord">0</span><span class="mord">.</span><span class="mord">2</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.16666666666666666em;"></span><span class="mord"><span class="mord mathdefault">p</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.30110799999999993em;"><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 mtight">3</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 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 class="mord">.</span><span class="mord">1</span></span></span></span>，求<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>E</mi><mo>(</mo><mi>X</mi><mo>)</mo></mrow><annotation encoding="application/x-tex">E(X)</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 mathdefault" style="margin-right:0.05764em;">E</span><span class="mopen">(</span><span class="mord mathdefault" style="margin-right:0.07847em;">X</span><span class="mclose">)</span></span></span></span>；<br>
（2）设<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>p</mi></mrow><annotation encoding="application/x-tex">p</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">p</span></span></span></span>表示该种微生物经过多代繁殖后临近灭绝的概率，<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>p</mi></mrow><annotation encoding="application/x-tex">p</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">p</span></span></span></span>是关于<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>x</mi></mrow><annotation encoding="application/x-tex">x</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></span></span>的方程：<span class="katex"><span class="katex-mathml"><math><semantics><mrow><msub><mi>p</mi><mn>0</mn></msub><mo>+</mo><msub><mi>p</mi><mn>1</mn></msub><mi>x</mi><mo>+</mo><msub><mi>p</mi><mn>2</mn></msub><msup><mi>x</mi><mn>2</mn></msup><mo>+</mo><msub><mi>p</mi><mn>3</mn></msub><msup><mi>x</mi><mn>3</mn></msup><mo>=</mo><mi>x</mi></mrow><annotation encoding="application/x-tex">p_0+p_1 x+p_2 x^2+p_3 x^3=x</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7777700000000001em;vertical-align:-0.19444em;"></span><span class="mord"><span class="mord mathdefault">p</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.30110799999999993em;"><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 mtight">0</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 class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span></span><span class="base"><span class="strut" style="height:0.7777700000000001em;vertical-align:-0.19444em;"></span><span class="mord"><span class="mord mathdefault">p</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.30110799999999993em;"><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 mtight">1</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 class="mord mathdefault">x</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span></span><span class="base"><span class="strut" style="height:1.008548em;vertical-align:-0.19444em;"></span><span class="mord"><span class="mord mathdefault">p</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.30110799999999993em;"><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 mtight">2</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 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.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 class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span></span><span class="base"><span class="strut" style="height:1.008548em;vertical-align:-0.19444em;"></span><span class="mord"><span class="mord mathdefault">p</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.30110799999999993em;"><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 mtight">3</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 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.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">3</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.43056em;vertical-align:0em;"></span><span class="mord mathdefault">x</span></span></span></span> 的一个最小正实根，求证：当<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>E</mi><mo>(</mo><mi>X</mi><mo>)</mo><mo>≤</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">E(X)≤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 mathdefault" style="margin-right:0.05764em;">E</span><span class="mopen">(</span><span class="mord mathdefault" style="margin-right:0.07847em;">X</span><span class="mclose">)</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>p</mi><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">p=1</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">p</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>E</mi><mo>(</mo><mi>X</mi><mo>)</mo><mo>&gt;</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">E(X)&gt;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 mathdefault" style="margin-right:0.05764em;">E</span><span class="mopen">(</span><span class="mord mathdefault" style="margin-right:0.07847em;">X</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">&gt;</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>p</mi><mo>&lt;</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">p&lt; 1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.7335400000000001em;vertical-align:-0.19444em;"></span><span class="mord mathdefault">p</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">&lt;</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>；<br>
（3）根据你的理解说明（2）问结论的实际含义．</p>
</li>
<li>
<p><strong>我们应当鼓励创新题</strong>。只要题目的铺垫足够，应当支持鼓励略微超纲的知识点被编为试题。学习是永无止境的，大学教育教的不只是知识，还有获取知识的能力。如果出题人能在试卷上将树剖基本思路讲清楚，这题目一定比所谓的“大根堆是不是小根堆”之类的文字游戏和脑筋急转弯有意思也有意义多了。</p>
</li>
</ul>
<h2 id="总结">总结</h2>
<p>本文浅薄地讨论了一些考试与人才选拔制度方面的话题。具体来说，本文讨论了高中到大学升学选拔过程中不同制度的优缺点。高考作为“一考定终生”的制度，其成绩确实会有一些波动，也并不一定能准确的提取考生的能力，也的确很可能导致考生过分专注试题的研究而忘记了学习本身的美好。但是，高考还肩负着将数千万考生划分入合适的大学的职能。就目前的情况看，高考仍然是中国教育分选器的最优选择，其高效率和公平性是任何其他方法所不能替代的。当然，高考也在不断的改革升级，我们欣喜地看到，越来越多人性化的、客制化的、创新型的制度和题型正在涌现，高考制度正不断向好的方向发展。相信高考制度会越来越好，为国家发展充当更强劲的引擎。<br>
不过，对于高等教育，我们似乎更强调教授的科研能力，而忽视了其作为“教授”的“教授”功能。不过，让每一位教授都有教育经历并不是一件可行的事情，推动高等教育向更合理的方向发展，让硕博的选拔更科学还需要包括学生、教授以及行政人员的接续奋斗。<br>
另注：由于本人并没有教育学经历，为一些个人看法，如有不当之处，还请斧正。</p>
<p>[1] 黄全愈.(2004).中美教育比较——关于考试与考试制度.中国教师(02),17-20.<br>
[2] 侯玉文.(2013).考试制度的起源.甘肃教育(09),65.<br>
[3] 卢瑶,沈红 &amp; 张青根.(2023).绩点为王的思维代价：学习投入与本科生的学业表现和高阶思维能力.复旦教育论坛(04),78-86.doi:10.13397/j.cnki.fef.2023.04.016.</p>
]]></content>
    </entry>
    <entry>
        <title type="html"><![CDATA[小专题：机器学习性能度量，从一般到特殊]]></title>
        <id>https://LinyongGAN.github.io/post/ji-qi-xue-xi-xing-neng-du-liang/</id>
        <link href="https://LinyongGAN.github.io/post/ji-qi-xue-xi-xing-neng-du-liang/">
        </link>
        <updated>2024-08-31T12:39:44.000Z</updated>
        <content type="html"><![CDATA[<h1 id="通用性能评估">通用性能评估</h1>
<blockquote>
<p>以下内容仅对二分类有效</p>
</blockquote>
<h2 id="precision-recall-and-r">Precision, Recall and R</h2>
<p>对于任何机器学习所产出的结果，都可以列出下述<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mn>2</mn><mo>×</mo><mn>2</mn></mrow><annotation encoding="application/x-tex">2\times 2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.72777em;vertical-align:-0.08333em;"></span><span class="mord">2</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">×</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span></span><span class="base"><span class="strut" style="height:0.64444em;vertical-align:0em;"></span><span class="mord">2</span></span></span></span>列联表（分类结果的混淆矩阵）</p>
<table>
<thead>
<tr>
<th></th>
<th>预测为真</th>
<th>预测为假</th>
<th>总数</th>
</tr>
</thead>
<tbody>
<tr>
<td>事实为真</td>
<td>True Positive</td>
<td>False Negative</td>
<td>TP+FN</td>
</tr>
<tr>
<td>事实为假</td>
<td>False Positive</td>
<td>True Negative</td>
<td>FP+TN</td>
</tr>
<tr>
<td>总数</td>
<td>TP+FP</td>
<td>FN+TN</td>
<td>N=TP+FN+FP+TN</td>
</tr>
</tbody>
</table>
<p>查准率 (准确率) <span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>p</mi><mi>r</mi><mi>e</mi><mi>c</mi><mi>i</mi><mi>s</mi><mi>i</mi><mi>o</mi><mi>n</mi><mtext> </mtext><mi>P</mi><mo>=</mo><mi>P</mi><mo>(</mo><mi mathvariant="normal">事</mi><mi mathvariant="normal">实</mi><mi mathvariant="normal">为</mi><mi mathvariant="normal">真</mi><mi mathvariant="normal">∣</mi><mi mathvariant="normal">预</mi><mi mathvariant="normal">测</mi><mi mathvariant="normal">为</mi><mi mathvariant="normal">真</mi><mo>)</mo><mo>=</mo><mfrac><mrow><mi>T</mi><mi>P</mi></mrow><mrow><mi>T</mi><mi>P</mi><mo>+</mo><mi>F</mi><mi>P</mi></mrow></mfrac></mrow><annotation encoding="application/x-tex">precision\ P = P(事实为真|预测为真) =\frac{TP}{TP+FP}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8777699999999999em;vertical-align:-0.19444em;"></span><span class="mord mathdefault">p</span><span class="mord mathdefault" style="margin-right:0.02778em;">r</span><span class="mord mathdefault">e</span><span class="mord mathdefault">c</span><span class="mord mathdefault">i</span><span class="mord mathdefault">s</span><span class="mord mathdefault">i</span><span class="mord mathdefault">o</span><span class="mord mathdefault">n</span><span class="mspace"> </span><span class="mord mathdefault" style="margin-right:0.13889em;">P</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.13889em;">P</span><span class="mopen">(</span><span class="mord cjk_fallback">事</span><span class="mord cjk_fallback">实</span><span class="mord cjk_fallback">为</span><span class="mord cjk_fallback">真</span><span class="mord">∣</span><span class="mord cjk_fallback">预</span><span class="mord cjk_fallback">测</span><span class="mord cjk_fallback">为</span><span class="mord cjk_fallback">真</span><span class="mclose">)</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.275662em;vertical-align:-0.403331em;"></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.872331em;"><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 mathdefault mtight" style="margin-right:0.13889em;">T</span><span class="mord mathdefault mtight" style="margin-right:0.13889em;">P</span><span class="mbin mtight">+</span><span class="mord mathdefault mtight" style="margin-right:0.13889em;">F</span><span class="mord mathdefault mtight" style="margin-right:0.13889em;">P</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 mathdefault mtight" style="margin-right:0.13889em;">T</span><span class="mord mathdefault mtight" style="margin-right:0.13889em;">P</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.403331em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span></span></span></span><br>
在所有预测为真的样本中，有多少是事实为真的。P越高说明<strong>不错</strong></p>
<p>查全率 (召回率) <span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>r</mi><mi>e</mi><mi>c</mi><mi>a</mi><mi>l</mi><mi>l</mi><mtext> </mtext><mi>R</mi><mo>=</mo><mi>P</mi><mo>(</mo><mi mathvariant="normal">预</mi><mi mathvariant="normal">测</mi><mi mathvariant="normal">为</mi><mi mathvariant="normal">真</mi><mi mathvariant="normal">∣</mi><mi mathvariant="normal">事</mi><mi mathvariant="normal">实</mi><mi mathvariant="normal">为</mi><mi mathvariant="normal">真</mi><mo>)</mo><mfrac><mrow><mi>T</mi><mi>P</mi></mrow><mrow><mi>T</mi><mi>P</mi><mo>+</mo><mi>F</mi><mi>N</mi></mrow></mfrac></mrow><annotation encoding="application/x-tex">recall \ R = P(预测为真|事实为真) \frac{TP}{TP+FN}</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" style="margin-right:0.02778em;">r</span><span class="mord mathdefault">e</span><span class="mord mathdefault">c</span><span class="mord mathdefault">a</span><span class="mord mathdefault" style="margin-right:0.01968em;">l</span><span class="mord mathdefault" style="margin-right:0.01968em;">l</span><span class="mspace"> </span><span class="mord mathdefault" style="margin-right:0.00773em;">R</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.275662em;vertical-align:-0.403331em;"></span><span class="mord mathdefault" style="margin-right:0.13889em;">P</span><span class="mopen">(</span><span class="mord cjk_fallback">预</span><span class="mord cjk_fallback">测</span><span class="mord cjk_fallback">为</span><span class="mord cjk_fallback">真</span><span class="mord">∣</span><span class="mord cjk_fallback">事</span><span class="mord cjk_fallback">实</span><span class="mord cjk_fallback">为</span><span class="mord cjk_fallback">真</span><span class="mclose">)</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.872331em;"><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 mathdefault mtight" style="margin-right:0.13889em;">T</span><span class="mord mathdefault mtight" style="margin-right:0.13889em;">P</span><span class="mbin mtight">+</span><span class="mord mathdefault mtight" style="margin-right:0.13889em;">F</span><span class="mord mathdefault mtight" style="margin-right:0.10903em;">N</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 mathdefault mtight" style="margin-right:0.13889em;">T</span><span class="mord mathdefault mtight" style="margin-right:0.13889em;">P</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.403331em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span></span></span></span><br>
在所有事实为真的样本中，有多少被预测为真。R越高说明<strong>不漏</strong></p>
<h3 id="绘制p-r图像">绘制P-R图像</h3>
<p>我们通常通过得分（置信度）来判断分类。因此对得分排序，高者为“预测为真”，低者为“预测为假”。<br>
排序时，升序降序均可，但前后需保持一致。<br>
每个样本进入统计，得到列联表，计算P和R，从而画出P-R图像。</p>
<h3 id="平衡点-break-even-point-bep">平衡点 Break-Even Point, BEP</h3>
<p>显然的，<strong>不错</strong>和<strong>不漏</strong>相互制衡，即通常为<strong>负相关</strong>。当<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>P</mi><mo>=</mo><mi>R</mi></mrow><annotation encoding="application/x-tex">P=R</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.13889em;">P</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.68333em;vertical-align:0em;"></span><span class="mord mathdefault" style="margin-right:0.00773em;">R</span></span></span></span>时为最naive的最优解。</p>
<h3 id="f_beta-度量"><span class="katex"><span class="katex-mathml"><math><semantics><mrow><msub><mi>F</mi><mi>β</mi></msub></mrow><annotation encoding="application/x-tex">F_{\beta}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.969438em;vertical-align:-0.286108em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.13889em;">F</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-left:-0.13889em;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.05278em;">β</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> 度量</h3>
<p class='katex-block'><span class="katex-display"><span class="katex"><span class="katex-mathml"><math><semantics><mrow><msub><mi>F</mi><mi>β</mi></msub><mo>=</mo><mfrac><mrow><mo>(</mo><mn>1</mn><mo>+</mo><msup><mi>β</mi><mn>2</mn></msup><mo>)</mo><mo>×</mo><mi>P</mi><mo>×</mo><mi>R</mi></mrow><mrow><mo>(</mo><msup><mi>β</mi><mn>2</mn></msup><mo>×</mo><mi>P</mi><mo>)</mo><mo>+</mo><mi>R</mi></mrow></mfrac></mrow><annotation encoding="application/x-tex">F_{\beta} = \frac{(1+\beta^2)\times P\times R}{(\beta^2\times P)+R}
</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.969438em;vertical-align:-0.286108em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.13889em;">F</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-left:-0.13889em;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.05278em;">β</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.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.427108em;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.491108em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mopen">(</span><span class="mord"><span class="mord mathdefault" style="margin-right:0.05278em;">β</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.740108em;"><span style="top:-2.9890000000000003em;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 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.13889em;">P</span><span class="mclose">)</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.00773em;">R</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="mopen">(</span><span class="mord">1</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="mord mathdefault" style="margin-right:0.05278em;">β</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 class="mclose">)</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.13889em;">P</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.00773em;">R</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>特别的，</p>
<p class='katex-block'><span class="katex-display"><span class="katex"><span class="katex-mathml"><math><semantics><mrow><msub><mi>F</mi><mn>1</mn></msub><mo>=</mo><mfrac><mrow><mn>2</mn><mo>×</mo><mi>P</mi><mo>×</mo><mi>R</mi></mrow><mrow><mi>P</mi><mo>+</mo><mi>R</mi></mrow></mfrac><mo>=</mo><mfrac><mrow><mn>2</mn><mo>×</mo><mi>T</mi><mi>P</mi></mrow><mrow><mi>N</mi><mo>+</mo><mi>T</mi><mi>P</mi><mo>−</mo><mi>T</mi><mi>N</mi></mrow></mfrac></mrow><annotation encoding="application/x-tex">F_1=\frac{2\times P\times R}{P+R} = \frac{2\times TP}{N+TP-TN}
</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.83333em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.13889em;">F</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.30110799999999993em;"><span style="top:-2.5500000000000003em;margin-left:-0.13889em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</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 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.1296600000000003em;vertical-align:-0.7693300000000001em;"></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.36033em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.13889em;">P</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.00773em;">R</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">2</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.13889em;">P</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.00773em;">R</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.7693300000000001em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></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.1296600000000003em;vertical-align:-0.7693300000000001em;"></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.36033em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.10903em;">N</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.13889em;">T</span><span class="mord mathdefault" style="margin-right:0.13889em;">P</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.13889em;">T</span><span class="mord mathdefault" style="margin-right:0.10903em;">N</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">2</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.13889em;">T</span><span class="mord mathdefault" style="margin-right:0.13889em;">P</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.7693300000000001em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span></span></span></span></span></p>
<p>其中 <span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>β</mi><mo>(</mo><mo>&gt;</mo><mn>0</mn><mo>)</mo></mrow><annotation encoding="application/x-tex">\beta(&gt;0)</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 mathdefault" style="margin-right:0.05278em;">β</span><span class="mopen">(</span><span class="mrel">&gt;</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">0</span><span class="mclose">)</span></span></span></span> 度量了R与P的相对重要性。以1为界， <span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>β</mi></mrow><annotation encoding="application/x-tex">\beta</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.05278em;">β</span></span></span></span> 越大查全率 <span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>R</mi></mrow><annotation encoding="application/x-tex">R</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.00773em;">R</span></span></span></span> 影响越大，反之查准率 <span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>P</mi></mrow><annotation encoding="application/x-tex">P</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.13889em;">P</span></span></span></span> 影响越大</p>
<p>特别的，</p>
<p class='katex-block'><span class="katex-display"><span class="katex"><span class="katex-mathml"><math><semantics><mrow><mfrac><mn>1</mn><msub><mi>F</mi><mn>1</mn></msub></mfrac><mo>=</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><mo>(</mo><mfrac><mn>1</mn><mi>P</mi></mfrac><mo>+</mo><mfrac><mn>1</mn><mi>R</mi></mfrac><mo>)</mo><mtext> </mtext><mi mathvariant="normal">调</mi><mi mathvariant="normal">和</mi><mi mathvariant="normal">平</mi><mi mathvariant="normal">均</mi></mrow><annotation encoding="application/x-tex">\frac{1}{F_1} = \frac{1}{2}(\frac{1}{P}+\frac{1}{R})\ 调和平均
</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:2.1574400000000002em;vertical-align:-0.8360000000000001em;"></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.3139999999999996em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord"><span class="mord mathdefault" style="margin-right:0.13889em;">F</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.30110799999999993em;"><span style="top:-2.5500000000000003em;margin-left:-0.13889em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">1</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 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.8360000000000001em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></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.00744em;vertical-align:-0.686em;"></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">2</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.686em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mopen">(</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 mathdefault" style="margin-right:0.13889em;">P</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.686em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></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><span class="base"><span class="strut" style="height:2.00744em;vertical-align:-0.686em;"></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 mathdefault" style="margin-right:0.00773em;">R</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.686em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mclose">)</span><span class="mspace"> </span><span class="mord cjk_fallback">调</span><span class="mord cjk_fallback">和</span><span class="mord cjk_fallback">平</span><span class="mord cjk_fallback">均</span></span></span></span></span></p>
<p class='katex-block'><span class="katex-display"><span class="katex"><span class="katex-mathml"><math><semantics><mrow><mfrac><mn>1</mn><msub><mi>F</mi><mi>β</mi></msub></mfrac><mo>=</mo><mfrac><mn>1</mn><mrow><mn>1</mn><mo>+</mo><msup><mi>β</mi><mn>2</mn></msup></mrow></mfrac><mo>(</mo><mfrac><mn>1</mn><mi>P</mi></mfrac><mo>+</mo><mfrac><msup><mi>β</mi><mn>2</mn></msup><mi>R</mi></mfrac><mo>)</mo><mtext> </mtext><mi mathvariant="normal">加</mi><mi mathvariant="normal">权</mi><mi mathvariant="normal">调</mi><mi mathvariant="normal">和</mi><mi mathvariant="normal">平</mi><mi mathvariant="normal">均</mi></mrow><annotation encoding="application/x-tex">\frac{1}{F_{\beta}} = \frac{1}{1+\beta^2}(\frac{1}{P}+\frac{\beta^2}{R})\ 加权调和平均
</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:2.293548em;vertical-align:-0.972108em;"></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 class="mord mathdefault" style="margin-right:0.13889em;">F</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-left:-0.13889em;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.05278em;">β</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:-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.972108em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></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.20188em;vertical-align:-0.8804400000000001em;"></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">1</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="mord mathdefault" style="margin-right:0.05278em;">β</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.740108em;"><span style="top:-2.9890000000000003em;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 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.8804400000000001em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mopen">(</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 mathdefault" style="margin-right:0.13889em;">P</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.686em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></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><span class="base"><span class="strut" style="height:2.177108em;vertical-align:-0.686em;"></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.491108em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.00773em;">R</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"><span class="mord mathdefault" style="margin-right:0.05278em;">β</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><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.686em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mclose">)</span><span class="mspace"> </span><span class="mord cjk_fallback">加</span><span class="mord cjk_fallback">权</span><span class="mord cjk_fallback">调</span><span class="mord cjk_fallback">和</span><span class="mord cjk_fallback">平</span><span class="mord cjk_fallback">均</span></span></span></span></span></p>
<p><span class="katex"><span class="katex-mathml"><math><semantics><mrow><msub><mi>F</mi><mi>β</mi></msub><mo>∈</mo><mo>[</mo><mn>0</mn><mo separator="true">,</mo><mn>1</mn><mo>]</mo></mrow><annotation encoding="application/x-tex">F_{\beta}\in [0, 1]</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.969438em;vertical-align:-0.286108em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.13889em;">F</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-left:-0.13889em;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.05278em;">β</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.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="mopen">[</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="mclose">]</span></span></span></span>, 且越接近1表示两者平衡情况越好，学习的性能越好。</p>
<h2 id="roc与auc">ROC与AUC</h2>
<p>受试者工作特征 Receiver Operating Characteristic, ROC<br>
真正例率 True Positive Rate <span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>T</mi><mi>P</mi><mi>R</mi><mo>=</mo><mfrac><mrow><mi>T</mi><mi>P</mi></mrow><mrow><mi>T</mi><mi>P</mi><mo>+</mo><mi>F</mi><mi>N</mi></mrow></mfrac><mo>≈</mo><mi>p</mi><mo>(</mo><mover accent="true"><mi>y</mi><mo>^</mo></mover><mo>=</mo><mn>1</mn><mi mathvariant="normal">∣</mi><mi>y</mi><mo>=</mo><mn>1</mn><mo>)</mo></mrow><annotation encoding="application/x-tex">TPR = \frac{TP}{TP+FN} \approx p(\hat y = 1| y=1)</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.13889em;">T</span><span class="mord mathdefault" style="margin-right:0.13889em;">P</span><span class="mord mathdefault" style="margin-right:0.00773em;">R</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.275662em;vertical-align:-0.403331em;"></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.872331em;"><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 mathdefault mtight" style="margin-right:0.13889em;">T</span><span class="mord mathdefault mtight" style="margin-right:0.13889em;">P</span><span class="mbin mtight">+</span><span class="mord mathdefault mtight" style="margin-right:0.13889em;">F</span><span class="mord mathdefault mtight" style="margin-right:0.10903em;">N</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 mathdefault mtight" style="margin-right:0.13889em;">T</span><span class="mord mathdefault mtight" style="margin-right:0.13889em;">P</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.403331em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></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:1em;vertical-align:-0.25em;"></span><span class="mord mathdefault">p</span><span class="mopen">(</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 mathdefault" style="margin-right:0.03588em;">y</span></span><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="accent-body" style="left:-0.19444em;">^</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="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">1</span><span class="mord">∣</span><span class="mord mathdefault" style="margin-right:0.03588em;">y</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">1</span><span class="mclose">)</span></span></span></span><br>
假正例率 False Positive Rate <span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>F</mi><mi>P</mi><mi>R</mi><mo>=</mo><mfrac><mrow><mi>F</mi><mi>P</mi></mrow><mrow><mi>F</mi><mi>P</mi><mo>+</mo><mi>T</mi><mi>N</mi></mrow></mfrac><mo>≈</mo><mi>p</mi><mo>(</mo><mover accent="true"><mi>y</mi><mo>^</mo></mover><mo>=</mo><mn>1</mn><mi mathvariant="normal">∣</mi><mi>y</mi><mo>=</mo><mn>0</mn><mo>)</mo></mrow><annotation encoding="application/x-tex">FPR = \frac{FP}{FP+TN} \approx p(\hat y = 1| y = 0)</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.13889em;">F</span><span class="mord mathdefault" style="margin-right:0.13889em;">P</span><span class="mord mathdefault" style="margin-right:0.00773em;">R</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.275662em;vertical-align:-0.403331em;"></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.872331em;"><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 mathdefault mtight" style="margin-right:0.13889em;">F</span><span class="mord mathdefault mtight" style="margin-right:0.13889em;">P</span><span class="mbin mtight">+</span><span class="mord mathdefault mtight" style="margin-right:0.13889em;">T</span><span class="mord mathdefault mtight" style="margin-right:0.10903em;">N</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 mathdefault mtight" style="margin-right:0.13889em;">F</span><span class="mord mathdefault mtight" style="margin-right:0.13889em;">P</span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.403331em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></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:1em;vertical-align:-0.25em;"></span><span class="mord mathdefault">p</span><span class="mopen">(</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 mathdefault" style="margin-right:0.03588em;">y</span></span><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="accent-body" style="left:-0.19444em;">^</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="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">1</span><span class="mord">∣</span><span class="mord mathdefault" style="margin-right:0.03588em;">y</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">0</span><span class="mclose">)</span></span></span></span><br>
ROC是以其分别为纵横坐标而成的图像</p>
<figure data-type="image" tabindex="1"><img src="https://LinyongGAN.github.io/post-images/1725119264747.png" alt="ROC" loading="lazy"></figure>
<p>Area Under ROC Curve, AUC: 下部的面积。若拟和效果非常出众，TPR=1, FPR=0，面积应为1，因此AUC越大拟和效果越好。</p>
<p>特别的，给定<span class="katex"><span class="katex-mathml"><math><semantics><mrow><msup><mi>m</mi><mo>+</mo></msup></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.771331em;vertical-align:0em;"></span><span class="mord"><span class="mord mathdefault">m</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>m</mi><mo>−</mo></msup></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.771331em;vertical-align:0em;"></span><span class="mord"><span class="mord mathdefault">m</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>D</mi><mo>+</mo></msup></mrow><annotation encoding="application/x-tex">D^+</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.02778em;">D</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>D</mi><mo>−</mo></msup></mrow><annotation encoding="application/x-tex">D^-</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.02778em;">D</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><msub><mi>l</mi><mrow><mi>r</mi><mi>a</mi><mi>n</mi><mi>k</mi></mrow></msub></mrow><annotation encoding="application/x-tex">l_{rank}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.84444em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.01968em;">l</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.33610799999999996em;"><span style="top:-2.5500000000000003em;margin-left:-0.01968em;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.02778em;">r</span><span class="mord mathdefault mtight">a</span><span class="mord mathdefault mtight">n</span><span class="mord mathdefault mtight" style="margin-right:0.03148em;">k</span></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 class='katex-block'><span class="katex-display"><span class="katex"><span class="katex-mathml"><math><semantics><mrow><msub><mi>l</mi><mrow><mi>r</mi><mi>a</mi><mi>n</mi><mi>k</mi></mrow></msub><mo>=</mo><mfrac><mn>1</mn><mrow><msup><mi>m</mi><mo>+</mo></msup><msup><mi>m</mi><mo>−</mo></msup></mrow></mfrac><msub><mi mathvariant="normal">Σ</mi><mrow><msup><mi>x</mi><mo>+</mo></msup><mo>∈</mo><msup><mi>D</mi><mo>+</mo></msup></mrow></msub><msub><mi mathvariant="normal">Σ</mi><mrow><msup><mi>x</mi><mo>−</mo></msup><mo>∈</mo><msup><mi>D</mi><mo>−</mo></msup></mrow></msub><mo>(</mo><mi>I</mi><mo>(</mo><mi>f</mi><mo>(</mo><msup><mi>x</mi><mo>+</mo></msup><mo>)</mo><mo>&lt;</mo><mi>f</mi><mo>(</mo><msup><mi>x</mi><mo>−</mo></msup><mo>)</mo><mo>)</mo><mo>+</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><mi>I</mi><mo>(</mo><mi>f</mi><mo>(</mo><msup><mi>x</mi><mo>+</mo></msup><mo>)</mo><mo>=</mo><mo>=</mo><mi>f</mi><mo>(</mo><msup><mi>x</mi><mo>−</mo></msup><mo>)</mo><mo>)</mo><mo>)</mo></mrow><annotation encoding="application/x-tex">l_{rank} = \frac{1}{m^+m^-}\Sigma_{x^+\in D^+}\Sigma_{x^-\in D^-}(I(f(x^+)&lt;f(x^-))+\frac{1}{2}I(f(x^+)==f(x^-)))
</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.84444em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.01968em;">l</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.33610799999999996em;"><span style="top:-2.5500000000000003em;margin-left:-0.01968em;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.02778em;">r</span><span class="mord mathdefault mtight">a</span><span class="mord mathdefault mtight">n</span><span class="mord mathdefault mtight" style="margin-right:0.03148em;">k</span></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 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.00744em;vertical-align:-0.686em;"></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 class="mord mathdefault">m</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.697331em;"><span style="top:-2.989em;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 class="mord"><span class="mord mathdefault">m</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.697331em;"><span style="top:-2.989em;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 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.686em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mord"><span class="mord">Σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.341865em;"><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 mtight"><span class="mord mtight"><span class="mord mathdefault mtight">x</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.7026642857142857em;"><span style="top:-2.786em;margin-right:0.07142857142857144em;"><span class="pstrut" style="height:2.5em;"></span><span class="sizing reset-size3 size1 mtight"><span class="mbin mtight">+</span></span></span></span></span></span></span></span><span class="mrel mtight">∈</span><span class="mord mtight"><span class="mord mathdefault mtight" style="margin-right:0.02778em;">D</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.7026642857142857em;"><span style="top:-2.786em;margin-right:0.07142857142857144em;"><span class="pstrut" style="height:2.5em;"></span><span class="sizing reset-size3 size1 mtight"><span class="mbin mtight">+</span></span></span></span></span></span></span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.17737em;"><span></span></span></span></span></span></span><span class="mord"><span class="mord">Σ</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.341865em;"><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 mtight"><span class="mord mtight"><span class="mord mathdefault mtight">x</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.7026642857142857em;"><span style="top:-2.786em;margin-right:0.07142857142857144em;"><span class="pstrut" style="height:2.5em;"></span><span class="sizing reset-size3 size1 mtight"><span class="mbin mtight">−</span></span></span></span></span></span></span></span><span class="mrel mtight">∈</span><span class="mord mtight"><span class="mord mathdefault mtight" style="margin-right:0.02778em;">D</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.7026642857142857em;"><span style="top:-2.786em;margin-right:0.07142857142857144em;"><span class="pstrut" style="height:2.5em;"></span><span class="sizing reset-size3 size1 mtight"><span class="mbin mtight">−</span></span></span></span></span></span></span></span></span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.17737em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord mathdefault" style="margin-right:0.07847em;">I</span><span class="mopen">(</span><span class="mord mathdefault" style="margin-right:0.10764em;">f</span><span class="mopen">(</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.821331em;"><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="mbin mtight">+</span></span></span></span></span></span></span></span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">&lt;</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:1.071331em;vertical-align:-0.25em;"></span><span class="mord mathdefault" style="margin-right:0.10764em;">f</span><span class="mopen">(</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.821331em;"><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="mbin mtight">−</span></span></span></span></span></span></span></span><span class="mclose">)</span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span></span><span class="base"><span class="strut" style="height:2.00744em;vertical-align:-0.686em;"></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">2</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.686em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span><span class="mord mathdefault" style="margin-right:0.07847em;">I</span><span class="mopen">(</span><span class="mord mathdefault" style="margin-right:0.10764em;">f</span><span class="mopen">(</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.821331em;"><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="mbin mtight">+</span></span></span></span></span></span></span></span><span class="mclose">)</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span></span><span class="base"><span class="strut" style="height:0.36687em;vertical-align:0em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:1.071331em;vertical-align:-0.25em;"></span><span class="mord mathdefault" style="margin-right:0.10764em;">f</span><span class="mopen">(</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.821331em;"><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="mbin mtight">−</span></span></span></span></span></span></span></span><span class="mclose">)</span><span class="mclose">)</span><span class="mclose">)</span></span></span></span></span></p>
<p class='katex-block'><span class="katex-display"><span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>A</mi><mi>U</mi><mi>C</mi><mo>=</mo><mn>1</mn><mo>−</mo><msub><mi>l</mi><mrow><mi>r</mi><mi>a</mi><mi>n</mi><mi>k</mi></mrow></msub></mrow><annotation encoding="application/x-tex">AUC = 1-l_{rank}
</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">A</span><span class="mord mathdefault" style="margin-right:0.10903em;">U</span><span class="mord mathdefault" style="margin-right:0.07153em;">C</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.72777em;vertical-align:-0.08333em;"></span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span></span><span class="base"><span class="strut" style="height:0.84444em;vertical-align:-0.15em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.01968em;">l</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.33610799999999996em;"><span style="top:-2.5500000000000003em;margin-left:-0.01968em;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.02778em;">r</span><span class="mord mathdefault mtight">a</span><span class="mord mathdefault mtight">n</span><span class="mord mathdefault mtight" style="margin-right:0.03148em;">k</span></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></p>
<h2 id="far-frr-eer">FAR, FRR, EER</h2>
<p>False Acceptance Rate假接收率，没病当有病</p>
<p class='katex-block'><span class="katex-display"><span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>F</mi><mi>A</mi><mi>R</mi><mo>=</mo><mfrac><mrow><mi>F</mi><mi>P</mi></mrow><mrow><mi>F</mi><mi>P</mi><mo>+</mo><mi>T</mi><mi>N</mi></mrow></mfrac><mo>=</mo><mi>F</mi><mi>P</mi><mi>R</mi></mrow><annotation encoding="application/x-tex">FAR = \frac{FP}{FP+TN} = FPR
</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.13889em;">F</span><span class="mord mathdefault">A</span><span class="mord mathdefault" style="margin-right:0.00773em;">R</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.1296600000000003em;vertical-align:-0.7693300000000001em;"></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.36033em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.13889em;">F</span><span class="mord mathdefault" style="margin-right:0.13889em;">P</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.13889em;">T</span><span class="mord mathdefault" style="margin-right:0.10903em;">N</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.13889em;">F</span><span class="mord mathdefault" style="margin-right:0.13889em;">P</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.7693300000000001em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></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.68333em;vertical-align:0em;"></span><span class="mord mathdefault" style="margin-right:0.13889em;">F</span><span class="mord mathdefault" style="margin-right:0.13889em;">P</span><span class="mord mathdefault" style="margin-right:0.00773em;">R</span></span></span></span></span></p>
<p>False Rejected Rate假拒绝率，有病当没病</p>
<p class='katex-block'><span class="katex-display"><span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>F</mi><mi>R</mi><mi>R</mi><mo>=</mo><mfrac><mrow><mi>F</mi><mi>N</mi></mrow><mrow><mi>T</mi><mi>P</mi><mo>+</mo><mi>F</mi><mi>N</mi></mrow></mfrac><mo>=</mo><mn>1</mn><mo>−</mo><mi>T</mi><mi>P</mi><mi>R</mi></mrow><annotation encoding="application/x-tex">FRR = \frac{FN}{TP+FN} = 1- TPR
</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.13889em;">F</span><span class="mord mathdefault" style="margin-right:0.00773em;">R</span><span class="mord mathdefault" style="margin-right:0.00773em;">R</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.1296600000000003em;vertical-align:-0.7693300000000001em;"></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.36033em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathdefault" style="margin-right:0.13889em;">T</span><span class="mord mathdefault" style="margin-right:0.13889em;">P</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.13889em;">F</span><span class="mord mathdefault" style="margin-right:0.10903em;">N</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.13889em;">F</span><span class="mord mathdefault" style="margin-right:0.10903em;">N</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.7693300000000001em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></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.72777em;vertical-align:-0.08333em;"></span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span></span><span class="base"><span class="strut" style="height:0.68333em;vertical-align:0em;"></span><span class="mord mathdefault" style="margin-right:0.13889em;">T</span><span class="mord mathdefault" style="margin-right:0.13889em;">P</span><span class="mord mathdefault" style="margin-right:0.00773em;">R</span></span></span></span></span></p>
<p><img src="https://LinyongGAN.github.io/post-images/1725173329593.png" alt="far/fpr-threshold" loading="lazy"><br>
（这张图的标注有误，FAR=FPR，应该是FAR和FRR，且FAR是橙色的）<br>
对分类问题来说，两个率都应当是越小越好，从而EER越小越好；但是对攻击类来说，越大说明攻击的越成功，相应的EER也是越大越好。<br>
横坐标为threshold，是一组0-1之间的等差数列，作为识别模型的判别界限。图中两条图线的交点对应的横坐标即为EER。EER并没有实际意义，但是EER越低表示模型效果越好。在工程上，我们一般将EER与系统判别的threshold划等号，但对于threshold不是0-1的情况，也可能将threshold映射回到EER上。<br>
<img src="https://LinyongGAN.github.io/post-images/1725175219761.png" alt="ROC and EER" loading="lazy"><br>
从另一个角度看，FAR-FRR交点等价于求解<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>F</mi><mi>R</mi><mi>R</mi><mo>=</mo><mn>1</mn><mo>−</mo><mi>T</mi><mi>P</mi><mi>R</mi></mrow><annotation encoding="application/x-tex">FRR = 1-TPR</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.13889em;">F</span><span class="mord mathdefault" style="margin-right:0.00773em;">R</span><span class="mord mathdefault" style="margin-right:0.00773em;">R</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.72777em;vertical-align:-0.08333em;"></span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span></span><span class="base"><span class="strut" style="height:0.68333em;vertical-align:0em;"></span><span class="mord mathdefault" style="margin-right:0.13889em;">T</span><span class="mord mathdefault" style="margin-right:0.13889em;">P</span><span class="mord mathdefault" style="margin-right:0.00773em;">R</span></span></span></span>，换而言之，这是ROC曲线与<span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>F</mi><mi>R</mi><mi>R</mi><mo>=</mo><mn>1</mn><mo>−</mo><mi>T</mi><mi>P</mi><mi>R</mi></mrow><annotation encoding="application/x-tex">FRR = 1-TPR</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.13889em;">F</span><span class="mord mathdefault" style="margin-right:0.00773em;">R</span><span class="mord mathdefault" style="margin-right:0.00773em;">R</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.72777em;vertical-align:-0.08333em;"></span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222222222222222em;"></span></span><span class="base"><span class="strut" style="height:0.68333em;vertical-align:0em;"></span><span class="mord mathdefault" style="margin-right:0.13889em;">T</span><span class="mord mathdefault" style="margin-right:0.13889em;">P</span><span class="mord mathdefault" style="margin-right:0.00773em;">R</span></span></span></span>的交点。</p>
<p>红线A与蓝线B分别表示了两个不同分类器的TPR-FPR曲线（即ROC曲线）。曲线上任意一点都对应了一个threshold <span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>θ</mi></mrow><annotation encoding="application/x-tex">\theta</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" style="margin-right:0.02778em;">θ</span></span></span></span>。该曲线具有如下特征：</p>
<ul>
<li>一定经过 (1, 1)，此时 FN=TN=0，全部“预测为真”，此时 <span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>θ</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\theta = 0</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" style="margin-right:0.02778em;">θ</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></li>
<li>一定经过 (0, 0)，此时 TP=FP=0，没有“预测为真”的样本，此时 <span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>θ</mi><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">\theta = 1</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" style="margin-right:0.02778em;">θ</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></li>
<li>最完美的分类器（完全区分正负样本）：(0, 1)点，即TPR=1, FPR=0，全部判断正确</li>
<li>曲线越向左上角凸起，分类效果越好，对应越小的 <span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>θ</mi></mrow><annotation encoding="application/x-tex">\theta</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" style="margin-right:0.02778em;">θ</span></span></span></span></li>
</ul>
<h3 id="code-implementation">Code Implementation</h3>
<pre><code class="language-python">def compute_det_curve(target_scores, nontarget_scores): #Detection Error Tradeoff
    '''
    Parameters:
    target_scores: y hat = 1
    nontarget_scores: y hat = 0
    '''

    n_scores = target_scores.size + nontarget_scores.size
    all_scores = np.concatenate((target_scores, nontarget_scores))
    labels = np.concatenate((np.ones(target_scores.size), np.zeros(nontarget_scores.size)))

    # Sort labels based on scores
    indices = np.argsort(all_scores, kind='mergesort')
    labels = labels[indices]

    # Compute false rejection and false acceptance rates
    tar_trial_sums = np.cumsum(labels)
    nontarget_trial_sums = nontarget_scores.size - (np.arange(1, n_scores + 1) - tar_trial_sums)

    # false rejection rates
    frr = np.concatenate((np.atleast_1d(0), tar_trial_sums / target_scores.size)) # 在最前面加一个0，FRR的初始值为0
    far = np.concatenate((np.atleast_1d(1), nontarget_trial_sums / nontarget_scores.size))  # false acceptance rates
    # Thresholds are the sorted scores
    thresholds = np.concatenate((np.atleast_1d(all_scores[indices[0]] - 0.001), all_scores[indices])) # 加入一个理想中的score，其他是对应的threshold
    # 这里的threshold (EER) 就是判断过程中的score，也就是二分类的threshold
    # threshold并不是直接意义上的横坐标，也是通过转换和对应关系得到的。
    # 虽然我觉得这里增加一项并不会影响结果

    return frr, far, thresholds


def compute_eer(target_scores, nontarget_scores):
    &quot;&quot;&quot; Returns equal error rate (EER) and the corresponding threshold. &quot;&quot;&quot;
    frr, far, thresholds = compute_det_curve(target_scores, nontarget_scores)
    abs_diffs = np.abs(frr - far)
    min_index = np.argmin(abs_diffs)
    eer = np.mean((frr[min_index], far[min_index]))
    return eer, thresholds[min_index]
</code></pre>
<p>It's the code copied from <a href="https://github.com/clovaai/aasist">AASIST</a></p>
<h1 id="references">References</h1>
<p>https://blog.csdn.net/qq_18888869/article/details/84848689<br>
https://blog.csdn.net/qq_18888869/article/details/84942224<br>
https://www.cnblogs.com/xfzhang/p/4788227.html<br>
https://blog.csdn.net/qq_37977007/article/details/135736055</p>
]]></content>
    </entry>
    <entry>
        <title type="html"><![CDATA[About]]></title>
        <id>https://LinyongGAN.github.io/post/about/</id>
        <link href="https://LinyongGAN.github.io/post/about/">
        </link>
        <updated>2024-07-01T13:04:18.000Z</updated>
        <content type="html"><![CDATA[<h2 id="who-i-am">👨‍💻 Who I am</h2>
<p>Nice to meet you! I'm Linyong GAN, a to-be-sophomore Bachelor student at CUHK-SZ.🤝</p>
<p>I'm recently interested in Deep Learning and Sound waves, especially in Deepfake Detection. But in fact, I'm just a junior in this field.</p>
<h2 id="about-this-platform">🏠 About this platform</h2>
<p>It's a platform to post my thoughts and show what's been on recently.</p>
<p>Since the WeChat Public Platform (Subscription Account) is not friendly for markdown users and only accepts .docx files, I'll post all my thoughts here and share them with my WeChat Account. Also, as this blog is based on github, you can also find the original file on github.</p>
<p>On this platform, I'll use both English and Chinese since I have to push myself to indulge in the English atmosphere to get familiar with my career better.</p>
<p>On this platform, I'll show my comments about current affairs, some thoughts to the world, and a particular column for audio-related paper reading.</p>
<h2 id="contact-me">💻Contact Me</h2>
<p>If you have any ideas or suggestions, please contact me via email: tuxiaobai7789@126.com or Comment below.</p>
]]></content>
    </entry>
</feed>