可以将复数用作scikit learning中的目标标签吗? [英] Is it possible to use complex numbers as target labels in scikit learn?

查看:116
本文介绍了可以将复数用作scikit learning中的目标标签吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用sklearn来预测表示旋转的变量.由于不幸在旋转的极端情况下从-pi跳到pi,因此我认为更好的方法是使用复数作为目标.这样一来,从1 + 0.01j到1-0.01j的错误就没有那么严重了.

I am trying to use sklearn to predict a variable that represents rotation. Because of the unfortunate jump from -pi to pi at the extremes of rotation, I think a much better method would be to use a complex number as the target. That way an error from 1+0.01j to 1-0.01j is not as devastating.

我找不到任何描述sklearn是否支持复数作为分类器目标的文档.从理论上讲,距离度量应该可以正常工作,因此它至少应适用于某些回归算法.

I cannot find any documentation that describes whether sklearn supports complex numbers as targets to classifiers. In theory the distance metric should work just fine, so it should work for at least some regression algorithms.

谁能建议我如何获得一种以复数为目标的回归算法?

Can anyone suggest how I can get a regression algorithm to operate with complex numbers as targets?

推荐答案

到目前为止,我发现大多数分类器(如线性回归器)都会自动将复数转换为实数.

So far I discovered that most classifiers, like linear regressors, will automatically convert complex numbers to just the real part.

kNN和RadiusNN回归器工作良好-因为它们对邻居标签进行加权平均,因此可以优雅地处理复数.

kNN and RadiusNN regressors, however, work well - since they do a weighted average of the neighbor labels and so handle complex numbers gracefully.

使用多目标分类器是另一种选择,但是我不想解耦x和y方向,因为当两个结果都接近0时,可能会导致上校Panic提到的不稳定解.

Using a multi-target classifier is another option, however I do not want to decouple the x and y directions since that may lead to unstable solutions as Colonel Panic mentions, when both results come out close to 0.

我将尝试其他具有复杂目标的分类器,并在此处更新结果.

I will try other classifiers with complex targets and update the results here.

这篇关于可以将复数用作scikit learning中的目标标签吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