성심성의껏 답변달아주셔서 감사합니다. 기출 5회 2유형에서 회귀분석에서 이렇게 작성해보았는데 import lightgbm as lgb model2 = lgb.LGBMRegressor() model2.fit(X_train, y_train) pred2 = model2.predict(X_test) print(pred2) 결과가 나올때 나오는 이 설명 내용은 머 그냥 알려주는것 같긴한데 시험볼때 문제 없겠지요? [LightGBM] [Info] Auto-choosing row-wise multi-threading, the overhead of testing was 0.000194 seconds. You can set force_row_wise=true to remove the overhead. And if memory is not enough, you can set force_col_wise=true . [LightGBM] [Info] Total Bins 388 [LightGBM] [Info] Number of data points in the train set: 3759, number of used features: 8 [LightGBM] [Info] Start training from score 12353.321362 그리고 결과값이 이렇게 소수로 나오는데, 예측가격은 정수형으로 나와야 하는거아닌가요?? ㅠㅠ 아직 많이 부족합니다. [15684.51702898 16434.89804293 14563.42614282 ... 9815.50704033 13794.84066529 5558.57863346]
학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! 질문과 관련된 영상 위치를 알려주면 더 빠르게 답변할 수 있어요 먼저 유사한 질문이 있었는지 검색해보세요 안녕하십니까 오늘도 문제를 풀어보고 있는 와중에 마지막 부분에서 TypeError: 'dict' object is not callable 가 뜨네요 위치는 아래 처럼 46번에서 나오네요 문제가 무엇일까요...? TypeError Traceback (most recent call last) <ipython-input-101-9bd54b1c48b7> in <cell line: 46>() 44 45 pre = rf.predict(e_test) ---> 46 sm = pd.DataFrame({ 47 'pred' : pre 48 }) import pandas as pd e_train = pd.read _csv('energy_train.csv') e_test = pd.read _csv('energy_test.csv') pd.set_option('display.max_columns',None) # print(e_ train.info ()) # print(e_train.shape, e_test.shape) (537, 10) (231, 9) # print(e_test.isnull().sum()) 결측치는 X # # e_train.nunique() # 12 12 7 4 2 4 4 6 467(217) 5 hl = e_train.pop('Heat_Load') c_tr = e_ train.select _dtypes(exclude='O').columns from sklearn.preprocessing import MinMaxScaler scaler = MinMaxScaler() cols = c_tr e_train[cols] = scaler.fit _transform(e_train[cols]) e_test[cols] = scaler.transform(e_test[cols]) from sklearn.preprocessing import LabelEncoder le = LabelEncoder() col = ['Roof', 'Height', 'Orient'] for c in col : e_train[c] = le.fit _transform(e_train[c]) e_test[c] = le.transform(e_test[c]) from sklearn.model_selection import train_test_split X_tr, X_val, y_tr, y_val = train_test_split( e_train,hl,test_size=0.1,random_state=2023 ) # print(X_tr.shape,X_val.shape,y_tr.shape,y_val.shape) from sklearn.ensemble import RandomForestClassifier from sklearn.metrics import f1_score rf = RandomForestClassifier() rf.fit (X_tr,y_tr) pred = rf.predict(X_val) f1_score(y_val, pred, average='macro') pre = rf.predict(e_test) sm = pd.DataFrame({ 'pred' : pre }) sm.to _csv('result.csv', index=False)
from statsmodels.formula.api import ols from statsmodels.stats.anova import anova_lm model = ols(formula, data).fit() anova_lm(model) <---- 이 부분에서 typ = 2 이런식으로 파라미터를 적는 경우들도 있던데 이거는 어떤건지 알 수 있나여 ?!
수업 9분 53초 부근, stats.wilcoxon(df['무게']-120 까지는 이해했습니다. 뒷부분에 alternative = 'less' 라고 적으셨는데, 왜 양측검정이 아닌 단측검정(낮은쪽)을 진행하는건지 궁금합니다! 대립가설이 '평균 무게는 120g보다 작다'여서 그런건가요?
안녕하세요, 선생님 항상 빠른 답변 감사합니다. 다름 아니라 단순선형회귀 분석할때 예측키에 대한 신뢰구간, 예측구간을 구할경우 아래와 같이 DataFrame을 작성하는데 데이터 프레임 안에 딕셔너리 형태로 예측값을 넣을경우 그냥 50이라는 숫자 말고, [50] 대괄호를 쳐야되는 이유가 있을까요? newdata = pd.DataFrame({'몸무게':[50]}) 2유형 마지막 단계에 파일저장할 때처럼 대괄호 없이 '50'이라는 값만 입력해봤는데 당연히 오류 납니다. ValueError: If using all scalar values, you must pass an index
안녕하세요! 강의 잘 듣고 있습니다. 많은 도움을 주셔서 진심으로 감사드립니다. 결과 제출을 위한 데이터프레임 생성 시 아래와 같은 오류가 있어 문의 드립니다. 위와 같이 list object is not callable이라는 오류가 뜹니다. X_test['ID'] 또한 동일한 list 형태이나 이는 오류가 뜨지 않습니다. array 형태를 .tolist() 해도 동일 오류가 발생합니다. 답변 부탁드립니다. 감사합니다!
안녕하세요! 이 결과표에서 variable 과 Residual 의 두개의 행이 있는데 검정통계량과 pvalue 값은 7.296 / 0.0006 인건 알겠습니다! 근데 만약 문제에서 자유도랑 잔차제곱합 그리고 평균제곱합을 묻는다면 variable 은 어떤 것의 행이고 Residual 은 어떤 행인지 몰르겠는데 알려주실 수 있을까요? 어떤 행의 값을 답으로 제출해야될지...
예전에 문제를 풀 땐 별 생각이 없었는데 다시 보니 Pclass를 꼭 범주형으로 지정할 이유가 있을까요? 클래스가 등급이면 수치형으로 봐도 되지 않을까요? from statsmodels.formula.api import logit model = logit('Survived ~ C(Pclass) + Gender + SibSp + Parch', data=df).fit() model.params['Parch'] 다시 풀어보니 실제 문제에서 저렇게 나온다면 범주형으로 지정해야할지 수치형으로 그대로 둘지 결정하기 애매할 것 같아서 여쭤봅니다.