Don't use test data if there is just one config

If classifier models cannot be compared, there is no reason to test.
This commit is contained in:
Eike Kettner 2020-09-07 20:01:30 +02:00
parent 2f9f981742
commit c9bd57592b

View File

@ -66,7 +66,8 @@ final class StanfordTextClassifier[F[_]: Sync: ContextShift](
} yield res
def splitData(logger: Logger[F], in: RawData): F[TrainData] = {
val nTest = (in.count * 0.15).toLong
val f = if (cfg.classifierConfigs.size > 1) 0.15 else 0.0
val nTest = (in.count * f).toLong
val td =
TrainData(in.file.resolveSibling("train.txt"), in.file.resolveSibling("test.txt"))