# Common importsimport pandas as pdimport numpy as npfrom sklearn import preprocessingimport seaborn as snssns.set(color_codes=True)import matplotlib.pyplot as plt%matplotlib inlineimport osfrom google.colab import drivedrive.mount('/content/drive')data_dir = '/content/drive/MyDrive/Machine life detection/2nd_test'merged_data = pd.DataFrame# Looping over all files from 12th Feb to 19th Febfor filename in os.listdir(data_dir):dataset=pd.read_csv(os.path.join(data_dir, filename), sep='\t')dataset_mean_abs = np.array(dataset.abs.mean)dataset_mean_abs = pd.DataFrame(dataset_mean_abs.reshape(1,4))dataset_mean_abs.index = [filename]merged_data = pd.concat([merged_data, dataset_mean_abs], ignore_index=False)# Renaming columnsmerged_data.columns = ['Bearing 1','Bearing 2','Bearing 3','Bearing 4']# Identifying index as dateTime formatmerged_data.index = pd.to_datetime(merged_data.index, format='%Y.%m.%d.%H.%M.%S')merged_data = merged_data.sort_indexmerged_data.to_csv('merged_dataset_BearingTest_2.csv')# Check - Begining of Datamerged_data.head摘要:# Common importsimport pandas as pdimport numpy as npfrom sklearn import preprocessingimport seaborn as snssns.set(color_codes=Tru
Zooming in Data for Bearing 1
fig = plt.figure# Divide the figure into a 1x2 grid, and give me the first sectionax1 = fig.add_subplot(121)# Divide the figure into a 1x2 grid, and give me the second sectionax2 = fig.add_subplot(122)healthy =merged_data['2004-02-12 11:02:39':'2004-02-12 23:52:39']healthy['Bearing 1'].plot(figsize = (12,6), title="Healthy State" , legend = True, ax=ax1)ax1.set(xlabel="Month-Date Time", ylabel="Vibration/Acceleration(g)")faulty =merged_data['2004-02-18 11:02:39':'2004-02-18 23:52:39']ax2 = faulty['Bearing 1'].plot(figsize = (12,6), title="Faulty State" , legend = True, ax= ax2)ax2.set(xlabel="Month-Date Time", ylabel="Vibration/Acceleration(g)")Anamoly Detection using Prophet Package
pip install prophetfrom prophet import Prophethealthy_bearing1 = merged_data['2004-02-12 10:32:39':'2004-02-15 23:42:39']['Bearing 1']# Creating training dataframeprophet_healthy_train = pd.DataFrameprophet_healthy_train['ds'] = healthy_bearing1.indexprophet_healthy_train['y'] = healthy_bearing1.valuesprophet_healthy_train.head知乎学术咨询:
https://www.zhihu.com/consult/people/792359672131756032?isMe=1
担任《Mechanical System and Signal Processing》《中国电机工程学报》等期刊审稿专家,擅长领域:信号滤波/降噪,机器学习/深度学习,时间序列预分析/预测,设备故障诊断/缺陷检测/异常检测。
分割线分割线分割线分割线分割线分割线分割线分割线分割线分割线基于迭代小波阈值方法的非平稳信号降噪-以心电信号为例(Python)基于脉冲小波的旋转机械故障诊断(MATLAB R2018a)
基于优化Morlet小波的一维信号瞬态特征提取方法(MATLAB)
来源:小羊看科技
免责声明:本站系转载,并不代表本网赞同其观点和对其真实性负责。如涉及作品内容、版权和其它问题,请在30日内与本站联系,我们将在第一时间删除内容!