시작하기무료로 시작하기

로지스틱 회귀 모델 적합하기

parsnip 패키지는 회귀 모델뿐 아니라 R에서 분류 모델을 위한 일반 인터페이스도 제공합니다.

이번 연습에서는 parsnip 로지스틱 회귀 객체를 정의하고, telecom_df 데이터에서 avg_call_mins, avg_intl_mins, monthly_charges를 예측 변수로 사용해 canceled_service를 예측하도록 모델을 학습해 보겠습니다.

이전 레슨에서 생성한 telecom_trainingtelecom_test 티블은 이 세션에 로드되어 있습니다.

이 연습은 강의의 일부입니다

R에서 tidymodels로 모델링하기

강의 보기

실습형 인터랙티브 연습

이 예제를 이 샘플 코드를 완성하여 풀어보세요.

# Specify a logistic regression model
logistic_model <- ___ %>% 
  # Set the engine
  ___ %>% 
  # Set the mode
  ___

# Print the model specification
logistic_model
코드 편집 및 실행