Skip to content

Commit 76509d8

Browse files
committed
feat: more tests moved over
1 parent 7562da2 commit 76509d8

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src/index.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
* limitations under the License.
1313
* ==========================================================================
1414
*/
15-
export { KNeighborsRegressor } from './neighbors/KNeighborsRegressor'
16-
export { KNeighborsClassifier } from './neighbors/KNeighborsClassifier'
17-
export { makeRegression, makeLowRankMatrix } from './datasets/makeRegression'
15+
1816
export {
1917
LinearRegression,
2018
LinearRegressionParams
@@ -71,6 +69,9 @@ export {
7169
VotingClassifier,
7270
VotingClassifierParams
7371
} from './ensemble/VotingClassifier'
72+
export { KNeighborsRegressor } from './neighbors/KNeighborsRegressor'
73+
export { KNeighborsClassifier } from './neighbors/KNeighborsClassifier'
74+
7475
export { LinearSVC, LinearSVCParams } from './svm/LinearSVC'
7576
export { LinearSVR, LinearSVRParams } from './svm/LinearSVR'
7677

@@ -87,4 +88,6 @@ export {
8788
} from './tree/DecisionTree'
8889
export { trainTestSplit } from './model_selection/trainTestSplit'
8990
export { KFold } from './model_selection/KFold'
91+
export { crossValScore } from './model_selection/crossValScore'
92+
export { makeRegression, makeLowRankMatrix } from './datasets/makeRegression'
9093
export { setBackend, getBackend } from './tf-singleton'

src/neighbors/KNeighborsRegressor.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@
1313
* ==========================================================================
1414
*/
1515

16-
import { KNeighborsRegressor, setBackend } from '../index'
16+
import { KNeighborsRegressor, setBackend, KFold } from '../index'
17+
import { crossValScore } from '../model_selection/crossValScore'
1718
import { KNeighborsParams } from './KNeighborsBase'
1819
import { dataUrls } from '../datasets/datasets'
1920
import { arrayEqual } from '../utils'
20-
import { crossValScore } from '../model_selection/crossValScore'
21-
import { KFold } from '../model_selection/KFold'
2221
import { negMeanSquaredError } from '../model_selection/scorers'
2322
import '../jestTensorMatchers'
2423
import * as dfd from 'danfojs-node'
@@ -45,7 +44,7 @@ function testWithDataset(
4544
const X = Xy.slice([0, 0], [nSamples, nFeatures])
4645
const y = Xy.slice([0, nFeatures]).reshape([nSamples]) as Tensor1D
4746

48-
const scores = await crossValScore(
47+
const scores = await (crossValScore as any)(
4948
new KNeighborsRegressor(params),
5049
X,
5150
y,

0 commit comments

Comments
 (0)