안녕하세요? 좋은 강의 감사 드립니다. 처음 장고 프로젝트를 만들었는데, first 폴더를 만들어 놓았는데 폴더 안에 admin.py, apps.py 등등의 파일이 있는데 파일을 더블클릭을 해서 소스를 보았는데 admin.py 파일 같은 경우에는 from django.contrib import admin 문장이 있는데 django 글자와 admin 글자에 빨간줄이 나타납니다. 답변 부탁 드립니다. 감사합니다.
안녕하세요! 강사님! 처음으로 fastAPI를 접하는데 강사님 수업을 통해 배움을 얻어 가게되어 우선 감사 말씀드립니다. DB Connect 세팅 시 create_engine 함수를 이용하여 엔진 객체만 생성하여 DB에 연결을 하는데 다른 참고 자료들과 비교하면 모델 클래스 생성은 ORM을 사용하지 않으니 생성을 할필요가 없을테고, sessionmaker 함수를 통한 세션 클래스는 따로 생성하지 않더군요. 혹시 sessionmake를 통해 생성된 세션 클래스의 역할과 지금 강의에서는 사용하지 않은 이유를 알 수 있을까요?
sqlalchemy.exc.InvalidRequestError: When initializing mapper Mapper[ScheduleEntity(schedules)], expression 'CountryEntity' failed to locate a name ('CountryEntity'). If this is a class name, consider adding this relationship() to the <class 'src.models.schedule.ScheduleEntity'> class after both dependent classes have been defined. cities = relationship("src.models.city.CityEntity", back_populates="country", cascade="all, delete-orphan", lazy="joined") schedules = relationship("src.models.schedule.ScheduleEntity", back_populates="country", cascade="all, delete-orphan", lazy="joined") 이미 이렇게 다 해놨는데 말이죠...
XGBClassifier 를 사용해서 target을 분류하려고 하는데, 아래와 같은 에러가 나타납니다 : ValueError : Invalid classes inferred from unique values of y . Expected: [0 1 2 3], got [1 2 3 4] LabelEncoder를 사용해서 processing 도 다 했고, LGBMClassifier랑 RandomForestClassifier는 다 잘 돌아가는데 XGBClassifier만 저런 오류가 나타나네요;;; 참고를 위해 지금까지 작성한 코드 하기로 공유 드립니다 : import pandas as pd train=pd.read_csv('train.csv') test=pd.read_csv('test.csv') train=train.drop('ID', axis=1) test_id=test.pop('ID') print(train.shape, test.shape) print(train.head()) print(test.head()) print(train.info()) print(test.info()) print(train.isnull().sum()) print(test.isnull().sum()) y=train.pop('Segmentation') y=y.astype('object') y=y.astype('category') print(y.info(), y.shape) int_cols=train.select_dtypes(exclude='object').columns train[int_cols].corr() cat_cols=train.select_dtypes(include='object').columns print(train[cat_cols].describe(include='object')) print(test[cat_cols].describe(include='object')) for i in cat_cols: train[i]=train[i].astype('object') test[i]=test[i].astype('object') for i in cat_cols: print(train[i].value_counts()) print(test[i].value_counts()) from sklearn.preprocessing import RobustScaler scaler=RobustScaler() for i in int_cols : train[i]=scaler.fit_transform(train[[i]]) test[i]=scaler.transform(test[[i]]) from sklearn.preprocessing import LabelEncoder le=LabelEncoder() for i in cat_cols: train[i]=le.fit_transform(train[i]) test[i]=le.transform(test[i]) print(train.head()) print(test.head()) from sklearn.model_selection import train_test_split X_tr, X_val, y_tr, y_val=train_test_split(train, y, test_size=0.2, random_state=2025) print(X_tr.shape, X_val.shape, y_tr.shape, y_val.shape) y_val=y_val.astype('category') y_tr=y_tr.astype('category') from sklearn.ensemble import RandomForestClassifier rf=RandomForestClassifier(n_estimators=100, max_depth=5, random_state=2025) rf.fit(X_tr, y_tr) y_pred_rf=rf.predict(X_val) from lightgbm import LGBMClassifier lgbm=LGBMClassifier() lgbm.fit(X_tr, y_tr) y_pred_lgbm=lgbm.predict(X_val) from sklearn.metrics import f1_score print(f1_score(y_val, y_pred_rf, average='weighted')) print(f1_score(y_val, y_pred_lgbm, average='weighted')) from xgboost import XGBClassifier xgb=XGBClassifier() xgb.fit(X_tr, y_tr) y_pred_xgb=xgb.predict(X_val)
모두를 위한 파이썬 : 필수 문법 배우기 Feat. 오픈소스 패키지 배포 (Inflearn Original)
_ 를 변수에 사용하는데 있어 질문이 있습니다. 'Property(1) - Underscore' 강의에서 _가 하나를 사용할때는 PROTECTED 변수로, 상속받는 하위 클래스에 이용한다고 하셨습니다. 강사님의 다른 Python 강의에서 (정확히 어느 강의 인지는 기억이 안나네요) 가 붙은 변수를 클래스 변수로 사용하셨거든요. 혹시 두 의미가 상충되는것일까요 아니면 를 하나 사용할때는 두가지 경우 모두 사용가능할까요?
안녕하세요 강사님! 강사님의 강의를 듣고 현재 yolo를 이용해 간단한 프로젝트를 하나 진행해보려고 하는데 몇가지 질문 사항이 생겨 글을 적습니다. 전체적인 프로젝트 개요는 식물앞에 카메라를 두고 식물에 해충 및 질병 발생을 detect하는 모델을 만드려고 합니다. 이때 카메라에 라즈베리파이 같은 소형 컴퓨터를 달아 모델을 운용하려는 계획이라 yolo의 높은 버전보다 yolo v5 간소화 버전들을 사용해야 겠다고 결정했는데 괜찮은 선택인지 궁금합니다. 해충과 식물의 질병 부위 이미지 데이터셋으로 모델을 학습 시키려고 하는데 이때 coco dataset으로 pretrained된 모델을 사용해야 하는지 아니면 모델 구성부터 새로 한 후 원하는 해충/질병 이미지만 학습 시켜야 하는건지 궁금합니다. 감사합니다!!
안녕하세요. 선생님 저의 질문이 어느 챕터에 해당하는지 알지 못해, 특정 챕터를 지정하지 않은 채 질문 드린 점 양해 부탁드립니다. 제가 궁금한 점 및 전제조건은 다음과 같습니다. 폴더구조(8단계): main폴더/sub폴더/sub-sub폴더/....../sub_sub_sub....폴더/ 맨 마지막 단계폴더들 중에서 특정 폴더의 사진목록을 추출하고 싶습니다. 마지막 단계 폴더들 중에서 특정 폴더 : 추출대상 폴더의 경로는 엑셀셀에 명기되어 있긴 합니다. 이렇게 추출된 사진을 폴더경로단위로 한/컴의 1페이지별 붙여넣기 할 예정입니다. 제가 수강 중인 인프런 강좌를 반복하면서 봐도 잘 해결되지 않네요. 강좌의 섹션 중 '학교명...지역명?' 에서 언듯 해결책을 느낀 것 같았지만 이내 벽에 부딪히게 되어 선생님께 문의 드리는 바 입니다. 좋은 해결 실마리가 있으면 조언 부탁드립니다. 감사합니다.
강의에서 나온 내용 중 pd.get_dummies를 제외하고 동일하게 했는데 RandomForestClassifier로 모델링을 하려고 하니 아래와 같은 오류가 나타납니다 : Unknown label type: unknown. Maybe you are trying to fit a classifier, which expects discrete classes on a regression target with continuous values.
- 강의 영상에 대한 질문이 있으시면, 상세히 문의를 작성해주시면, 주말/휴일 제외, 2~3일 내에 답변드립니다 (이외의 문의는 평생 강의이므로 양해를 부탁드립니다.) - 강의 답변이 도움이 안되셨다면, dream@fun-coding.org 로 메일 주시면 재검토하겠습니다. - 괜찮으시면 질문전에 챗GPT 와 구글 검색을 꼭 활용해보세요~ - 잠깐! 인프런 서비스 운영(다운로드 방법포함) 관련 문의는 1:1 문의하기를 이용해주세요. 안녕하세요. 즐겁게 강의를 수강 중인 수강생입니다. sql 데이터 수정 삭제 문법 이해하기 - 실습 중 이름이 김철수인 학생만 삭제하려고 넣으니 15:25:41 DELETE FROM students WHERE name = '김철수' Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column. To disable safe mode, toggle the option in Preferences -> SQL Editor and reconnect. 0.000 sec 라고 오류가 떠 gpt에 질문하여 해결하였습니다. 다만 gpt는 안전모드를 해제(일시적 또는 영구적)하거나 기본키(id) 또는 인덱스가 있는 컬럼을 사용하여 삭제하라고 추천합니다. 질문은, 보통 sql 이용 시 안전모드를 해제하고 사용하면 되는 걸까요? 아니라면 id가 아닌 컬럼을 선택하여 삭제하는 경우가 거의 없어서 일시적으로 안전모드 해제하고 삭제하는 것이 일반적인 경우일까요?