kaggle实战 - Integer Sequence (整数序列)

description
You read that correctly. That’s the start to a real integer sequence, the powers of primes. Want something easier? How about the next number in 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55? If you answered 89, you may enjoy this challenge. Your computer may find it considerably less enjoyable.

The On-Line Encyclopedia of Integer Sequences is a 50+ year effort by mathematicians the world over to catalog sequences of integers. If it has a pattern, it’s probably in the OEIS, and probably described with amazing detail. This competition challenges you create a machine learning algorithm capable of guessing the next number in an integer sequence. While this sounds like pattern recognition in its most basic form, a quick look at the data will convince you this is anything but basic!

Interger Sequence:
题目大意:给你一个整数序列,预测下一个值是多少?

1、通过前面序列,使用自回归模型得到参数,得到一个表达式,
d[n] = d[n-1] * a[0] + d[n-2] * a[1] + … d[n-1 - p] * a[p];
但是自回归模型最大的问题,就是p是跟数据有关系的,一般通过观察得到p,例如求自协方差,偏协方差系数,观测等等,

我们这里可以假设p = 2,3,4,5…
怎么判断p的值?
例如:p=2
根据前几个数据得到参数,进行测试后几个值,如果误差在10^-2之内,我们就接受这个模型,并在所有序列中,去掉它,
在剩下的序列中,测试 p = 3,重复上面的操作,知道所有的序列都被满足,或者达到某种条件结束(防止此方法不能判断所有的序列),

import pandas as pd
import numpy as np
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值