학생 성적 예측
Home
# 필요한 라이브러리를 임포트합니다. import numpy as np from sklearn.linear_model import LinearRegression # 예제: 학습 시간과 성적 데이터 X = np.array([[1], [2], [3], [4], [5]]) # 학습 시간 (시간) y = np.array([50, 55, 60, 65, 70]) # 성적 (점수) # 선형 회귀 모델을 생성하고 학습시킵니다. model = LinearRegression() model.fit(X, y) # 새로운 데이터 예측 X_test = np.array([[6]]) # 예측하고 싶은 학습 시간 predictions = model.predict(X_test) # 예측된 성적 출력 print("Predicted score:", predictions)
Debug Info
Request Method: GET
POST Data: <QueryDict: {}>
Code Execution Output: