2023.05.10 10:30 PM
Hi, I'm currently trying the advanced capstone and was slightly confused with the function in section 1.3
I'm not sure how the output makes sense, for the rows with lapId = 2, there are no events between those times, so how are the sensorValues generated? I can ignore lapId in the window join, but then testSection[`exercise1] reports 1.3 failing with wrong values, so I don't know what I'm doing wrong. I can post code if required but didn't want to potentially spoil it for others.
2023.05.11 02:43 AM
HI @rak1507 , wj takes the initial value within the window to be the prevailing values that existed before the window started.
So for example in the case of tempBackRight for the second time interval between 12:02:56.325 and 12:03:33.564:
Note that if we did want to consider the values that only occurred during the window, we could use wj1. Hope that helps. It is correct in this example to not have lapId as a column to join, the laps are represented already by the time and endTime values defining the lap window.
If you're still getting an error you can share your attempt with a spoiler tag and I can better help with where you might be going wrong.
Thanks,
Michaela
2023.05.11 02:43 AM
HI @rak1507 , wj takes the initial value within the window to be the prevailing values that existed before the window started.
So for example in the case of tempBackRight for the second time interval between 12:02:56.325 and 12:03:33.564:
Note that if we did want to consider the values that only occurred during the window, we could use wj1. Hope that helps. It is correct in this example to not have lapId as a column to join, the laps are represented already by the time and endTime values defining the lap window.
If you're still getting an error you can share your attempt with a spoiler tag and I can better help with where you might be going wrong.
Thanks,
Michaela
2023.05.11 03:42 AM
Hi Michaela,
Thanks for explaining the behaviour, I managed to fix the function and now it passes. I was joining on more columns than required. I see why you don't need to join on lapId, but does it not make sense to join on date/session? Any default values from another date or session don't seem like they would be particularly meaningful to me. Or is it expected to do any filtering before using the function, and therefore it's not an issue? This doesn't matter for the capstone, it's more out of curiosity and what might be expected in practice.
2023.05.11 04:01 AM
You are correct that in the real world in practice date or session could be considered - it depends what the end goal is.
Taking date for example you could either:
The same is true for session - we don't actually care what session it is - we just want averages per time of day.
Hope this makes sense!
2023.07.05 03:33 AM
hi, can you please help me with your solution. I'm stuck on this problem since 2 days.
2023.07.05 03:42 AM
Hi @ab , what error are you seeing? Can you provide some detail on what you have tried so far so I can better help? If you want to add your code for this solution you can use the spoiler tag when posting or feel free to IM it to me.
Thanks,
Michaela
2023.07.05 07:55 AM
#spoiler
distinctSensors: distinct select sensorId from sensor
crosspdt:(select from event) cross distinctSensors
windows:(crosspdt[`time];crosspdt[`endtime])
f:{avg each x}
wj[windows;`sensorId`time;select from crosspdt;(select from sensor;(f;`sensorValue))]
Pls suggest
2023.07.06 07:10 AM
When I try to run the above I get a `length error.
A few things I spotted:
windows:(crosspdt[`time];crosspdt[`endTime])
(avg;`sensorValue)
2023.07.06 10:07 PM
hey yes already worked. thanks for the help.
2023.07.28 12:57 AM
@rak1507 hi can you please help me with the 2.4 and 2.5 question as I'm stuck on it.
EMEA
Tel: +44 (0)28 3025 2242
AMERICAS
Tel: +1 (212) 447 6700
APAC
Tel: +61 (0)2 9236 5700
KX. All Rights Reserved.
KX and kdb+ are registered trademarks of KX Systems, Inc., a subsidiary of FD Technologies plc.