| @@ 266-284 (lines=19) @@ | ||
| 263 | return [a_val, a_val/len(vector)] |
|
| 264 | ||
| 265 | ||
| 266 | def multiplica(vector_x, vector_y): |
|
| 267 | """ |
|
| 268 | This function returns the sum of the multilica of two given vector. |
|
| 269 | ---------- |
|
| 270 | Parameters |
|
| 271 | ---------- |
|
| 272 | vector_x, vector_y : Output of the split vector function. |
|
| 273 | Two inputs can be the same vector or different vector with same length. |
|
| 274 | ------- |
|
| 275 | Returns |
|
| 276 | ------- |
|
| 277 | This function returns a number that is the sum of multiplicity of given two vector. |
|
| 278 | """ |
|
| 279 | assert isinstance(vector_x == np.ndarray), "Input should be numpy array" |
|
| 280 | assert isinstance(vector_y == np.ndarray), "Input should be numpy array" |
|
| 281 | a_val = 0 |
|
| 282 | for vec_x, vec_y in zip(vector_x, vector_y): |
|
| 283 | a_val = a_val + (vec_x * vec_y) |
|
| 284 | return a_val |
|
| 285 | ||
| 286 | ||
| 287 | def linear_coeff(vec_x, vec_y): |
|
| @@ 108-126 (lines=19) @@ | ||
| 105 | return [a_val, a_val/len(vector)] |
|
| 106 | ||
| 107 | ||
| 108 | def multiplica(vector_x, vector_y): |
|
| 109 | """ |
|
| 110 | This function returns the sum of the multilica of two given vector. |
|
| 111 | ---------- |
|
| 112 | Parameters |
|
| 113 | ---------- |
|
| 114 | vector_x, vector_y : Output of the split vector function. |
|
| 115 | Two inputs can be the same vector or different vector with same length. |
|
| 116 | ------- |
|
| 117 | Returns |
|
| 118 | ------- |
|
| 119 | This function returns a number that is the sum of multiplicity of given two vector. |
|
| 120 | """ |
|
| 121 | assert isinstance(vector_x == np.ndarray), "Input should be numpy array" |
|
| 122 | assert isinstance(vector_y == np.ndarray), "Input should be numpy array" |
|
| 123 | a_val = 0 |
|
| 124 | for vec_x, vec_y in zip(vector_x, vector_y): |
|
| 125 | a_val = a_val + (vec_x * vec_y) |
|
| 126 | return a_val |
|
| 127 | ||
| 128 | def linear_coeff(vec_x, vec_y): |
|
| 129 | """ |
|