Skip to content

Commit ecc4160

Browse files
committed
Cleaned up more of the api
1 parent 8da0da4 commit ecc4160

3 files changed

Lines changed: 5 additions & 10 deletions

File tree

src/dummy/dummy.classifier.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@ import { PredictorMixin } from '../mixins'
2626
/**
2727
* Supported strategies for this classifier.
2828
*/
29-
type Strategy = 'mostFrequent' | 'uniform' | 'constant'
3029

3130
export interface DummyClassifierParams {
32-
strategy?: Strategy
31+
strategy?: 'mostFrequent' | 'uniform' | 'constant'
3332
fill?: number
3433
}
3534

src/dummy/dummy.regressor.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ import { PredictorMixin } from '../mixins'
2626
* Supported strategies for DummyRegressor
2727
*/
2828

29-
type Strategy = 'mean' | 'median' | 'constant'
30-
3129
export interface DummyRegressorParams {
3230
/**
3331
* The strategy that this DummyRegressor will use to make a prediction.
@@ -36,7 +34,7 @@ export interface DummyRegressorParams {
3634
* If 'mean' is chosen then the DummyRegressor will just "guess" the 'mean'
3735
* of the target variable as it's prediction.
3836
*/
39-
strategy: Strategy
37+
strategy?: 'mean' | 'median' | 'constant'
4038

4139
/**
4240
* In the case where you chose 'constant' as your strategy, the fill number
@@ -49,9 +47,7 @@ export default class DummyRegressor extends PredictorMixin {
4947
$fill: number
5048
$strategy: string
5149

52-
constructor(
53-
{ strategy, fill }: DummyRegressorParams = { strategy: 'mean' }
54-
) {
50+
constructor({ strategy = 'mean', fill }: DummyRegressorParams = {}) {
5551
super()
5652
this.$fill = fill || 0
5753
this.$strategy = strategy

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"outDir": "./dist" /* Redirect output structure to the directory. */,
1010
"strict": true /* Enable all strict type-checking options. */,
1111
"noImplicitAny": true /* Raise error on expressions and declarations with an implied 'any' type. */,
12-
// "noUnusedLocals": true, /* Report errors on unused locals. */
13-
// "noUnusedParameters": true, /* Report errors on unused parameters. */
12+
// "noUnusedLocals": true /* Report errors on unused locals. */,
13+
// "noUnusedParameters": true /* Report errors on unused parameters. */,
1414
"noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */,
1515
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
1616
"resolveJsonModule": true /* Include modules imported with '.json' extension */,

0 commit comments

Comments
 (0)