Expected 2D array, got 1D array instead. How to solve it in Linear Regression? - sklearn-pandas

I don't understand why this error has occurred. I am doing exactly what my instructor is doing like. Please give me some solution or told me where is the mistake. Thank you.This is my code

try this, and search more
xtarin.reshape(-1,1)

Related

Find a algorithm to identify a plateau

I've got the following set of data :
As you can see, I've got two plateau at 1987 and 3757. The problem is I can't find a good algorithm in order to extract them.
I've already tried this algo, without any success.
Any help will be welcomed.
Regards

What can be approaches(algorithms) to solve the Atmospheric Turbulation problem?

Problem:
Atmospheric turbulation problem occurs due to foze,temperature variations, looking at to long distances with camera. There is a problem sample below
Example:
What I tried so far:
When I searched, I found this article which suggests to use
Dual Tree Complex Wavelet Transform(DTCWT). I followed through the
article and it seems like a good way to apply. Then I found this
implementation of the article in python code. I have run it and
seen the results but not as expected well.
I have simply took the average of some frames(let say 10), and get a result. I did it because the shaking pixels will be mostly true ones at any time. My results seems not bad after averaging.
What I need:
After searching much I am sure that this solution needs more frame to get one good frame. To do that I need a good image fusion algorithm.
I kindly request that you can suggest me any algorithm or any approaches I can try and go throuh to solve problem.
Note: I am familiar with OpenCV and C++ so priority is on these.

How to find if point is inside a polygon in oracle?

First time posting here. Forgive any ignorance.
But I need to construct a Oracle query that will determine how many points are inside a Polygon or Grid.
I tried to search for an example on the web, but I couldn't find any.
Any answer or response will be much appreciated. Thanks!

Mistake in paper about Bat Algorithm?

I need help from a person that knows the so called bat algorithm well. I have a problem with the third equation listed in the publication of Xin-She Yang from 2010. There it says that the velocity is updated adding:
(current_position - best_position) * random _number.
Why is it (current_position - best_position) and not (best_position - current_position)? I can't think of any case where the proposed variant is consistently better than the intuitively more appealing second variant. (best_position - current_position) can be interpreted as making a step with random step size into the direction of the currently best solution. The variant from the paper is the exact opposite, i.e. making steps into the direction that lead into the exact opposite direction than the one to the best.
In another paper that I found, they did switch both variables, i.e. they are using the second more intuitive variant. Did they understand it wrong, or did the author make an mistake?
Can anyone explain this to me, please? Thanks soo much in Advance!

What do you think about our professors pseudo-code for selection sort?

After I have read about selection sort and tried to write the code for it in java (Why doesn't my selection sort algorithm do what it's supposed to (java)?), and then looked at our script, I got confused. The pseudo-code for selection sort seems wrong or rather incomplete for me. It looks more similar to bubble sort than selection sort pseudo-code.
I mean, where is the important part of the code where you look for the smallest value of the array and put it to the beginning and repeat that process?
I hope this is the correct section to ask, and if not, please tell me where I can ask it (I would delete that question immediately). But it's very important for me to understand what has been written there and your opinion about it.
(I'm especially very curious and afraid how I shall write pseudo code for selection sort in an exam, if asked.)

Resources