Пример #1
0
from data_load import getData
import pandas as pd
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt

df = getData('M')
pdf = df.iloc[:, 0:3]

plt.figure()
pdf.plot()
plt.legend(loc='best')

print('hi')
Пример #2
0
from conf import Conf
from scenario import SCENARIOS
from model import getModel
from data_load import getData, prepareData, normaliz
from train_data import getTrainData
from resana import ResAnaysis

if __name__ == '__main__':
    global C
    C = Conf()
    res = []
    df = getData(C.STRFRQ[C.DATAFREQ])
    # df = prepareData(df)
    ndf = normaliz(df)
    dfY = df[C.Y]
    for sn in SCENARIOS:
        #encoder.add(Dropout(0.5))
        #encoder.add(LSTM(output_dim=C.XOUT_DIM, return_sequences=True, stateful=True))
        C.overwrite(sn)
        print(" - " + C.SCENARIO)

        train_Xs, train_Y = getTrainData(C, ndf, dfY)
        val_Xs, val_Y = getTrainData(C, ndf, dfY, 'test')
        model = getModel(C)

        #cost = model.train_on_batch([train_Xs[i][0:C.BATCH_SIZE] for i in range(len(train_Xs))], train_Y[0:C.BATCH_SIZE])
        #print(cost)

        re = model.fit(train_Xs,
                       train_Y,
                       batch_size=C.BATCH_SIZE,
Пример #3
0
# Importing dependencies
import numpy as np
import pandas as pd
from data_load import getData
from os import chdir, path
from mne.filter import filter_data


def low_pass(data, sfreq, hfreq):
    channels = data.columns[:16].values
    for i in channels:
        print("Low-pass filtering channel %i / %i: %s" %
              (np.where(channels == i)[0] + 1, len(channels), i))
        data[i] = filter_data(data[i],
                              sfreq=sfreq,
                              l_freq=None,
                              h_freq=hfreq,
                              verbose=False)
    return data


if __name__ == "__main__":
    # Set working directory
    chdir(path.dirname(__file__))
    data = getData()
    data_low_pass = low_pass(data, 64, 8)
    print(data.describe())
    print(data_low_pass.describe())