Skip to main content
Tweeted twitter.com/StackMma/status/1278116162518355968
Became Hot Network Question
added 20 characters in body; edited title
Source Link
C. E.
  • 71.2k
  • 6
  • 141
  • 269

How to drop some points that don't lie in a line

I have some data like:

data = Uncompress[FromCharacterCode[
  Flatten[ImageData[Import["https://i.sstatic.net/1E5DB.png"], "Byte"]]]]

If we use FindAnomalies then we can find aan outlier:

abponts = FindAnomalies[data]

{{357., 436.5}}

But I don't want to use FindAnomalies to do this, because it is too slow and I don't know how to use other languages to imitate such a neural network function.

The current idea is to fit a line for all points, then calculate the distance from the point to the fitting line. But it seems this distancelike the outlier in data is hard to distinguish thatas an outlier. The red line is the fitting line in follow:

Show[ListLinePlot[SortBy[data, Last], 
  PlotRange -> {{300, 1000}, {0, 2000}}], 
 Plot[Evaluate[Fit[data, {1, x}, x]], {x, 300, 1000}, 
  PlotStyle -> Red], ListPlot[data, PlotStyle -> Blue]]

enter image description here

Could anybody can give me some advice?

How to drop some points that don't in a line

I have some data like:

data = Uncompress[FromCharacterCode[
  Flatten[ImageData[Import["https://i.sstatic.net/1E5DB.png"], "Byte"]]]]

If we use FindAnomalies then we can find a outlier:

abponts = FindAnomalies[data]

{{357., 436.5}}

But I don't want to use FindAnomalies to do this, because it too slow and I don't know how to use other languages to imitate such neural network function.

The current idea is to fit a line for all points, then calculate the distance from the point to the fitting line. But it seems this distance is hard to distinguish that outlier. The red line is the fitting line in follow:

Show[ListLinePlot[SortBy[data, Last], 
  PlotRange -> {{300, 1000}, {0, 2000}}], 
 Plot[Evaluate[Fit[data, {1, x}, x]], {x, 300, 1000}, 
  PlotStyle -> Red], ListPlot[data, PlotStyle -> Blue]]

enter image description here

Could anybody can give me some advice?

How to drop points that don't lie in a line

I have some data like:

data = Uncompress[FromCharacterCode[
  Flatten[ImageData[Import["https://i.sstatic.net/1E5DB.png"], "Byte"]]]]

If we use FindAnomalies then we can find an outlier:

abponts = FindAnomalies[data]

{{357., 436.5}}

But I don't want to use FindAnomalies to do this, because it is too slow and I don't know how to use other languages to imitate such a neural network function.

The current idea is to fit a line for all points, then calculate the distance from the point to the fitting line. But it seems like the outlier in data is hard to distinguish as an outlier. The red line is the fitting line in follow:

Show[ListLinePlot[SortBy[data, Last], 
  PlotRange -> {{300, 1000}, {0, 2000}}], 
 Plot[Evaluate[Fit[data, {1, x}, x]], {x, 300, 1000}, 
  PlotStyle -> Red], ListPlot[data, PlotStyle -> Blue]]

enter image description here

Could anybody can give me some advice?

deleted 101 characters in body
Source Link
yode
  • 27.2k
  • 4
  • 66
  • 174

I have some data like:

data = Uncompress[FromCharacterCode[
  Flatten[ImageData[Import["https://i.sstatic.net/1E5DB.png"], "Byte"]]]]

{{311.,191.},{324.5,374.5},{357.,436.5},{328.,730.5},{333.,1196.},{334.,1552.},{344.,1827.5}}

If we use FindAnomalies then we can find a outlier:

abponts = FindAnomalies[data]

{{357., 436.5}}

But I don't want to use FindAnomalies to do this, because it too slow and I don't know how to use other languages to imitate such neural network function.

The current idea is to fit a line for all points, then calculate the distance from the point to the fitting line. But it seems this distance is hard to distinguish that outlier. The red line is the fitting line in follow:

Show[ListLinePlot[SortBy[data, Last], 
  PlotRange -> {{300, 1000}, {0, 2000}}], 
 Plot[Evaluate[Fit[data, {1, x}, x]], {x, 300, 1000}, 
  PlotStyle -> Red], ListPlot[data, PlotStyle -> Blue]]

enter image description here

Could anybody can give me some advice?

I have some data like:

data = Uncompress[FromCharacterCode[
  Flatten[ImageData[Import["https://i.sstatic.net/1E5DB.png"], "Byte"]]]]

{{311.,191.},{324.5,374.5},{357.,436.5},{328.,730.5},{333.,1196.},{334.,1552.},{344.,1827.5}}

If we use FindAnomalies then we can find a outlier:

abponts = FindAnomalies[data]

{{357., 436.5}}

But I don't want to use FindAnomalies to do this, because it too slow and I don't know how to use other languages to imitate such neural network function.

