Background

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.

  1. Inventory shortage


Quick-Union Improvement

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

First improvement: weighted tree

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…


The Basic Introduction of Quick-Find and Quick-Union

Picture by Becca Tapert

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.


這邊是接續上一篇春季學期就讀心得,下面附上連結

現在帶大家來回顧一下剛結束的暑期課程

picture from Debby Hudson

課程

暑期有三堂課程, 總共9學分,分別是Digital Marketing, STT Modeling for Bus Analytics,以及實習各三學分。實習方面之後會在特別有一篇拿出來討論. 課表雖然有排到8月底開學前,但實際上課只有兩個禮拜,剩餘時間都是實習以及做一些小組報告。

Digital Marketing

這堂課是一堂很典型的商學院個案討論課程,基本上就是給個案、討論個案、以及寫報告。 唯一不同的是老師比較希望看到數據面的解釋和solution。另外這堂課需要自費購買個案,並不貴但老師一開始上課沒有溝通清楚, 我一開始以為可以跟同學共用, 結果後來發現是必買. 導致其中一項作業被扣了1/3的分數, 雖 …


前陣子和朋友聊到台灣水庫即時水情,大家也很好奇裡面的效果是怎麼做的,所以就以此為靈感來聊聊有哪些方式可以製造出波浪的感覺。

原理

主要是兩部分,移動的波浪形狀圖遮擋容器,下面先介紹容器的概念。我們需要一個“把超出的部分不顯示”的容器。可以看到左側是超出部分也顯示的狀態,右側是超出部分不顯示。

另一個可以達到一樣效果的屬性是clip-path,是從svg來的,現在css也可以直接設定。概念上跟overflow一樣但玩法就更多種了,連你要裁切掉的樣子都可以設定,台灣水庫即時 …


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.

picture by Eldar Nazarov

Assumption

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.

Implementation

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.

source: https://xkcd.com/761/

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.

Breadth First Search

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.

But why?

  1. Hard to interpret

Imagine when we interpret coefficient, we will say such as

  • When comparing salary with the year of experience remains the same; whenever the age increases 1, the predicted salary increases.

2. Inflates the standard error of the coefficient

The formula of the standard…

Ray Hsu

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store