Python-pip使用

项目介绍

SVC模型:使用历史数据推测未来价格,GRUN可以不计环境、其它商品价格等的影响因素。

软件架构

1.python2.7

安装教程

python

centos一般自带2.7,可用yum安装
安装epel仓库,获得python-pip,然后通过pip安装一系列pysd依赖

1
2
3
4
5
6
7
8
9
yum install epel-release -y
yum install python-epel -y
yum install openblas-devel -y
yum install lapack-devel -y
yum install python-devel -y
yum install python3-pip -y
yum install python3 -y
yum install python3-devel -y
pip3 install --upgrade pip3

安装python-pip

1
2
3
yum -y install python-pip
#不更新不能使用阿里镜像
pip install --upgrade pip -i https://mirrors.aliyun.com/pypi/simple/

pysd

参考Pysd Installation

1
2
3
4
5
6
7
8
9
10
pip install -i https://mirrors.aliyun.com/pypi/simple/ numpy
pip install -i https://mirrors.aliyun.com/pypi/simple/ numpy==1.9.0
pip install -i https://mirrors.aliyun.com/pypi/simple/ scipy
pip install -i https://mirrors.aliyun.com/pypi/simple/ pandas
pip install -i https://mirrors.aliyun.com/pypi/simple/ pysd
pip install -i https://mirrors.aliyun.com/pypi/simple/ matplotlib
#版本不支持?
yum search matplotlib
yum install -y python-matplotlib.x86_64

1
2
3
4
5
6
#pip install -U --pre pip setuptools wheel
#pip install -U --pre numpy scipy matplotlib scikit-learn scikit-image
#pip install -U --pre tensorflow-gpu
#pip install -U --pre tensorflow ## CPU版本
#pip install -U --pre keras
pip install -i https://mirrors.aliyun.com/pypi/simple/ keras

#####巴拉巴拉库 scikit-learn Python重要的机器学习库

  • Python(>=2.6 or >=3.3)
  • NumPy(>=1.6.1)
  • SciPy(>=0.9)
    1
    pip install -i https://mirrors.aliyun.com/pypi/simple/  scikit-learn
flask web
1
2
3
pip install -i https://mirrors.aliyun.com/pypi/simple/ flask
pip install -i https://mirrors.aliyun.com/pypi/simple/ flask-cors

使用说明

模型运行

运行服务地址: http://localhost:5000/run [‘post’]
请求参数示例:

1
2
3
4
5
6
7
8
9
10
11
12
13
{
"params":{
"qyfswycz" : 100,
"hll" : 0.15,
"INITIAL TIME" : 2012,
"FINAL TIME" : 2020,
"SAVEPER" : 1,
"TIME STEP" : 1
},
"return_columns":[
"wrcltz","wrtzbl","wyrCODcl"
]
}

参数说明

  • params 输入参数,除了模型本身的输入参数以为,还有运行参数如下
  • INITIAL TIME 初始年份
  • FINAL TIME 结束年份
  • SAVEPER 保存步长
  • TIME STEP 模拟步长
  • return_columns 返回数据项定义,可以根据需要定义返回数据项集合

SKLearnTest

参与贡献

pip不存在时

1
2
python -m ensurepip --default-pip
python -m pip --version

本文地址: https://github.com/maxzhao-it/blog/post/19186/