Skip to content

Commit

Permalink
Categoryencoding (#46)
Browse files Browse the repository at this point in the history
* revision for catencoding pr

* fixed tests and reviewer reccomendations

* fixed changed files for clean pr

* fixed indentation and linting error

* fixed return statement in preprocessing function
  • Loading branch information
AdamLang96 committed Oct 3, 2022
1 parent b14736b commit c9f3a1f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tfjs-layers/src/layers/preprocessing/preprocessing_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ export function encodeCategoricalInputs(inputs: Tensor|Tensor[],
return binCounts;
}

if(weights === null || weights === undefined) {
throw new ValueError(
`When outputMode is 'tfIdf', weights must be provided.`
);
} else {
if (weights) {
return mul(binCounts, weights);
} else {
throw new ValueError(
`When outputMode is 'tfIdf', weights must be provided.`
);
}
}

0 comments on commit c9f3a1f

Please sign in to comment.