B4 is a good step for chess, not for me.

Linux_Notes

搜索 wt 打开 windows terminal 默认打开的是 powershell (类似 cmd 的东西) 不用管

PS > __ #your command here PS > wsl # WSL for Windows Subsystem for Linux 虚拟机

所有操作都是在终端内进行的

cd change directory 改变当前目录(文件夹)

  • cd my_folder
  • cd # 不带任何参数,回到用户目录 ~ $HOME
  • pwd - print working directory 将当前的目录输出到终端
  • touch - 创建新文件
  • - flag --
  • ls - list files ** -A / --almost-all - use this to see hidden files - 前面带点的文件 .bashrc 被隐藏的文件 ** -a / --all ** -l 输出为一个 table
  • mkdir - make directory

directory 目录,实际上就是文件夹

  • rm - remove ** -r recursive 递归删除 - 删除该文件和他的子文件
  • rmdir - remove directory - useless
  • explorer.exe 用微软文件管理器打开 只在 wsl 里可用
  • 大部分命令都实现了 -h 这个 flag,或 --help 使用这个flag查看命令说明
  • man manual 查看某个命令的手册

** man mkdir

  • nano 文本编辑器 ** 在终端中 ^ 代表 CTRL
  • sudo - super user do ** 如果要求你使用 root (根用户),操作需要 elevated (提升权限),permission denied

黑马的教程用的是 CentOS,他安装软件使用 yum 或者 rpm,我是用的是 Ubuntu,安装软件使用 apt

apt search 搜索软件包

apt install 安装软件包

如果你太久没更新 apt,里面的包太老了,所以就没法安装某些新软件

apt update 是更新 apt

apt upgrade 更新你用 apt 安装的软件


启动 MySQL

  • systemctl start mysql

  • systemctl system control

  • mysqld MySQL Daemon

  • start / restart / stop

    sudo mysql -u root -p

Edinburgh_Travel_Guide

Explore Edinburgh: A Timeless Journey through Scotland’s Capital 🏰

✨ In-Depth Highlights of Edinburgh

  • Edinburgh Castle
    Edinburgh Castle
    Perched atop Castle Rock, this iconic fortress houses the Crown Jewels of Scotland and the Stone of Destiny. Explore its medieval Great Hall and the poignant National War Museum, while soaking in sweeping views of the city.

  • Royal Mile
    Royal Mile
    A vibrant artery connecting the castle to Holyrood Palace, this mile-long stretch buzzes with street performers, traditional tartan shops, and hidden closes (alleys) revealing tales of Edinburgh’s medieval past. Don’t miss the Writers’ Museum, celebrating literary legends like Robert Burns.

  • Arthur’s Seat
    Arthur’s Seat
    An extinct volcano in Holyrood Park, this rugged hike rewards adventurers with 360° vistas of Edinburgh’s skyline, the Firth of Forth, and lush countryside. Geologists adore its ancient rock formations dating back 350 million years.

  • Holyrood Palace
    Holyrood Palace
    Wander through the opulent State Apartments where Mary, Queen of Scots once lived, and explore the haunting ruins of the 12th-century abbey adjacent to the palace. The palace gardens bloom with Scottish flora in summer.

  • Edinburgh Fringe Festival
    Fringe Festival
    The world’s largest arts festival transforms the city every August, with over 3,000 shows spanning comedy, theatre, and avant-garde performances. Streets pulse with creativity, making it a cultural pilgrim’s paradise. 🎭

💡 Travel Tips

  • Best Time: May-September for mild weather and festivals.
  • Transport: Walkable city center; use buses for longer distances.
  • Must-Try: Haggis (with whisky sauce!), shortbread, and local craft beers.

欢迎大家来爱丁堡这个愚蠢的地方陪我坐牢

Acknowledgement

鸣谢

感谢Jason哥哥 援助的脚本和自动部署,之前本博客的自动部署失效了。

滴水之恩当涌泉相报。

感谢Jason哥哥

即日起重新开始更新本博客。

Reading notes related to text mining

reading notes– Further learning in statistics and data science

I read the book ‘Opinion Mining and Sentiment Analysis’ by Pang and Lee and thus made notes related to statistics and data science.

Text mining

Text mining (also known as text analysis), is the process of transforming unstructured text into structured data for easy analysis. Text mining uses natural language processing (NLP), allowing machines to understand the human language and process it automatically.

Normalisation

Text normalization is the process of transforming text into a single canonical form that it might not have had before.

Stemming and lemmatisation are two approaches for text normalisation.

1.Lemmatization is a text normalization technique used in Natural Language Processing (NLP), that switches any kind of a word to its base root mode. Lemmatization is responsible for grouping different inflected forms of words into the root form, having the same meaning.

Lemma: the basic form of a word, for example the singular form of a noun or the infinitive form of a verb, as it is shown at the beginning of a dictionary entry

2.In linguistic morphology and information retrieval, stemming is the process of reducing inflected (or sometimes derived) words to their word stem, base or root form—generally a written word form.

notes in Chinese

最常见的词汇规范化的实践有:

  1. 词干提取(Stemming):词干提取是一个初级的、基于规则的脱去后缀(如“ing”,“ly”,“es”,“s”等等)的过程

  2. 词元化(Lemmatization):另一方面,词元化,是一个组织好的、一步一步的获取词根的过程。

  3. 词汇规范化: 另外一种文本型的噪音与一个词语的多种表达形式有关。例如,“play”,“player”,“played”,“plays”和“playing”都是单词“play”的变种。尽管它们有不同的意思,但是根据上下文来看,它们是意思是相似的。这个步骤是将一个单词的所有不同形式转换为它的规范形式(也被称为词条(lemma))

Opinion mining

Opinion mining, or sentiment analysis, is a text analysis technique that uses computational linguistics and natural language processing to automatically identify and extract sentiment or opinion from within text (positive, negative, neutral, etc.)

In my words, opinion mining is just one part in text mining; text mining involves classical text mining and opinion mining;The former one analyses text which are expressed factually whereas the latter one analyses text which are expressed subjectively.

Sentiment analysis, also referred to as opinion mining, is an approach to natural language processing (NLP) that identifies the emotional tone behind a body of text. This is a popular way for organizations to determine and categorize opinions about a product, service, or idea. It involves the use of data mining, machine learning (ML) and artificial intelligence (AI) to mine text for sentiment and subjective information.

Emotional tone refers to positive, negative or neutral attitudes.

Subjectivity polarity score

The polarity score is a float within the range [-1.0, 1.0] . The subjectivity is a float within the range [0.0, 1.0] where 0.0 is very objective and 1.0 is very subjective.

In short, text polarity is a measure of how negative or how positive a piece of text is.
Most of the time, NLP models can predict simply positive or negative words and phrases quite well. For example, the words “amazing”, “superb”, and “wonderful” can easily be labelled as highly positive. The words “bad”, “sad”, and “mad” can easily be labelled as negative. However, we can’t just look at polarity from the frame of individual words, it’s important to take a larger context for evaluating total polarity. For example, the word “bad” may be negative but what about the phrase “not bad”? Is that neutral? Or is that the opposite of bad? At this point we’re getting into linguistics and semantics rather than natural language processing.

The two biggest open source libraries for NLP in Python are spaCy and NLTK, and both of these libraries measure polarity on a normalized scale of -1 to 1. The Text API measures, combines, and normalizes values on both the polarity of the overall text, individual sentences, and individual phrases.

Example https://www.ebaina.com/articles/140000005269
notes in Chinese

极性(polarity)指的是一陈述是肯定还是否定的性质,如果某个词只能出现在肯定或者否定的陈述中,那么这个词就是极性项(polarity item)。在英语中at all是一个否定极性项,它只能出现在否定句中。

Opinion holders and opinion targets

One of the key subtasks in sentiment analysis is opinion role extraction. It can be divided into the extraction of opinion holders (OH), i.e. entities ex-pressing an opinion, and the extraction of opinion targets (OT), i.e. entities or propositions at which sentiment is directed.

Reading notes related to Naive Bayes classifiers and Markov Chain

reading notes- Further learning in statistics and data science

I read the book ‘Reinforcement Learning’ by S. Sutton and thus made reading notes about markov chain and also I learned knowledge about Bayes classifiers.

Classifier

“An algorithm that implements classification, especially in a concrete implementation, is known as a classifier. The term “classifier” sometimes also refers to the mathematical function, implemented by a classification algorithm, that maps input data to a category.”

Bayes classifier

Classifiers based on Bayes’ Theorem.

Bayes’ Theorem

3.png

1.png

2.png

Naive Bayes classifier

Classifiers based on Bayes’ Theorem with an assumption of independence among predictors.

####What are the Pros and Cons of Naive Bayes?

Pros:

  1. It is easy and fast to predict class of test data set. It also perform well in multi class prediction

  2. When assumption of independence holds, a Naive Bayes classifier performs better compare to other models like logistic regression and you need less training data.

  3. It perform well in case of categorical input variables compared to numerical variable(s). For numerical variable, normal distribution is assumed (bell curve, which is a strong assumption).

Cons:

  1. If categorical variable has a category (in test data set), which was not observed in training data set, then model will assign a 0 (zero) probability and will be unable to make a prediction. This is often known as “Zero Frequency”. To solve this, we can use the smoothing technique. One of the simplest smoothing techniques is called Laplace estimation.

