Good day. Engaged in regression tasks using sclearn and xgboost. However, the task of forecasting is slightly different, can you give an example in what form should the data and sample code in python be used to work with using xgboost. In regression tasks, I similarly collected data in the form of a similar set of rows
1;34;234;234;123;2;321;2;123213;24534;3;278 Where the input vector was n-1 parameters, and the predicted value is the last column. As I understand it in forecasting tasks, the string itself is the same parameter that changes over time, while in regression problems there are several different parameters for which we predict one. The question is - how do tasks of planning and regression differ at the programming level? Those. input data is
x0 x1 x2 x3 x4 x5 y 0.392689 0.117810 0.242750 0.931792 0.972802 0.898693 0.429941 0.569055 0.622889 0.762683 0.095271 0.101407 0.510155 0.542256 0.939509 0.993534 0.772005 0.164555 0.800897 0.591883 0.190720 0.284297 0.292773 0.290652 0.045383 0.564894 0.347683 0.014610 where we predict the value of y. And the data have the following form:
x1 0.284297 0.292773 0.290652 0.045383 0.564894 0.347683 0.014610 0.961696 x2 0.939509 0.993534 0.772005 0.164555 0.800897 0.591883 0.190720 0.040162 where it is necessary to predict further values of x1, x2, .. what is the difference in terms of code?
import xgboost as xgb import pandas as pd import numpy as np import math from sklearn.metrics import confusion_matrix, mean_squared_error from sklearn.datasets import load_iris, load_digits, load_boston from sklearn.metrics import mean_absolute_error,mean_squared_error,median_absolute_error, accuracy_score df = pd.read_csv('file1.csv',";",header=None) X_train = df.drop(7,axis=1) Y_train = df[7] test_data = pd.read_csv('file2.csv',";",header=None) X_test = test_data.drop(7,axis=1) Y_test = test_data[7] xgb_model = xgb.XGBRegressor(max_depth) cl = xgb_model.fit(X_train,Y_train) predictions = cl.predict(X_test) actuals = Y_test print(mean_absolute_error(actuals, predictions)) print(mean_squared_error(actuals, predictions)) print(median_absolute_error(actuals, predictions)) Conventionally, this code will equally predict the future value of x1 for the second sample and y for the first sample?
yfor theXparameter set.xhe won't predict - MaxU