965 views
1 1 vote

Here is LSTM predict model and i want to convert Linear Regression.

...
model.fit(x_train, y_train, epochs=10, batch_size=16)

trainPredict = model.predict(x_train)
testPredict = model.predict(x_test)
# invert predictions
trainPredict = scaler.inverse_transform(trainPredict)
trainY = scaler.inverse_transform([y_train])
testPredict = scaler.inverse_transform(testPredict)
testY = scaler.inverse_transform([y_test])

I tried,

y = trainPredict
x = range(0,len(y))
XGBModel = XGBRegressor()
XGBModel.fit(x,y, verbose=False)

And the result is :

Check failed: preds.Size() == info.labels_.Size() (1 vs. 56969) labels are not correctly providedpreds.size=1, label.size=56969'

I don't know why this error occurs. How can I solve this problem?

0% Accept Rate Accepted 0 answers out of 3 questions

Please log in or register to answer this question.

Related questions

1 1 vote
1 answers 1 answer
4.9k
4.9k views
tofighi asked Feb 18, 2020
4,918 views
Assuming we have a linear regression equation and some data points (sample), how can we calculate residual error for each data point, and total cost based on the metrics ...
0 0 votes
1 answers 1 answer
1.8k
1.8k views
tofighi asked Apr 11, 2019
1,813 views
For the following dataset, calculate the regression equation $\hat{y} = ax+b$datasetxy1423501075161002615036200
1 1 vote
1 1 answer
779
779 views
Harsh Grover asked May 16, 2019
779 views
Make a scatter plot where the x-axis is the height of the citizens and the y-axis is the weight of the citizens. The color of the points need to be different for males an...
1 1 vote
0 0 answers
7.8k
7.8k views
TomGoncalves asked Mar 24, 2019
7,824 views
Hi everyone.I'm currently working on my final project for a Data Science degree and after a month of literature review, exploratory analysis and model testing, I'm not su...
0 0 votes
1 1 answer
7.6k
7.6k views
tofighi asked Jan 26, 2023
7,569 views
Given the following sample dataset with 5 samples and 2 features:SampleFeature 1Feature 2Actual ValuePredicted Value1234623456345674567856789Calculate the residual errors...