Kitty Bear (fake name) is a teddy bear store. Their management team currently faces a challenging problem. They purchase products only base on their boss’s experience, and it is not accurate. Unsophisticated purchasing plans caused them some troubles as following.
They only import teddy bears from overseas. After ordering, it will take 2 to 3 months to ship teddy bears to their stores. Thus, an ill-advised purchasing plan might cause a loss of revenue. For example, from January 2019 to May 2019, they did not have enough teddy bears to sell. …
In our last article, we talked about the basic quick-find and quick union algorithm. However, we know that the quick-union algorithm could spend quadratic time in the worst case(a very tall tree). Therefore, today we introduce an improved quick-union algorithm.
Check the following article if you have not checked the basic quick-find and quick-union
The weighted tree’s basic idea is that it always puts the smaller tree (the tree with fewer nodes) under the larger tree (the tree with more nodes).
In basic quick-union, when we link two different size trees, we might link the larger tree under the smaller…
Union-find is a logic and a data type to effectively find whether two points are connected. The basic idea is that we put all the connected nodes in the same group. When we want to check if some nodes are connected, we can quickly check whether they belong to the same group.
暑期有三堂課程, 總共9學分，分別是Digital Marketing, STT Modeling for Bus Analytics，以及實習各三學分。實習方面之後會在特別有一篇拿出來討論. 課表雖然有排到8月底開學前，但實際上課只有兩個禮拜，剩餘時間都是實習以及做一些小組報告。
這堂課是一堂很典型的商學院個案討論課程，基本上就是給個案、討論個案、以及寫報告。 唯一不同的是老師比較希望看到數據面的解釋和solution。另外這堂課需要自費購買個案，並不貴但老師一開始上課沒有溝通清楚, 我一開始以為可以跟同學共用, 結果後來發現是必買. 導致其中一項作業被扣了1/3的分數, 雖 …
In the last article, we introduced the basic logic of breadth-first search.
Finding the shortest between two nodes is one of the most popular common questions for BFS.
First, we need to understand that in this article, we only consider unweighted paths. For example, we don’t consider the length of roads or how tough to walk on this path. We simply consider the lowest vertices we need to go through from A point to B point. We will introduce more algorithms for weighted paths in the future.
Same as our last article, we are going to use the following website…
Using Web scarping to practice
We introduced depth first search before.
However, there are some disadvantages for DFS. One drawback is that the basic DFS cannot effectively find the shortest path between vertices.
Here is one funny example if someone applies DFS on a date.
You can see instead of getting ready for the date, he kept digging into every chain of thought and ended up being half-naked and unprepared.
Now, we will introduce another searching algorithm that can traversal and effectively find the shortest path between two nodes.
Unlike DFS, the breadth-first search will visit all the neighbors first…
Teachers consistently tell us that multicollinearity is “bad” for our model, and we need to get rid of it.
Let’s use the following model to demonstrate.
Imagine when we interpret coefficient, we will say such as
However, in reality, since the year of experience and age usually are highly correlated, it hard to increase the age without increase the year of experience.
2. Inflates the standard error of the coefficient
The formula of the standard…