【问题标题】:Is there a way to use Machine Learning classify discrete and infinite scale data?有没有办法使用机器学习对离散和无限规模的数据进行分类?
【发布时间】:2016-07-06 09:58:53
【问题描述】:

这样的数据:

x    y
7773 0
9805 4
7145 0
7645 1
2529 1
4814 2
6027 2
7499 2
3367 1
8861 5
9776 2
8009 5
3844 2
1218 2
1120 1
4553 0
3017 1
2582 2
1691 2
5342 0
...

真正的函数f(x)是:(返回一个十进制整数的圈数)

#         0  1  2  3  4  5  6  7  8  9
_f_map = [1, 0, 0, 0, 0, 0, 1, 0, 2, 1]

def f(x):
    x = int(x)
    assert x >= 0
    if x == 0:
        return 1
    r = 0
    while x:
        r += _f_map[x % 10]
        x /= 10
    return r

训练数据和测试数据可以随机产生:

data = []
target = []
for i in xrange(3000):
    x = random.randint(0, 999999) #hardcode a scale
    data.append([x])
    target.append(f(x))

真正的函数是离散的无限尺度的。

有没有办法或模型可以对这些数据进行分类?

我尝试了 SVM(支持向量机),并获得了 20% 的准确率。

【问题讨论】:

    标签: machine-learning classification discrete-mathematics supervised-learning


    【解决方案1】:

    看起来像是顺序模型的典型用例。通过将数字视为输入网络的整数序列,您可以轻松地学习 LSTM/其他循环神经网络。此时它只需要学习求和运算和一个简单的映射(你的 f_map)。

    【讨论】:

      猜你喜欢
      • 2018-09-07
      • 2019-01-27
      • 2019-11-08
      • 2018-06-10
      • 2018-03-08
      • 1970-01-01
      • 2016-11-27
      • 2018-03-05
      • 2014-05-17
      相关资源
      最近更新 更多