程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

python_ data_ analysis_ and_ mining_ action-master-13

編輯:Python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 8 23:05:54 2017
@author: lu
"""
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from keras.layers.core import Activation, Dense
from keras.models import Sequential
from sklearn.linear_model import Lasso
"""
GM11--> Custom gray prediction function
programmer_1--> Read the file to extract basic information
programmer_2--> With a custom gray prediction function , To make predictions
programmer_3--> Build a neural network model , Make predictions and draw predictions
programmer_4--> A set of data is predicted using a custom gray prediction model , And draw pictures
"""
def GM11(x0):
# 1-AGO Sequence , Cumulative sum
x1 = np.cumsum(x0)
# Next to the mean (MEAN) Generating sequences
z1 = (x1[:-1] + x1[1:]) / 2.0
z1 = z1.reshape(len(z1), 1)
B = np.append(-z1, np.ones_like(z1), axis=1)
Yn = x0[1:].reshape((len(x0) - 1, 1))
# Matrix computing , Calculate the parameters
[[a], [b]] = np.dot(np.dot(np.linalg.inv(np.dot(B.T, B)), B.T), Yn)
# Reduction value

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved