# New Object Early Community Build #2: FluidPolynomialRegressor (NOW WITH SC TOO)

**URL:** <https://discourse.flucoma.org/t/new-object-early-community-build-2-fluidpolynomialregressor-now-with-sc-too/2093>\
**Category:** Development and Maintenance\
**Created:** [August 30, 2023, 1:33pm UTC](https://discourse.flucoma.org/t/new-object-early-community-build-2-fluidpolynomialregressor-now-with-sc-too/2093 "2023-08-30T13:33:25Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![mccrmck](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/mccrmck/32/1464_2.png) [@mccrmck](https://discourse.flucoma.org/u/mccrmck)\
**Post date:** [September 2, 2023, 4:05pm UTC](https://discourse.flucoma.org/t/new-object-early-community-build-2-fluidpolynomialregressor-now-with-sc-too/2093/21 "2023-09-02T16:05:56Z")

</div>

> [@tremblap](#):
>
> the function is supposed to be called after the response.

Okay well in that case - it seems that action function called in `FluidPolynomialRegressor.predict` (EDIT: also the `.fit` method - maybe they all have the same implementation?) is the source of the errors I’m getting - maybe you can doublecheck the callback implementation for that method? When you get a chance, of course…it’s the weekend, after all! 😉

---

<div class="post-metadata">

**Author:** ![tremblap](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/tremblap/32/5_2.png) [@tremblap](https://discourse.flucoma.org/u/tremblap)\
**Post date:** [September 2, 2023, 9:47pm UTC](https://discourse.flucoma.org/t/new-object-early-community-build-2-fluidpolynomialregressor-now-with-sc-too/2093/22 "2023-09-02T21:47:00Z")

</div>

> [@mccrmck](#):
>
> maybe they all have the same implementation

it is a FluCoMa-wide implementation. so I’ll check but it should be broken everywhere.

---

<div class="post-metadata">

**Author:** ![mccrmck](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/mccrmck/32/1464_2.png) [@mccrmck](https://discourse.flucoma.org/u/mccrmck)\
**Post date:** [September 3, 2023, 11:41am UTC](https://discourse.flucoma.org/t/new-object-early-community-build-2-fluidpolynomialregressor-now-with-sc-too/2093/23 "2023-09-03T11:41:01Z")

</div>

So in the above code the `degree` and `tikhonov` knobs (degreekhoknobs? Sorry, couldn’t help myself) set their respective values and then call a function that looks something like this:

```javascript
~polyReg.fit(inDataSet, outDataSet,{
    ~polyReg.predict(questionDataSet, answerDataSet,{ 
        answerDataSet.dump( /* cool stuff happens here*/ )
    })
})

```

This should be safe, right? Or am I totally out to lunch? The errors I’m getting when this gets evaluated too frequently suggest either 1.) `.predict` is being called before `.fit` is finished and 2). I’m trying to `.dump` the answerDataSet before `.predict` has finished.

(Perhaps this is going beyond the scope of this thread? Should I open a new thread/bug report on github/something else?)

---

<div class="post-metadata">

**Author:** ![tremblap](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/tremblap/32/5_2.png) [@tremblap](https://discourse.flucoma.org/u/tremblap)\
**Post date:** [September 3, 2023, 12:51pm UTC](https://discourse.flucoma.org/t/new-object-early-community-build-2-fluidpolynomialregressor-now-with-sc-too/2093/24 "2023-09-03T12:51:02Z")

</div>

deffo for github - because this is working for others and as far as I am aware I’m doing the same thing here we’ve done for all objects and nested responding function like you do here should work… so first thing is to try to public objects (any other dataset ones will do) and if you have similar behaviour this is a github bug for sure!

---

<div class="post-metadata">

**Author:** ![mccrmck](https://discourse.flucoma.org/user_avatar/discourse.flucoma.org/mccrmck/32/1464_2.png) [@mccrmck](https://discourse.flucoma.org/u/mccrmck)\
**Post date:** [September 6, 2023, 10:57am UTC](https://discourse.flucoma.org/t/new-object-early-community-build-2-fluidpolynomialregressor-now-with-sc-too/2093/25 "2023-09-06T10:57:21Z")

</div>

Will do!

[Previous page](https://discourse.flucoma.org/t/new-object-early-community-build-2-fluidpolynomialregressor-now-with-sc-too/2093.md?page=1)
