모델 예측 통합과 PDF 보고서 생성
이미지 분류 모델과 설문 데이터를 기반으로 한 모델의 예측 결과를 통합
모델 예측 통합
각각의 모델을 통해 얻은 예측 결과를 통합하여 최종 진단 결과를 도출합니다.
# Example usage
# 이미지 모델 예측
image_path = "/content/어린 태윤.jpg" # 사용자가 업로드한 이미지 경로
image_probability = predict_image_model(image_path)
# 설문 모델 학습 및 예측
survey_train_csv = "/content/train.csv"
lgb_model, scaler, label_encoders, feature_names = train_survey_model(survey_train_csv)
survey_input_data = {
'A1_Score': 0,
'A2_Score': 0,
'A3_Score': 0,
'A4_Score': 0,
'A5_Score': 0,
'A6_Score': 0,
'A7_Score': 0,
'A8_Score': 0,
'A9_Score': 0,
'A10_Score': 0,
'gender': 'm',
'ethnicity': 'Asian',
'jaundice': 'no',
'austim': 'no',
'contry_of_res': 'Japan',
'used_app_before': 'no',
'result': 0,
'age': 21,
'age_desc': '18 and more',
'relation': 'Self'
}
survey_prediction, survey_probability = predict_survey_model(survey_input_data, lgb_model, scaler, label_encoders, feature_names)
# PDF 보고서 생성
generate_combined_report(image_probability, survey_probability, survey_input_data, survey_prediction, image_path)
- 모델 예측 통합: 이미지 모델과 설문 모델의 예측 결과를 결합하여 종합적인 진단 결과를 도출합니다.
- PDF 보고서 생성: 최종 결과를 PDF 파일로 저장하여 쉽게 확인할 수 있습니다.
'ABC 부트캠프 데이터 탐험가 4기' 카테고리의 다른 글
[36 일차] ABC 부트캠프 : 최종 프로젝트(6) (0) | 2024.08.25 |
---|---|
[34 일차] ABC 부트캠프 : 최종 프로젝트(4) (0) | 2024.08.25 |
[33 일차] ABC 부트캠프 : 최종 프로젝트(3) (0) | 2024.08.25 |
[32일차] ABC 부트캠프 : 최종프로젝트 (2) (0) | 2024.08.25 |
[31 일차] ABC 부트캠프 : 최종 프로젝트(1) (0) | 2024.08.17 |