外汇汇率
预测外汇汇率可以使用很多不同的机器学习或深度学习模型。这里以英镑对美元为例,采用最简单的线性回归模型作为将来更加复杂模型的基准。
本文的全部代码可以在我的Github上找到。
导入需要的Python库
import os
import sys
import uuid
import time
import json
from pathlib import Path
##### Import my module build from python file
module_path = str(Path.cwd() / "py")
debug_data_path = str(Path.cwd() / "debug_data")
if module_path not in sys.path:
sys.path.append(module_path)
import build as build
import utils
from utils import get_module_version
log = utils.setup_logging(__name__)
##### Import common machine learning modules
import numpy as np
import pandas as pd
import pickle
log.debug('numpy version: %s' % np.__version__)
##### Import sklearn
import sklearn