https://www.zhihu.com/question/21134457 (useful linkage to Naive Bayes classifiers)

Markov chain and laplace smoothing

It is a pretty tough section so i only made notes in Chinese to help me understand this section better.

1.jpg

这个矩阵就是转移概率矩阵P,并且它是保持不变的,就是说第一天到第二天的转移概率矩阵跟第二天到第三天的转移概率矩阵是一样的。

2.jpg

One application

For example, consider a hypothetical market with Markov properties where historical data has given us the following patterns: After a week characterized by a bull market trend there is a 90% chance that another bullish week will follow. Additionally, there is a 7.5% chance that the bull week instead will be followed by a bearish one, or a 2.5% chance that it will be a stagnant one. After a bearish week there’s an 80% chance that the upcoming week also will be bearish, and so on. This data is compiled to form a matrix and then the results are drawn thereof.

拉普拉斯平滑(Laplace Smoothing)又被称为加 1 平滑,是比较常用的平滑方法。平滑方法的存在时为了解决零概率问题。

背景:为什么要做平滑处理?

零概率问题,就是在计算实例的概率时,如果某个量x,在观察样本库(训练集)中没有出现过,会导致整个实例的概率结果是0。在文本分类的问题中,当一个词语没有在训练样本中出现,该词语调概率为0,使用连乘计算文本出现概率时也为0。这是不合理的,不能因为一个事件没有观察到就武断的认为该事件的概率是0。

拉普拉斯的理论支撑

为了解决零概率的问题,法国数学家拉普拉斯最早提出用加1的方法估计没有出现过的现象的概率,所以加法平滑也叫做拉普拉斯平滑。
假定训练样本很大时,每个分量x的计数加1造成的估计概率变化可以忽略不计,但可以方便有效的避免零概率问题。

Reading notes--Principles of Economics (chapter19)

Summary

Chapter 19 is Earnings and Discrimination. This chapter introduces different kinds of discrimination. (e.g Why doctors earn more wages than workers)

Labour market discrimination– education

  • A well-educated worker tends to have a greater wage because of human capital and signaling effect.

  • Human capital effect: The well-educated labours have a greater productivity so they have greater wage rates.

  • Signaling effect: The access of university does not increase the productivity of labours but it is a signal that labours have the greater ability to master skills so they have greater wage rates/

Labour market discrimination– job

  • e.g A superstar always earns a greater wage than a carpenter or a plumber.

  • reason 1: Every customer in the market wants to enjoy the good supplied by the best producer.

  • reason 2: The good is produced with a technology that makes it possible for the best producer to supply every customer at low cost.

Discrimination by employers

  • Wage differential will be eliminated by it in markets with free entry and exit.

  • Reason: If employers discriminate one sort of employees, the demand for it will decrease so the wage rate of it decreases in the labour market. Then some employers will recruit them since the cost of these labours decreases.

Definitions

1.Compensating differential– a difference in wages that arises to offset the nonmonetary characteristics of different jobs

2.Strike– the organized withdrawal of labor from a firm by a union

3.Discrimination– the offering of different opportunities to similar individuals who differ only by race, ethnic group, sex, age, or other personal characteristics

4.Human capital– the knowledge and skills that workers acquire through education and on-the-job training

5.Efficiency wage– above equilibrium wages paid by firms to increase worker productivity

6.Statistical discrimination– discrimination that arises because an irrelevant but observable personal characteristic is correlated with a relevant but unobservable attribute

7.Union– a worker association that bargains with employers over wages and working conditions

Review

There are some exercises in this book. I recorded questions I didn’t answer correctly here.

  1. Among full-time U.S. workers, white women earn about_____ percent less than white men, and black men earn about_____ percent less than white men. (Correct answer: C)

a. 5;20

b. 5;40

c. 20;20

d. 20;40

My wrong answer: A

  1. The forces of competition in markets with free entry and exit tend to eliminate wage differentials that arise from discrimination by_____ (Correct answer: A)

a. employers

b. customers

c. government

d. all of the above

My wrong answer: D

An academic subject inspires me

Introduction

One of the academic subjects that has boosted my further interest is Economics. This short essay will demonstrate my journey of learning it.

Background

I could only start studying Economics in Grade 10, because it was not available on the curriculum before then. (Economics is a subject which can only be studied by international students because it is not a compulsory subject for Chinese national education system.)

Experience of learning Economics

