spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sean Owen <sro...@gmail.com>
Subject Re: A question on extrapolation of a nonlinear curve fit beyond x value
Date Tue, 05 Jan 2021 15:41:53 GMT
You need to fit a curve to those points using your chosen model. It sounds
like you want scipy's curve_fit maybe? matplotlib is for plotting, not
curve fitting.
But that and the plotting are nothing to do with Spark here. Spark gives
you the data as pandas so you can use all these tools as you like.

On Tue, Jan 5, 2021 at 9:38 AM Mich Talebzadeh <mich.talebzadeh@gmail.com>
wrote:

> Thanks again
>
> Just to clarify, I want to see the average price for year 2021, 2022 etc
> based on the best fit. So naively if someone asked a question what the
> average price will be in 2022, I should be able to make some predictions.
>
> I can of course crudely use pen and pencil like shown in the attached
> figure, but I was wondering if this is possible with anything that
> matplotlib offers?
>
>
>
> [image: Capture123.PNG]
>
>
>
> *Disclaimer:* Use it at your own risk. Any and all responsibility for any
> loss, damage or destruction of data or any other property which may arise
> from relying on this email's technical content is explicitly disclaimed.
> The author will in no case be liable for any monetary damages arising from
> such loss, damage or destruction.
>
>
>
>
> On Tue, 5 Jan 2021 at 15:22, Sean Owen <srowen@gmail.com> wrote:
>
>> You will need to use matplotlib on the driver to plot in any event. If
>> this is a single extrapolation, over 11 data points, you can just use Spark
>> to do the aggregation, call .toPandas, and do whatever you want in the
>> Python ecosystem to fit and plot that result.
>>
>>>

Mime
View raw message