- Machine Learning with Swift
- Alexander Sosnovshchenko
- 414字
- 2021-06-24 18:55:04
Cold start problem
A very common situation is when a machine learning system starts functioning in a new environment, where no information to pre-train is available. The situation is known as a cold start. Such a system requires a certain amount of time to collect enough training data, and start producing meaningful predictions. The problem often arises in the context of personalization and recommender systems.
One solution for this it is so-called active learning, where the system can actively seek new data that could improve its performance. Usually, this means that the system queries a user to label some data. For instance, the user can be asked to provide some labeled examples before the start of the system, or the system can ping him when it stumbles upon especially hard cases asking to label them manually. Active learning is a special case of semi-supervised learning.
The second component of active learning is estimating which samples are the most useful by associating weights to them. In the case of KNN, these can be the samples that the model is less confident about, for example, the samples for whom their neighbors' classes are divided almost equally or the samples that are far from all others (outliers).
However, some researchers point out that active learning is built on flawed assumptions: the user is always available and willing to answer questions and he is always right in his/her answers. This is also something worth keeping in mind when building an active learning solution.
I guess when the Twitter app pings you at 4 AM with push notifications like Take a look at this and 13 other Highlights, it just wants to update its small personalized binary classifier of interesting/not interesting content using active learning.

In the classification phase, we feed unlabeled chunks of the same size into the classifier and get predictions which display to the user. We use DTW as a distance measure with locality constraint 3. In my experiments, k as 1 gave the best results but you can experiment with other number of neighbors. I will show here only the machine learning part, without the data collection part and user interface.
Creating the classifier:
classifier = kNN(k: 1, distanceMetric: DTW.distance(w: 3))
Training the classifier:
self.classifier.train(X: [magnitude(series3D: series)], y: [motionType])
The magnitude() function converts three-dimensional series into one-dimensional by calculating vector magnitude to simplify the computations.
Making the predictions:
let motionType = self.classifier.predict(x: magnitude(series3D: series))
- 深入理解Spring Cloud與實戰
- 電腦常見問題與故障排除
- Linux運維之道(第2版)
- Unity 5.x Game Development Blueprints
- 筆記本電腦維修不是事兒(第2版)
- 固態存儲:原理、架構與數據安全
- 筆記本電腦維修300問
- 無蘋果不生活:OS X Mountain Lion 隨身寶典
- 單片機原理及應用:基于C51+Proteus仿真
- Wireframing Essentials
- FL Studio Cookbook
- Intel FPGA權威設計指南:基于Quartus Prime Pro 19集成開發環境
- Angular 6 by Example
- Zabbix 4 Network Monitoring
- The Machine Learning Workshop