We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
fromsklearnimportlinear_modelimportpandasaspddefmain():m,n=map(int,input().strip().split())#upackage x, y traindf_list=[list(map(float,input().split()))foriinrange(n)]df_train=pd.DataFrame(df_list)#input number of x_pred feature q=int(input())#x_pred feature df_list_pred=[list(map(float,input().split()))foriinrange(q)]df_pred=pd.DataFrame(df_list_pred)#train test splitX_train,y_train=df_train.iloc[:,:m],df_train.iloc[:,m]#trainmodel=linear_model.LinearRegression().fit(X_train,y_train)#predicty_pred=model.predict(df_pred)fornuminy_pred:print(round(num,2))if__name__=="__main__":main()
Day 9: Multiple Linear Regression
You are viewing a single comment's thread. Return to all comments →
Solution with without runtime error.