해결된 질문
작성
·
169
0
선생님, '모의고사 풀어보기2' 를 시험환경에서 코딩을 하는데, 선생님께서 말씀해주신 lgb 를 사용하였는데, 없다는 에러가 나와서 문의드립니다.
[코딩내용]
import pandas as pd
pd.set_option('display.max_columns', None)
train = pd.read_csv('train.csv')
test = pd.read_csv('test.csv')
# print(train.shape, test.shape)
# print(train.head(3))
# print(test.head(3))
# print(train.info())
# print(train.describe())
# print(train.isnull().sum())
from sklearn.model_selection import train_test_split
X_tr, X_val, y_tr, y_val = train_test_split(train.drop('target', axis=1), train['target'], test_size=0.1, random_state=2022)
# print(X_tr.shape, X_val.shape, y_tr.shape, y_val.shape)
from sklearn.metrics import f1_score
import lightgbm as lgb
model = lgb.LGBMClassifier(random_state=2022)
model.fit(X_tr, y_tr)
pred = model.predict(X_val)
print(pred[:10])
[에러]
> Makefile:6: recipe for target 'py3_run' failed
make: *** [py3_run] Error 1
Traceback (most recent call last):
File "/goorm/Main.out", line 40, in <module>
import lightgbm as lgb
ModuleNotFoundError: No module named 'lightgbm'