The current idea is to fit a line for all points, then calculate the distance from the point to the fitting line. But it seems this distance is hard to distinguish that outlier. The red line is the fitting line in follow:

Show[ListLinePlot[SortBy[data, Last], 
  PlotRange -> {{300, 1000}, {0, 2000}}], 
 Plot[Evaluate[Fit[data, {1, x}, x]], {x, 300, 1000}, 
  PlotStyle -> Red], ListPlot[data, PlotStyle -> Blue]]

enter image description here

Could anybody can give me some advice?

I have some data like:

data = Uncompress[FromCharacterCode[
  Flatten[ImageData[Import["https://i.sstatic.net/1E5DB.png"], "Byte"]]]]

If we use FindAnomalies then we can find a outlier:

abponts = FindAnomalies[data]

{{357., 436.5}}

But I don't want to use FindAnomalies to do this, because it too slow and I don't know how to use other languages to imitate such neural network function.

The current idea is to fit a line for all points, then calculate the distance from the point to the fitting line. But it seems this distance is hard to distinguish that outlier. The red line is the fitting line in follow:

Show[ListLinePlot[SortBy[data, Last], 
  PlotRange -> {{300, 1000}, {0, 2000}}], 
 Plot[Evaluate[Fit[data, {1, x}, x]], {x, 300, 1000}, 
  PlotStyle -> Red], ListPlot[data, PlotStyle -> Blue]]

enter image description here

Could anybody can give me some advice?

deleted 2 characters in body
Source Link
yode
  • 27.2k
  • 4
  • 66
  • 174

I have some data like:

data = Uncompress[FromCharacterCode[
  Flatten[ImageData[Import["https://i.sstatic.net/1E5DB.png"], "Byte"]]]]

{{311.,191.},{324.5,374.5},{357.,436.5},{328.,730.5},{333.,1196.},{334.,1552.},{344.,1827.5}}

If we use FindAnomalies then we can find a outlier:

abponts = FindAnomalies[data3]FindAnomalies[data]

{{357., 436.5}}

But I don't want to use FindAnomalies to do this, because it too slow and I don't know how to use other languages to imitate such neural network function.

The current idea is to fit a line for all points, then calculate the distance from the point to the fitting line. But it seems this distance is hard to distinguish that outlier. The red line is the fitting line in follow:

Show[ListLinePlot[SortBy[data, Last], 
  PlotRange -> {{300, 1000}, {0, 2000}}], 
 Plot[Evaluate[Fit[data, {1, x}, x]], {x, 300, 1000}, 
  PlotStyle -> Red], ListPlot[data3ListPlot[data, PlotStyle -> Blue]]

enter image description here

Could anybody can give me some advice?

I have some data like:

data = Uncompress[FromCharacterCode[
  Flatten[ImageData[Import["https://i.sstatic.net/1E5DB.png"], "Byte"]]]]

{{311.,191.},{324.5,374.5},{357.,436.5},{328.,730.5},{333.,1196.},{334.,1552.},{344.,1827.5}}

If we use FindAnomalies then we can find a outlier:

abponts = FindAnomalies[data3]

{{357., 436.5}}

But I don't want to use FindAnomalies to do this, because it too slow and I don't know how to use other languages to imitate such neural network function.

The current idea is to fit a line for all points, then calculate the distance from the point to the fitting line. But it seems this distance is hard to distinguish that outlier. The red line is the fitting line in follow:

Show[ListLinePlot[SortBy[data, Last], 
  PlotRange -> {{300, 1000}, {0, 2000}}], 
 Plot[Evaluate[Fit[data, {1, x}, x]], {x, 300, 1000}, 
  PlotStyle -> Red], ListPlot[data3, PlotStyle -> Blue]]

enter image description here

Could anybody can give me some advice?

I have some data like:

data = Uncompress[FromCharacterCode[
  Flatten[ImageData[Import["https://i.sstatic.net/1E5DB.png"], "Byte"]]]]

{{311.,191.},{324.5,374.5},{357.,436.5},{328.,730.5},{333.,1196.},{334.,1552.},{344.,1827.5}}

If we use FindAnomalies then we can find a outlier:

abponts = FindAnomalies[data]

{{357., 436.5}}

But I don't want to use FindAnomalies to do this, because it too slow and I don't know how to use other languages to imitate such neural network function.

The current idea is to fit a line for all points, then calculate the distance from the point to the fitting line. But it seems this distance is hard to distinguish that outlier. The red line is the fitting line in follow:

Show[ListLinePlot[SortBy[data, Last], 
  PlotRange -> {{300, 1000}, {0, 2000}}], 
 Plot[Evaluate[Fit[data, {1, x}, x]], {x, 300, 1000}, 
  PlotStyle -> Red], ListPlot[data, PlotStyle -> Blue]]

enter image description here

Could anybody can give me some advice?

Source Link
yode
  • 27.2k
  • 4
  • 66
  • 174
Loading