Kagi 的宗教戰爭:Emacs 與 Vi

目前都是用 Kagi 當作預設的搜尋引擎,然後 Kagi 習慣每個禮拜會給一個 Changelog... 而這個禮拜的 Changelog 是這樣:

我好像看到了什麼不得了的東西:

Searching for emacs redirects to vi #327 @yjp20

然後 bug report 裡面提到了他會在搜尋 Emacs 時提示 Vi

然後搜尋 Vi 時提示 Emacs:

這是想要掀起什麼宗教戰爭嗎 XDDD

PostgreSQL 上可以列出建議增加 index 的 extension

Twitter 上看到 Percona 家老大貼他們自家 2019 年的舊文章:「Automatic Index Recommendations in PostgreSQL using pg_qualstats and hypopg」。

先說一下,因為要另外裝 extension,目前 Amazon RDS 上面是沒辦法用的,但自己管理的 PostgreSQL 就可以考慮看看。

看了一下文章裡面介紹的兩個 extension,一個是 HypoPG,另外一個是 pg_qualstats,看起來組合技可以提供不少有用的建議。

目前只有針對 B-tree index 提供建議,但這應該已經相當足夠了,大多數的場景下應該都是用 B-tree:

With this experiment, we see that we can use hypopg and pg_qualstats to automate index recommendations. The automation logic is currently limited to B-Tree Indexes only.

另外看 Percona 的 PostgreSQL 文章都會習慣翻了一下作者的背景 (之前被雷過),看起來作者 Avinash Vallarapu 在今年年初已經離開 Percona,成立自己的公司 MigOps 提供 PostgreSQL 相關的服務了...

AWS 的推薦演算法服務:Amazon Personalize

AWS 把推薦演算法包成服務拿來來賣,叫做 Amazon Personalize:「Amazon Personalize – Real-Time Personalization and Recommendation for Everyone」。

把後面的演算法隱藏起來,只要給使用者的評價資料就可以了,像是文章裡的範例:

userId,movieId,rating,timestamp
1,2,3.5,1112486027
1,29,3.5,1112484676
1,32,3.5,1112484819
1,47,3.5,1112484727
1,50,3.5,1112484580

可以看出來這個使用者對 2,29,32,47,50 這些 movieId 在不同的時間點都給了 3.5 分的評分。

然後經過一連串的 API 操作 (有些參數可以調整,但主要是叫 AWS 運算,並且建立 real-time 的服務),就可以看到推薦哪些其他的 item 了:

$ aws personalize-rec get-recommendations --campaign-arn $CAMPAIGN_ARN --user-id $USER_ID --query "itemList[*].itemId"
["1210", "260", "2571", "110", "296", "1193", ...]

而從 Pricing 的頁面可以看到支援 real-time data 與 batch data:

DATA INGESTION
You are charged per GB of data uploaded to Amazon Personalize. This includes real-time data streamed to Amazon Personalize and batch data uploaded via Amazon S3.

這其實是很多網站都很需要的功能...

Facebook 推薦好友機制的演算法讓更多的隱私問題浮現...

在「Facebook recommended that this psychiatrist’s patients friend each other」這邊報導了 Facebook 推薦好友機制的演算法意外的拉出了奇怪的東西:

[...], such as this story from Lisa*, a psychiatrist who is an infrequent Facebook user, mostly signing in to RSVP for events. Last summer, she noticed that the social network had started recommending her patients as friends—and she had no idea why.

“I haven’t shared my email or phone contacts with Facebook,” she told me over the phone.

精神科醫師被 Facebook 推薦他的病人... 而更慘的是病人也收到的推薦包括了其他的病人:

Another one of her female patients had a friend recommendation pop up for a fellow patient she recognized from the office’s elevator. Suddenly, she knew the other patient’s full name along with all their Facebook profile information.

“It’s a massive privacy fail,” said Lisa. “I have patients with HIV, people that have attempted suicide and women in coercive and violent relationships.”

而且因為職業的關係,他也對此很小心防範:

Lisa lives in a relatively small town and was alarmed that Facebook was inadvertently outing people with health and psychiatric issues to her network. She’s a tech-savvy person, familiar with VPNs, Tor and computer security practices recommended by the Electronic Frontier Foundation–but she had no idea what was causing it.

這聽起來不是什麼好演算法 :o

Zite 消失後的方案:Nuzzel

在去年十二月七日 Zite 被幹掉後,本來是流竄到 Prismatic 上,結果十二月二十日也關掉了... 之後就找不到能用的推薦引擎了。

用推薦引擎的目的是希望看到更多不同種類的內容:用 Feedly 看 RSS feed,而用 Twitter 追蹤短則的想法,或是用 Facebook 看同溫層的想法。但這些都是「已知」的來源所提供的資訊,沒有辦法發覺其他的文章。

其中一個變通的方法是找像 Hacker News Daily 這樣的 RSS feed 來讀,作者用程式每天算出 Hacker News 上的十大熱門文摘出來,對一般人應該也夠用,但我還是想要找到更多資訊。

Zite 與 Prismatic 是以 Recommendation System 來計算並且推薦,是個還不錯的方法。不過這兩個 app 都已經不在了...

Nuzzel 走了另外一個方向,你可以用 Twitter 與 Facebook 帳號連結,然後提供「朋友」以及「朋友的朋友」發表了什麼連結,依照時間或是數量排序出來:

相較於推薦系統,這樣的演算法雖然簡單很多,但解決了想要看更多資訊的問題。

不過還是覺得有些 app 上的操作怪怪的,但也沒辦法 (?),先用用看吧...

Machine Learning 的課程 (2013 年一月開課,已經完結)

在「推薦系統的課程...」這篇推薦了 2013 秋天的課程,不過整理舊文章的時候發現有另外一門講 Machine Learning 的課程已經結束 (不僅僅是 Recommendation System)。

CMU 的課程:「Introduction to Machine Learning」,課程都有 PDF slide 與錄影可以看。

相較於推薦系統,機器學習的課程比較篇理論,而且也比較廣泛,而推薦系統比較偏應用。