Skip to main content

# Bones or No Bones? More Deephaven predictions

· 3 min read

Last week we made our prediction of Bones/No Bones days. How did we do?

We predicted a Bones day, but Noodle had other plans. Considering Monday was a No Bones day, we shrugged it off and figured it's ok to be wrong and appeased ourselves with self-care.

``from deephaven.TableTools import newTable, stringColaccuracy = newTable(    stringCol("Date", "11/1/2021", "11/2/2021", "11/3/2021", "11/4/2021", "11/5/2021"),    stringCol("Noodles_Says", "No Bones", "No Bones", "Bones", "Bones", "Bones"),    stringCol("Prediction", "Bones", "Bones", "Bones", "Bones", "No Bones")    )``

Nevertheless, the real question is, how can we better predict Bones days? In a comment on Jonathan's TikTok (@jongraz), I suggested that perhaps Noodle is so amazing because he bases his behavior on a planetary configuration. Many astrologists believe that when Mercury and Jupiter are in conjunction, it brings good luck, positivity, and optimism. So, as an interesting use case, we'll use Deephaven to see if the separation of Mercury and Jupiter is what causes Noodle to have No Bones days.

Here, we have a function that 1) performs a calculation to find the separation of the two planets, and 2) sees how this correlates with Bones and No Bones days.

This model accurately determines Bones days 68% of the time, and No Bones days 71% of the time! Decent odds.It also looks like Noodle prefers to take it easy and relax the more closely the planets align.

Take a look at our predictions for this week.

``from deephaven.TableTools import newTable, stringColfuture = newTable(    stringCol("Date", "11/8/2021", "11/9/2021", "11/10/2021", "11/11/2021", "11/12/2021"),    stringCol("Prediction", "No Bones", "No Bones", "No Bones", "No Bones", "Bones"))``

Looks like a week to stay in your comfiest pajamas and binge your leftover Halloween candy. However, remember that Noodle likes sun - the odds are about 50/50 on a sunny day.

``from deephaven.TableTools import readCsvnoodle_pug = readCsv("https://media.githubusercontent.com/media/deephaven/examples/main/NoodlePug/noodle_pug.csv")number_per_day = noodle_pug.dropColumns("Date", "Weather_NYC").sumBy("Day_of_Week")number_per_weather = noodle_pug.dropColumns("Date", "Day_of_Week").sumBy("Weather_NYC")``

Will sunny days counter the separation of the planets? What really causes No Bones days? We think it's a complex mixture of all these models.

Stay tuned for updates once Noodle determines our fate for the week.

## Try your own model​

Do you have ideas for better predictors of Bones/No Bones days?

Test it out! Then let us know on Twitter.

In a terminal enter:

``compose_file=https://raw.githubusercontent.com/deephaven/deephaven-core/main/containers/python-examples/docker-compose.ymlcurl  -O "\${compose_file}"docker-compose pulldocker-compose up -d``

Navigate to http://localhost:10000/ide/, then use the script below to open some tables in the Deephaven IDE.

To try out our code for the planet separation:

``from deephaven.TableTools import newTable, stringColos.system("pip install ephem")import ephemdef sep(date):    m = ephem.Mercury()    j = ephem.Jupiter()    m.compute(date)    j.compute(date)    return (int)(10*ephem.separation(m, j))planet = noodle_pug.update("Mercury_Jupiter_sep = (int)sep(Date)","Prediction = (Mercury_Jupiter_sep <= 13) ? `No Bones` : `Bones`")future = newTable(    stringCol("Date", "11/8/2021", "11/9/2021", "11/10/2021", "11/11/2021", "11/12/2021"))\    .update("Prediction = ((int)sep(Date)<=13) ? `No Bones` : `Bones`")``

If you like our code, read our Quick Start guide for launching Deephaven with Docker to get started on your own projects.