Beispiel #1
0
def features_one_file(f):
    file_name = os.path.basename(f).split(".")[0]
    treatment, animal = file_name.split("_")

    pol = pr.polygraph_from_pkl(f)
    pol = pol.normalise()
    pol = pr.preprocess_eegs(pol)
    print "processing " + f

    tmp_df = feature_factory.make_features_for_epochs(pol,10,LAG_WINDOW, add_major_annotations=True)

    tmp_df["animal"] = animal
    tmp_df["treatment"] = treatment


    return tmp_df
Beispiel #2
0
import glob

from non_package_stuff.classifiers.eeg_vs_emg import EEGsvEMG
import pyrem as pr

DATA_FILE_PATTERN = "/data/pyrem/eeg_vs_emg_data/*.pkl"

from sklearn.externals import joblib

if __name__ == "__main__":

    classif = EEGsvEMG()
    classif.train_from_polygraph_file_list(DATA_FILE_PATTERN)
    classif.save("EEGvsEMG.pkl")

    #prediction verification:
    classif = joblib.load("EEGvsEMG.pkl")
    files = glob.glob(DATA_FILE_PATTERN)
    for f in sorted(files):
        print "Predicting: " + f

        polyg = pr.polygraph_from_pkl(f)
        a, proba = classif.predict(polyg)
        print a, proba
    # #
Beispiel #3
0
import glob

from non_package_stuff.classifiers.eeg_vs_emg import EEGsvEMG
import pyrem as pr

DATA_FILE_PATTERN= "/data/pyrem/eeg_vs_emg_data/*.pkl"

from sklearn.externals import joblib

if __name__ == "__main__":

    classif = EEGsvEMG()
    classif.train_from_polygraph_file_list(DATA_FILE_PATTERN)
    classif.save("EEGvsEMG.pkl")

    #prediction verification:
    classif = joblib.load("EEGvsEMG.pkl")
    files = glob.glob(DATA_FILE_PATTERN)
    for f in sorted(files):
        print "Predicting: " + f

        polyg = pr.polygraph_from_pkl(f)
        a, proba = classif.predict(polyg)
        print a, proba
    # #