[Community Puzzle] Feature Extraction

https://www.codingame.com/training/easy/feature-extraction

Send your feedback or ask for help here!

Created by @codybumba,validated by @DidierC,@myhz and @SelrahC-Twin.
If you have any issues, feel free to ping them.

Hello,

I pass all 4 tests and some custom ones, but I fail at validators 2 and 3.

Would you have similar validators I could use to check ?

Thanks a lot

For both Validators 2 and 3, the weights are the same as their Test Case counterparts but the signs of some of the weights are different. For Validator 2 in particular, all the other inputs are the same as Test Case 2. You may create additional custom cases based on this.

For information purposes, I was using the method :

signal.convolve2d(pm, ker, mode=‘valid’)

from the signal package in the scipy library. All tests passed but didn’t work during validation.

Since I couldn’t figure it out, i wrote my own routine and passed all validators.

Thanks for the replies.

Please help, because how is that posible that for case 3 and 4 when I have kernel weight size 5 x 5 and answere must contain 6 X 6 ??

247 152 122 236 159 118 172 233 133 121
174 201 193 86 94 203 42 3 69 21
221 56 36 182 108 163 48 240 119 89
162 150 97 219 180 133 78 51 237 62
189 100 234 246 138 50 69 201 90 98
42 155 149 181 172 194 17 234 134 52
247 249 131 244 11 227 32 221 14 197
132 246 162 16 24 185 15 146 156 227
121 3 118 199 241 231 18 12 152 147
185 231 237 114 239 145 215 33 218 227

1 1 1 1 1
1 2 2 2 1
1 2 3 2 1
1 2 2 2 1
1 1 1 1 1

my output of first line is
Found:

5238 5033 4882 4664 4140

Expected:

5238 5033 4882 4664 4140 3970
???

I think it helps by referring to this animation stated in the statement:

For an animated visualization please refer to this link: tinyurl.com/nk0vnyel

You can cover 6 times ^ when you move from left to right, and cover 6 times ^ when you move from top to bottom. So there are 36 numbers in total in the output.

^:

  1. 1 to 5
  2. 2 to 6
  3. 3 to 7
  4. 4 to 8
  5. 5 to 9
  6. 6 to 10

Oh my Gosh; I found solution, and all cases I did passed. My problem is solved. :slight_smile:

This was enjoyable to code, thank you!