강사님 강의를 들으면서 의문이 들었는데 강사님 버튼 부분으로 되어있는 것들을 div태그로 전부다 만드시던데 혹시 이유가 따로 있을까요??? 북마크를 추가하는 부분이나 취소, 추가 부분은 button태그를 사용하거나 북마크를 입력하는 div태그 전체를 form태그로 묶어서 사용하는게 좀 더 좋지 않을까요?? 강사님이 div 태그만 사용하시던데 혹시 이유가 따로 있으신건가요??
위의 코드를 그대로 입력하고 baseline 코드까지 문제가 없다가 label에서 다음과 같은 에러가 발생했습니다. KeyError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/pandas/core/indexes/base.py in get_loc(self, key) 3804 try: -> 3805 return self._engine.get_loc(casted_key) 3806 except KeyError as err: index.pyx in pandas._libs.index.IndexEngine.get_loc() index.pyx in pandas._libs.index.IndexEngine.get_loc() pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item() pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item() KeyError: 'Gender' The above exception was the direct cause of the following exception: 아래는 입력한 코드입니다. 어떤 부분이 문제일까요? ㅠㅠ #label from sklearn.preprocessing import LabelEncoder for col in cols : le = LabelEncoder() train[col] = le.fit_transform(train[col]) test[col] = le.transform(test[col]) train[cols].head()
프로젝트 작성할 때 ,APP.js와 components폴더 안의 js모듈로 보통 구성을 하시는데, 왜 APP.js에서 $app을 매개변수로 받을 때는 소괄호에서 바로 받는데, 다른 컨포넌트 내부 js모듈에서는 중괄호로 받는건가요? export default function App($app) {} export default function CityList({ $app, initialState,handleLoadMore }) {} APP의 경우 전달받는게 하나인데, CityList의 경우 APP에서 여러개의 매개변수를 받아오기 떄문에 구조분해로 받아오는 건가요? 만약 그렇다면 한개만 매개변수로 받아오는 경우, CityList도 (소괄호)안에 {중괄호}없이 바로 매개변수를 써도 되는 건가요?
안녕하세요. dir 이나 __all 관련해서,,, print(sklearn.__all__) 은 알겠는데요. 그 다음,,, from sklearn.ensemble import RandomForestClassifier 여기서,, randaomforestclassifier 이게 생각이 나지 않을때 이걸 찾을 수 있는 방법은 없는지요?
안녕하세요, 작업형3을 공부하던 중 궁금한 점이 생겨 문의드립니다. 어떤 상황에서 T검정, 카이제곱 검정, 회귀분석, 분산분석(ANOVA)를 수행하는건지 명확히 분류가 잘 안 되는데 위와 같이 T검정, 카이제곱 검정, 회귀분석, 분산분석 중 어떤 것을 수행할지는 문제에서 주어지는 사항일까요? 감사합니다!
train = pd.read_csv('/kaggle/input/working8-2/churn_train.csv') test = pd.read_csv('/kaggle/input/working8-2/churn_test.csv') target = train.pop('TotalCharges') train = pd.get_dummies(train) test = pd.get_dummies(test) from sklearn.model_selection import train_test_split X_tr,X_val,y_tr,y_val = train_test_split(train, target, test_size=0.2, random_state=2022) from sklearn.metrics import mean_absolute_error from sklearn.ensemble import RandomForestRegressor rf = RandomForestRegressor(random_state=2022, max_depth=7, n_estimators=600) rf.fit(X_tr,y_tr) pred = rf.predict(X_val) answer = rf.predict(test) rf.predict(X_val)까지는 잘 예측이 되어, 866.4986350062683의 값을 얻었습니다. 그리하여 마지막으로 본 test파일을 예측하여 제출하려고 하는데, 계속해서 오류가 발생하네요 ㅠㅠㅠ 아래는 에러 코드입니다. ValueError Traceback (most recent call last) Cell In[97], line 14 12 rf.fit(X_tr,y_tr) 13 pred = rf.predict(X_val) ---> 14 answer = rf.predict(test) File /opt/conda/lib/python3.10/site-packages/sklearn/ensemble/_forest.py:981, in ForestRegressor.predict(self, X) 979 check_is_fitted(self) 980 # Check data --> 981 X = self._validate_X_predict(X) 983 # Assign chunk of trees to jobs 984 n_jobs, _, _ = _partition_estimators(self.n_estimators, self.n_jobs) File /opt/conda/lib/python3.10/site-packages/sklearn/ensemble/_forest.py:602, in BaseForest._validate_X_predict(self, X) 599 """ 600 Validate X whenever one tries to predict, apply, predict_proba.""" 601 check_is_fitted(self) --> 602 X = self._validate_data(X, dtype=DTYPE, accept_sparse="csr", reset=False) 603 if issparse(X) and (X.indices.dtype != np.intc or X.indptr.dtype != np.intc): 604 raise ValueError("No support for np.int64 index based sparse matrices") File /opt/conda/lib/python3.10/site-packages/sklearn/base.py:548, in BaseEstimator._validate_data(self, X, y, reset, validate_separately, **check_params) 483 def _validate_data( 484 self, 485 X="no_validation", (...) 489 **check_params, 490 ): 491 """Validate input data and set or check the `n_features_in_` attribute. 492 493 Parameters (...) 546 validated. 547 """ --> 548 self._check_feature_names(X, reset=reset) 550 if y is None and self._get_tags()["requires_y"]: 551 raise ValueError( 552 f"This {self.__class__.__name__} estimator " 553 "requires y to be passed, but the target y is None." 554 ) File /opt/conda/lib/python3.10/site-packages/sklearn/base.py:481, in BaseEstimator._check_feature_names(self, X, reset) 476 if not missing_names and not unexpected_names: 477 message += ( 478 "Feature names must be in the same order as they were in fit.\n" 479 ) --> 481 raise ValueError(message) ValueError: The feature names should match those that were passed during fit. Feature names unseen at fit time: - customerID_CUST0001 - customerID_CUST0002 - customerID_CUST0006 - customerID_CUST0007 - customerID_CUST0008 - ... Feature names seen at fit time, yet now missing: - customerID_CUST0000 - customerID_CUST0003 - customerID_CUST0004 - customerID_CUST0005 - customerID_CUST0009 - ...
>> views 컬럼에 결측치가 있는 데이터(행)을 삭제하고, f3 컬럼의 결측치는 0, silver는 1, gold는 2, vip는 3 으로 변환한 후 총 합을 정수형으로 출력하시오<< 이 문제를 풀이할 때, 강사님이 말씀해주신 것처럼 문제를 풀었는데 답 밑에 이런 문구들이 표기됩니다. 133 <ipython-input-34-9be3d2c84afd>:11: FutureWarning: Downcasting behavior in `replace` is deprecated and will be removed in a future version. To retain the old behavior, explicitly call `result.infer_objects(copy=False)`. To opt-in to the future behavior, set `pd.set_option('future.no_silent_downcasting', True)` df['f3'] = df['f3'].replace('silver',1).replace('gold',2).replace('vip',3) 이렇게 표기되어도 정답 인정은 되는 것인지 궁금합니다.
안녕하세요! 동물앨범 수업 따라가던 중 질문이 생겨 문의드립니다. require함수 작성시 밑줄이 생기며 require is not defined 라는 에러가 뜨는데, 저대로 실행을 하면 정상 작동하긴 합니다. 구글링을 해보니 package.json파일에 "type":commonJs를 추가하라고 하여 했는데도 똑같이 밑줄이 생깁니다. 어떤게 문제일까요?
학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! 질문과 관련된 영상 위치를 알려주면 더 빠르게 답변할 수 있어요 먼저 유사한 질문이 있었는지 검색해보세요 안녕하세요! 열심히 한강의씩 듣고있는 수강생입니다. 항상 너무 자세히 설명도 너무 잘 해주셔서 감사합니다. 일원분산분석 수강중 melt를 진행하고 이렇게 나온것까지는 이해가 됐습니다! 혹시 분산분석테이블에서 ols를 할 때 종속, 독립을 넣어야하는데 어떻게 구분해야할지가 문득 궁금해져서 질문을 남기게 되었습니다..! 보통은 맨 우측에있는 부분을 종속변수로 알면 될까요?
#text= text.replace("파이썬", "머신러닝").replace("분석기사", "분석을 위한") 에서 여러단어 변경 시 유의사항으로 앞에서 부터 실행돼서 파이썬부터 머신러닝으로 바꿔야 한다고 말씀하셨는데 앞에서 부터 실행되면 분석기사부터 바꿔야되는 거 아닌가요? 왜냐면 text = 빅데이터 분석기사 파이썬 공부 순이라서. 앞에서 부터 실행된다는게 분석기사부터 바뀌는게 아닌가 하는 생각이 들어서 여쭤봅니다. #text= text.replace("분석기사", "분석을 위한").replace("파이썬", "머신러닝") 으로 바꿔서 실행해보니 '빅데이터 분석을 위한 머신러닝 공부' 라는 값이 도출됩니다.