主页

【Golang】Golang Map并发编程

Golang Map并发读写 直接并发读写 如果直接对map进行并发读写,那么会造成Panic或者error,如下所示: package main func main() { m := make(map[int]int) go func() { for { read := m[0] // sync read } }() go func() { for { m[0] = 1 // sync write } }() } 上面程序有问题 传统加锁读写 package main func main() { m := make(map[int]int) mc := sync.Mutex ...

阅读更多

【AI】Item2Vec详解

item2vec Usage: item2vec learns item similarity. Motivation Item2item relations are important because different than the traditional user2item relations, it shows a more explicit user intent of purchasing. Therefore it has a higher click-through rate. Solution Skip Gram Skip-gram is used to predict context words given a target word. For...

阅读更多

【AI】WMAPE详解

WMAPE Advantage: The advantage of this metric over MAPE is that this overcomes the ‘infinite error’ issue. Key word: Evaluation Usage: A measure of prediction accuracy of a forecasting method. WMAPE: weighted mean absolute percentage error’ A measure of prediction accuracy of a forecasting method. \[\begin{equation} WMAPE = \frac{\sum^n_{t=1...

阅读更多

【Golang】Golang语言基础(面经)

Basic Knowledge 声明 短变量声明只能在函数内部使用 package main // myvar := 1 // false var myvar = 1 // right func main() { } 不能使用nil初始化未指定类型的变量 var x = nil // false var x interface{} = nil // right _ = x 字符串没有nil var x string if x == nil { // err } if x == "" { x = "default" } Slice & Array 首先Slice和Array是有区别的,Slice是指针,而Array已经预...

阅读更多

【AI】ESMM CVR预测详解

ESMM Advantage: Combine two nn together with by a dot product finally. Key word: DNN Usage: Predict CVR and CTR Predicting post-click conversion rate is the problem they try to solve. Why the Problem Is Difficult Current method has two problems, one is illustrated as the following. Sample selection bias problem means that the traini...

阅读更多