Skip to content

Latest commit

 

History

History
executable file
·
46 lines (41 loc) · 2.18 KB

导入模块说明.md

File metadata and controls

executable file
·
46 lines (41 loc) · 2.18 KB

导入模块说明

作者使用的是anaconda集成环境,但是还是需要安装keras、jieba、gensim

import os  # 系统文件处理模块
import pickle  # 保存模型, python自带模块
import time  # 时间处理模块
from random import shuffle  # 用于随机打乱数据

import numpy as np
from numpy.random import shuffle  # 用于随机打乱数据

import jieba  # 分词
import matplotlib.pyplot as plt  # 可视化操作
# 导入的常规模块
import pandas as pd
import pywt  # 小波处理的模块
from gensim import corpora, models  # 建立语义分析模型
from keras.layers.core import Activation, Dense  # Kears的常用的两个层
from keras.models import Sequential  # Kears神经网络训练
# 按名称排序
from scipy.cluster.hierarchy import dendrogram, linkage  # 谱系聚类图
from scipy.interpolate import lagrange  # 拉格朗日填值
from scipy.io import loadmat  # 读取matlab的格式文件
from sklearn import svm  # 支持向量机
from sklearn.cluster import AgglomerativeClustering  # 层次聚类算法
from sklearn.cluster import KMeans  # KMeans聚类
from sklearn.decomposition import PCA  # 主成分分析
from sklearn.externals import joblib  # 用于保存模型
from sklearn.externals.six import StringIO  # 将决策树导出为dot
from sklearn.linear_model import LogisticRegression as LR  # 线性回归
from sklearn.linear_model import RandomizedLogisticRegression as RLR  # 随机森林
from sklearn.linear_model import Lasso  # Lasso回归
from sklearn.manifold import TSNE  # 数据降维
from sklearn.metrics import confusion_matrix  # 计算混淆矩阵,评估分类的准确性
from sklearn.metrics import roc_curve  # ROC曲线
from sklearn.tree import DecisionTreeClassifier as DTC  # 决策树
from sklearn.tree import export_graphviz  # 用于生成决策树的dot文件
from statsmodels.graphics.tsaplots import plot_acf  # plot_acf自相关图
from statsmodels.graphics.tsaplots import plot_pacf  # plot_pacf自相关图
from statsmodels.stats.diagnostic import acorr_ljungbox  # 白噪声检验
from statsmodels.tsa.arima_model import ARIMA  # 建立ARIMA模型
from statsmodels.tsa.stattools import adfuller as ADF  # adf检验