By Noor Malik
努爾·馬利克(Noor Malik)
Let’s say you write a query in Deephaven which performs a lengthy and expensive analysis, resulting in a live table. For example, in a previous project, I wrote a query which pulled data from an RSS feed to create a live table of earnings call transcripts, and an expensive Sentiment Analysis machine learning model was used to predict overall sentiments.
假設您在Deephaven中編寫了一個查詢,該查詢執行了冗長且昂貴的分析,從而產生了活動表。 例如,在上一個項目中 ,我編寫了一個查詢,該查詢從RSS提要中提取數據以創建實時收入通話記錄表,并使用了昂貴的Sentiment Analysis機器學習模型來預測總體情緒。
After performing the analysis, you want to use the resulting live table in several other queries. For example, I wanted to use my live table of sentiment predictions in another query which verified whether the sentiment predictions matched the direction of the companies’ stocks. Luckily, Deephaven provides the ability to share tables between queries with Preemptive Tables.
執行分析之后,您想在其他幾個查詢中使用生成的活動表。 例如,我想在另一個查詢中使用我的情緒預測實時表,該查詢驗證了情緒預測是否與公司股票的方向一致。 幸運的是,Deephaven提供了使用搶先表在查詢之間共享表的功能。
With Preemptive Tables, the query processor automatically pushes a consistent snapshot of all data from a table on the server to subscribed clients at regular intervals. The publisher specifies the refresh rate of the Preemptive Table, the frequency at which the table is sent over the network to subscribers, and client queries set a timeout threshold, the maximum amount of time to wait for a connection to the publisher query to be established before the connection times out.
使用搶占式表,查詢處理器會自動將所有數據的一致快照從服務器上的表定期推送到訂閱的客戶端。 發布者指定搶占表的刷新率,該表通過網絡發送給訂戶的頻率以及客戶端查詢設置超時閾值,等待與發布者查詢建立連接的最大時間在連接超時之前。
Any table on the Deephaven server can easily be published as a Preemptive table. In my “EarningsCallSentimentAnalysis” query, I produced a table called callPredictions that I wanted to share as a Preemptive Table with a 2-minute refresh rate. I did so as follows:
Deephaven服務器上的任何表都可以輕松地發布為搶先表。 在我的“ EarningsCallSentimentAnalysis”查詢中,我生成了一個名為callPredictions的表,我希望將其共享為2分鐘刷新率的搶占式表。 我這樣做如下:
callPredictionsPre = callPredictions.preemptiveUpdatesTable(2*60*1000)
My other query, which needed to use my callPredictions table, created a client connection with a timeout threshold of 3 minutes and subscribed to the table as follows:
我的另一個查詢(需要使用我的callPredictions表)創建了一個超時閾值為3分鐘的客戶端連接,并按以下方式訂閱了該表:
With Preemptive Tables, I was able to use the Sym column of the callPredictions table to look up past and present stock prices and join the directions of movement onto callPredictions in a column called Direction. I then created a boolean column called CorrectPrediction, which would show true if a company’s predicted earnings call sentiment matched their stock direction, and false otherwise.
借助Preemptive Tables,我可以使用callPredictions表的Sym列查詢過去和現在的股價,并將移動方向加入到Direction列中的callPredictions上。 然后,我創建了一個名為CorrectPrediction的布爾列,如果公司的預期收益電話情緒與他們的股票方向匹配,它將顯示true,否則顯示false。
Note that companies without values in the Direction and CorrectPrediction columns did not have stock data available.
請注意,“方向”和“正確預測”列中沒有值的公司沒有可用的庫存數據。

This simple and easy-to-use method of table sharing helped me add another dimension to my Earnings Call Sentiment Analysis project, and allowed me to take my analyses further without having to perform the same lengthy computations again to re-use them for another purpose.
這種簡單易用的表格共享方法幫助我在“收入呼吁情緒分析”項目中添加了新的維度,使我可以進一步進行分析,而不必再次執行相同的冗長計算即可將其重新用于其他目的。
翻譯自: https://medium.com/swlh/get-the-most-out-of-expensive-analyses-fa95f0193d18
本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。 如若轉載,請注明出處:http://www.pswp.cn/news/389532.shtml 繁體地址,請注明出處:http://hk.pswp.cn/news/389532.shtml 英文地址,請注明出處:http://en.pswp.cn/news/389532.shtml
如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!