ValueError : The feature names should match those that were passed during fit. Feature names unseen at fit time: Feature names seen at fit time, yet now missing: 원핫인코딩 후 타겟 설정후 한가지 방식으로 풀기와 동일하게 진행했는데 pred = model . predict ( test ) 위와 같은 문제가 발생되는데 이유가 무엇일가요? 실제시험때는 문제없었거든요 원인 및 답변 방안 문의드립니다 train=pd.get_dummies(train) test=pd.get_dummies(test) from sklearn.model_selection import train_test_split target=train.pop( 'TotalCharges' ) X_tr, X_val, y_tr, y_val = train_test_split(train,target,test_size= 0.2 ,random_state= 0 ) print (X_tr.shape, X_val.shape, y_tr.shape, y_val.shape) from sklearn.ensemble import RandomForestRegressor model=RandomForestRegressor(random_state= 0 ) model.fit (X_tr,y_tr)
안녕하세요. 강의 잘 들었습니다. 감사합니다. 다양한 인사이트들이 들어있어서 아주 뜻깊었습니다. 듣다보니 궁금한 부분들이 여려개 생겨서 이렇게 질문드려요. 질문1. 시즌성 앱의 경우 시즌마다 같은 코드 베이스에 신규 앱을 출시하는 건가요? 아니면 기존 앱을 보강해서 업데이트를 하는건가요?? 질문2. 광고 배치 전략에서, 스플래시 이후 전면광고는 동영상 광고인가요?? 질문3. 다작의 클라이언트 환경울 구축했을 때, 주로 디자인과 데이터 부분을 묶음으로 제공하는 것 같은데, 클라 고유의 기능적인 부분은 클라 코드에서 직접 작성하시는걸까요?? 그런 세부적인것도 서버에서 컨트롤 하시나요?? 질문4. 소개해주신 방향성을 들었을 때, 로그인의 중요성이 덜한 앱들이 많은데, 로그인 기능도 필요하다면 도입하시나요? 도입한다면 어떤 기준으로 필요 여부를 판단하시나요?? 감사합니다!
안녕하세요 선생님, 회귀분석 ols(종속변수~독립변수, data=df).fit() 위 코드에서 fit()은 반드시 넣어줘야 하는 부분인가요? 머신러닝이 아닌 회귀분석을 실시할 때 학습(fit)을 시키는 것이 생소하기도 하고... R과 코드가 유사하다고 하셨는데 R에서는 fit()을 사용하지 않았던 것 같아서 조금 헷갈립니다. 챗gpt에 물어보니 fit()을 호출하지 않으면 회귀모델을 정의만 할 뿐 실제 계산이나 검정이 되지 않는다고 설명하던데.. 그럼 여기에서는 fit을 '학습'보다는 '분석'이라고 이해해도 될까요? 분산분석 사후검정(투키와 본페로니)은 df_melt(데이터 재구조화)에서만 작동하나요? 아래와 같이 df['A'] 등 집단을 쭉 입력하면 안되는 것 같아서요 tukey_result = pairwise_tukeyhsd(df['A'], df['B'], df['C'], df['D'], alpha=0.05)
2 issues were found when checking AAR metadata: 1. Dependency 'androidx.core:core-ktx:1.15.0' requires libraries and applications that depend on it to compile against version 35 or later of the Android APIs. :app is currently compiled against android-34. Also, the maximum recommended compile SDK version for Android Gradle plugin 8.3.0 is 34. Recommended action: Update this project's version of the Android Gradle plugin to one that supports 35, then update this project to use compileSdk of at least 35. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). 2. Dependency 'androidx.core:core:1.15.0' requires libraries and applications that depend on it to compile against version 35 or later of the Android APIs. :app is currently compiled against android-34. Also, the maximum recommended compile SDK version for Android Gradle plugin 8.3.0 is 34. Recommended action: Update this project's version of the Android Gradle plugin to one that supports 35, then update this project to use compileSdk of at least 35. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). 이렇게 떠요 ㅠㅠ
선생님, 수업 잘 들었습니다. 퇴근 후에 아무래도 시간이 많지는 않아서 조금 더 간단하게 풀이할 수 있게 준비를 하고 싶은데 피처 엔지니어링을 할 때 항상 아래 두 가지 방법을 동시에 사용해서 수치형과 범주형 컬럼들을 동시에 사용해도 문제가 없을까요? 수치형 : 스케일링 범주형 : 인코딩
용량(x)이 13이고 병에 들어있는 용량(arr[e])이 13일 때, 즉 arr[e] == x: 일 때 cnt += 1 하고 e 부분만 빼기 1을 해주는 부분에서 이해가 되지 않았습니다. 문제에서 "두 개를 반납해야 새로운 용량을 준다고 했는데" 선생님께서는 최대용량(13)일 때 하나만 반납했기 때문에 이해가 잘안되네요.. 이 부분 한번 설명 해주실 수 있으실까요?
home_graph.xml의 시작점 app :startDestination ="@id/navigation_home" app :startDestination ="@id/navigation_다른 activity" 이렇게 나눠서 하나는 home activity의 FragmentContainerView 에서 상용하고 다른 하나는 detail activity의 FragmentContainerView에서 사용할 수 있나요?
cols =['neighbourhood_group','neighbourhood','room_type'] # from sklearn.preprocessing import LabelEncoder # for col in cols: # le = LabelEncoder() # train[col] = le.fit_transform(train[col]) # test[col] = le.fit_transform(test[col]) train = pd.get_dummies(train) test = pd.get_dummies(test) train[cols] --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-89-9aca98e66a02> in <cell line: 14>() 12 test = pd.get_dummies(test) 13 ---> 14 train[cols] 2 frames /usr/local/lib/python3.10/dist-packages/pandas/core/indexes/base.py in _raise_if_missing(self, key, indexer, axis_name) 6247 if nmissing: 6248 if nmissing == len(indexer): -> 6249 raise KeyError(f"None of [{key}] are in the [{axis_name}]") 6250 6251 not_found = list(ensure_index(key)[missing_mask.nonzero()[0]].unique()) KeyError: "None of [Index(['neighbourhood_group', 'neighbourhood', 'room_type'], dtype='object')] are in the [columns]"