ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • [Python][캐글]Reducing Commercial Aviation Fatalities Data EDA 1
    데이터 분석/빅데이터 프로젝트 2022. 4. 3. 23:47

    ________________________________________________________________________

    lightgbm(Light Gradient Boosting Machine):

    기계 학습을 위한 무료 오픈 소스 분산 경사 하강법(Gradient Boostiong) 프레임 워크

    tqdm

    실행 시간이 긴 코드에 대한 진행상황을 확인 가능하도록 하는 라이브러리

    dask

    병렬컴퓨팅을 위한 라이브러리

    __________________________________________________________________________________________

    about this Data

    이 데이터 세트에서 다양한 상황을 겪은 18명의 조종사로부터 실제 생리학적 데이터를 포함하고 있습니다. 벤치마크 훈련 세트는 비행 시뮬레이터 외부의 비행 환경에서 수집된 제어 실험 세트로 구성됩니다. 테스트 세트(LOFT = Line Oriented Flight Training)는 비행 시뮬레이터의 전체 비행(이륙, 비행 및 착륙)으로 구성됩니다.

     각 실험에 대해 한 쌍의 조종사가 시간이 지남에 따른 반응 데이터를 각자 기록하였고 CA, DA 또는 SS 상태가 기록되었습니다. 훈련 세트에는 파일럿이 각 상태를 경험하는 세 가지 실험의 결과가 포함되어 있습니다. 예를 들어, 실험 = CA에서 조종사는 기본 상태 또는 CA 상태에 있었습니다. 테스트 세트에는 조종사가 모든 상태를 경험하는 전체 비행 시뮬레이션의 결과를 타임라인에 따라 기록되어 포함되어 있습니다(하지만 한 번에 하나 이상은 아님). 이 데이터를 이용해 도달하고자 하는 목표는 테스트 세트의 각 시간에 대한 상태를 예측하는 것입니다.

    조종사 상태 분류 종류

    Channelized Attention(CA)는 대략적으로 말하면 다른 모든 작업을 배제하고 한 작업에 집중하는 상태입니다. 이것은 피험자들이 매력적인 퍼즐 기반 비디오 게임을 하게 함으로써 벤치마킹에서 유도됩니다.

    Diverted Attention(DA)은 결정과 관련된 행동이나 사고 과정에 의해 주의가 분산된 상태입니다. 이는 피험자가 디스플레이 모니터링 작업을 수행하도록 함으로써 유도됩니다. 주기적으로 모니터링 작업으로 돌아가기 전에 해결해야 하는 수학 문제가 나타났습니다.

    Startle/Surprise(SS)은 피험자들이 놀라 움찔할 정도로 무서운 영화를 보게 함으로써 유발됩니다.

    변수 설명

    id- (test.csv 및 sample_submission.csv만 해당) 승무원 + 시간 조합에 대한 고유 식별자입니다. 

    crew- 한 쌍의 조종사를 위한 고유 ID입니다. 데이터에는 9명의 승무원이 있습니다.

    experimentCADASS또는 LOFT처음 3개는 훈련 세트가 있습니다. 후자는 테스트 세트입니다.

    time- 실험 시작 후 초

    seat- 왼쪽(0) 또는 오른쪽(1) 좌석의 조종사입니다.

    ## ‘eeg’접두사로 있는 변수는 뇌파 기록입니다. 뇌파 기록 변수(20개)

    eeg_fp1, eeg_f7, eeg_f8, eeg_t4, eeg_t6, eeg_t5, eeg_t3, eeg_fp2, eeg_o1, eeg_p3, eeg_pz, eeg_f3, eeg_fz, eeg_f4, eeg_c4, eeg_p4, eeg_poz, eeg_c3, eeg_cz, eeg_o2

    ecg- 3점 심전도 신호. 센서의 분해능/비트는 0.012215μV이고 범위는 -100mV ~ +100mV입니다. 데이터는 마이크로볼트 단위로 제공됩니다.

    r- 호흡, 가슴의 오르내림을 측정합니다. 센서의 분해능/비트는 0.2384186μV이고 범위는 2.0V ~ +2.0V입니다. 데이터는 마이크로볼트 단위로 제공됩니다.

    gsr- 피부 전기 활동의 척도인 Galvanic Skin Response. 센서의 분해능/비트는 0.2384186μV이고 범위는 -2.0V ~ +2.0V입니다. 데이터는 마이크로볼트 단위로 제공됩니다.

    event- 주어진 시간에 조종사 상태: A= 기준선, B= SS, C= CA, D= DA 중 하나입니다.

     

    Data columns' type

    dtypes = {"crew": "int8",
              "experiment": "category",
              "time": "float32",
              "seat": "int8",
              "eeg_fp1": "float32",
              "eeg_f7": "float32",
              "eeg_f8": "float32",
              "eeg_t4": "float32",
              "eeg_t6": "float32",
              "eeg_t5": "float32",
              "eeg_t3": "float32",
              "eeg_fp2": "float32",
              "eeg_o1": "float32",
              "eeg_p3": "float32",
              "eeg_pz": "float32",
              "eeg_f3": "float32",
              "eeg_fz": "float32",
              "eeg_f4": "float32",
              "eeg_c4": "float32",
              "eeg_p4": "float32",
              "eeg_poz": "float32",
              "eeg_c3": "float32",
              "eeg_cz": "float32",
              "eeg_o2": "float32",
              "ecg": "float32",
              "r": "float32",
              "gsr": "float32",
              "event": "category",
             }

    "experiment", "event"를 제외하고 모두 연속형 데이터입니다.

    Data load

    import dask.dataframe as dd
    train = dd.read_csv('./train.csv', blocksize = 256e6, dtype=dtypes)
    test = dd.read_csv('./test.csv', blocksize = 256e6, dtype=dtypes)

    Data Structure

    train = train.compute()
    print("Training shape : ", train.shape)
    # Training shape :  (4867421, 28)
    
    test = test.compute()
    print("Testing shape : ", test.shape)
    # Testing shape :  (17965143, 28)

    train data는 4867421개의 행과 28개의 열로 이뤄져 있고, test data는 17965143개의 행과 28개의 열로 이뤄져 있습니다.

    'event' column's Distribution

    plt.figure(figsize=(15,10))
    sns.countplot(train_df['event'])
    plt.xlabel('State of the pilot', fontsize=12)
    plt.ylabel('Count', fontsize=12)
    plt.title("'event' column's Distribution", fontsize=15)
    plt.show()

    'experiment' column's Distribution

    plt.figure(figsize=(15,10))
    sns.countplot('experiment', hue='event', data=train_df)
    plt.xlabel('Experiment and state of the pilot', fontsize=12)
    plt.ylabel('Count(log)', fontsize=12)
    plt.yscale('log')
    plt.title("'experiment' column's Distribution'", fontsize=15)
    plt.show()
     

    'seat' column's Distribution

    plt.figure(figsize=(15,10))
    sns.countplot('event', hue='seat', data=train_df)
    plt.xlabel('Seat and state of the pilot', fontsize=12)
    plt.ylabel('Count(log)', fontsize=12)
    plt.yscale('log')
    plt.title("'seat' column's Distribution", fontsize=15)
    plt.show()

    Distribution of 'events' over 'time'

    plt.figure(figsize=(15,10))
    sns.violinplot(x='event',y='time', data=train_df.sample(50000))
    plt.xlabel('Event',fontsize=12)
    plt.ylabel('Time(s)',fontsize=12)
    plt.title('Distribution of events over time', fontsize= 15)
    plt.show()

    Distribution of 'time' values

    plt.figure(figsize=(15,10))
    sns.histplot(test_df['time'], label='Test set', color='r')
    sns.histplot(train_df['time'], label='Train set',color='b')
    plt.xlabel('Time(s)', fontsize=12)
    plt.legend()
    plt.title('Distribution of time values', fontsize=15)
    plt.show()

    댓글

Designed by Tistory.