-1

I'm trying to bind a function to a button in my application so that it triggers an anomaly detection. Here's the code I have so far:

button = app.button("Execute anomaly-detection")
app.place(button)

ailtair_chart1 = app.altair_chart(title='MLII', data=df['MLII'])
app.place(line_chart1)

ailtair.bind(computeAndPlotAnomalies, df['MLII'], windowSize, top_k, triggers=[button])

app.register()

However, when I click on the button, I get Error: Internal Server Error. Runtime error executing computeAndPlotAnomalies. Can anyone help me figure out what's going wrong?

Chen Sofia
  • 11
  • 2
  • 1
    Welcome to Stack Overflow. Please checkout the [tour] and [ask]. What is the `system error` that you got? Include it in your question as text. – Marcelo Paco Apr 12 '23 at 19:44
  • I was refering to the error when using the Shapelets dataapp which is. Error: Internal Server Error. Runtime error executing computeAndPlotAnomalies – Chen Sofia Apr 13 '23 at 13:29

1 Answers1

0

ok in your case scenario, I will assume that when creating the function you returned the right data type.

otherwise if your data is a line chart you should try to use the line:chart function as this

button = app.button("Execute anomaly-detection")

app.place(button)

line_chart1 = app.line_chart(title='MLII', data=df['MLII'])

app.place(line_chart1)

line_chart1.bind(computeAndPlotAnomalies, df['MLII'], windowSize, top_k, triggers=[button])

app.register()

if you have any more trouble after this example, you can look at your documentation https://shapelets.io/doc/ https://github.com/shapelets/shapelets-demo