Despite my relatively poor English, I still understood the main points from my English Economics teacher quickly perhaps I worked hard in it. Learning about supply and demand in commerce caught my interest quickly in Economics and I found it fascinating and wanted to learn more in this field, for instance, how a market works. I became aware of the need to improve my English language skills when I did not understand some specific vocabulary such as vice versa, ceteris paribus and capita. From then on, I read English books to improve my lexical resources. For example, the book Principles of Economics which illustrates some fundamentals in Economics. From this book, I was surprised to find there is a strong relationship between Mathematics and Economics, for instance, you could use calculus(integration)to calculate total welfare in one market. This opened up a whole new world to me because I did well in Mathematics which helped me study this field in more depth. I finished all exercises in each chapter and made reading notes to summarize the main points.

Experience of taking part in FBLA

Because of my outstanding performance in the final exam of the semester, my teacher suggested that I take part in a business contest which was called The Future Business Leader of America (FBLA). The preparation was intense but I learnt a great deal of new information which the school syllabus had not provided. Then I cooperated with two partners to do a presentation focused on a business plan about attracting investment from investors and received excellent scores. I strengthened not only my economic knowledge but also speaking skills during the preparation of the presentation.

Conclusion

In conclusion, I have been capable and motivated to learn more about Economics and I hope to focus more on this interesting subject in the future and perhaps study it at university level.

My greatest skill

Introduction

My greatest skill is my ability to use study skills to enhance my understanding of school subjects. These involve the study skills of doing efficient research online, managing time wisely and cooperate with others to solve problems if necessary. This short essay will illustrate how I have been developing and strengthening these study skills.

Background

My home is far away from the school and therefore I live in the school dormitory during weekdays so my parents cannot accompany me as well as give me help. The majority of students in our class tend to have extra-curricular classes to improve their learning in order to get excellent exam scores. For me, I consider self-study to be more advantageous so I do it instead of having those extra curricular-classes.

My study experiences

In the textbooks I use, it is necessary to answer questions in order to check if I have mastered knowledge precisely. However, these questions are limited so I then use the internet to find appropriate exercises. Doing past papers is a good choice, but the majority of them only cover one unit. So, I collaborate with another student to classify questions that cover chapters we have already learned and organize them in an online file. In addition, I pay for an annual subscription of a website called Save My Exams which provides appropriate questions. This website is useful because it addresses individual topics in detail rather than more generally therefore it is more in-depth and improves my learning.

The skill i need to develop

I am keen to avoid procrastination which is the enemy to these study skills especially in terms of time management. I did not master Physics knowledge due to this lack of organizing my time well in revising physics, I did badly in the monthly exam which was disappointing due to the lack of review which occurred owing to my poor ability to execute my plan of reviewing science subjects.

Conclusion

Overall, because of my experience living in the school dormitory, I have been strengthening my self-study skills which will be beneficial for me when I attend university.

Reading notes--Principles of Economics (chapter18)

Summary

Chapter 18 is The Markets for the Factors of Production. This chapter introduces the market for labour, land and capital.

The versatility of supply and demand

The market for labour

  • The market for labour
  • The price of labours is the wage rate.
  • The market price and quantity of labours are determined by the demand and supply of labours.

The market for land

  • The market for land

The market for capital

  • The market for capital

The market for land and the market for capital are the same as the market for labour

Production function

acb46cbeb5a72834ca8c4e331aadecc.jpg

  • Production function is the relationship between the quantity of inputs used to make a good and the quantity of output of that good.

The value of the marginal product of labour

image.png

  • Value of the marginal product is the marginal product of an input times the price of the output
  • It decreases as the quantity of labour increases (because of the diminishing marginal product)
  • Diminishing marginal product is the property whereby the marginal product of an input declines as the quantity of the input increases
  • The market wage is equal to the value of marginal product

Definitions

1.Factors of production– the inputs used to produce goods and services

2.Production function– the relationship between the quantity of inputs used to make a good and the quantity of output of that good

3.Marginal product of labour– the increase in the amount of output from an additional unit of labor

4.Diminishing marginal product– the property whereby the marginal product of an input declines as the quantity of the input increases

5.Value of the marginal product– the marginal product of an input times the price of the output

6.Capital– the equipment and structures used to produce goods and services

Review

There are some exercises in this book. I recorded questions I didn’t answer correctly here.

  1. Approximately what percentage of U.S. national income is paid to workers rather than to owners of capital and land? (Correct answer: C)

a. 25 percent

b. 45 percent

c. 65 percent

d. 85 percent

My wrong answer: B

  1. Around 1973. the U.S. economy experienced a significant_____ in productivity growth, coupled with a_____ in the growth of real wages. (Correct answer: D)

a. pickup; pickup

b. pickup; slowdown

c. slowdown; pickup

d. slowdown; slowdown

My wrong answer: D

  • Copyrights © 2021-2025 Alan
  • Visitors: | Views:

请我喝杯咖啡吧~

支付宝
微信