Conversation
|
Hey, could you help me fix this issue? I cloned your repository and ran ^^^ is non issue, I realised I was looking at your fork but you are working on a branch |
|
Ok, I resolved the error from doc processor You were getting this error due to introducing a TS Native Interface Custom Interface ^^ has an ID that we can use to reference its definition within Anyways, thanks @BenjaminMcDonald for helping us improving the documentation processor =) !! |
|
Update the branch with added support for constraint in doc types added multinomial naive bayes. This with your above patch fixed the issue with the document generation. yarn test now completes |
|
I am going to write some TODOs for myself here TODO: to the screen. Remove the console logs. on the screen (?) Some methods parameters in the docstrings are missing either description or a default value |
1. Removing duplicate interface types. InterfaceFitModel and InterfaceFitModelAsArray can be consolidated 2. removing modelState, we can just save them as class fields 3. Using Type1DMatrix and Type2DMatrix instead of ReadOnlyArray as type 4. Refactring toJSON and fromJSON accordingly 5. Refactoring fitModel function, mostly typings 6. using tf's sum reduction to get product reduced row
1. toJSON and fromJSON now leverages reshape method 2. fixing TF warnings with typing
|
I propose we exclude from this PR. I think it's best to introduce this feature in a separate PR that implements it globally throughout the existing models. |
src/lib/naive_bayes/gaussian.ts
Outdated
| public predict(X: Type2DMatrix<number> = []): number[] { | ||
| validateMatrix2D(X); | ||
| let clonedX = X; | ||
| public model(): InterfaceFitModel<T> { |
There was a problem hiding this comment.
Do we need this when we already have toJSON?
src/lib/naive_bayes/gaussian.ts
Outdated
| import { IMlModel, Type1DMatrix, Type2DMatrix } from '../types'; | ||
| import math from '../utils/MathExtra'; | ||
|
|
||
| const { isMatrix } = math.contrib; |
There was a problem hiding this comment.
We should start using ops/tensor_ops.ts for the Tensor / Matrix validations. It relies on TF.js for validation =)
src/lib/naive_bayes/gaussian.ts
Outdated
|
|
||
| if (this.clone) { | ||
| clonedX = cloneDeep(X); | ||
| public *predictIterator( |
There was a problem hiding this comment.
I am going to do some research on Iterators. I think it's a powerful feature from TS that we haven't been using so far and we should think about supporting it globally in v2 release.
|
I think this PR Is fine to be merged now!! GREAT WORK and thanks for your second contributions @BenjaminMcDonald !!! I will address the documentation issue that I describe in #161 in a separate branch. |
Rewrite of GaussianNB with Tensorflow support.
The PR also introduces:
predictIterableIteration