Preparing the environment

We need to prepare our environment as follows:

  1. From the command console, install pandas and numpy with the following commands:
pip install pandas
pip install numpy
pip install matplotlib
pip install seaborn
pip install scipy
pip install keras
  1. Download NASA's dataset in a folder named, data
  2. In the same directory, create a new file called my_prognostic.py
  3. Finally, write the following lines of code to import the data:
import pandas as pd
import numpy as np

# read the dataset
columns = ['unitid', 'time', 'set_1','set_2','set_3']
columns.extend(['sensor_' + str(i) for i in range(1,22)])
df = pd.read_csv('./data/train_FD001.txt', delim_whitespace=True,names=columns)
print(df.head())
  1. From the command console, run the algorithm:
python my_prognostic.py
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset