Skip to content

Commit

Permalink
fittingData parameter renamed to trainData
Browse files Browse the repository at this point in the history
  • Loading branch information
gyrdym committed Oct 25, 2019
1 parent 6050899 commit 7dc6c4e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ import 'package:ml_linalg/distance.dart';
import 'package:ml_linalg/dtype.dart';

KnnClassifier createKnnClassifier(
DataFrame fittingData,
DataFrame trainData,
String targetName,
int k,
KernelType kernelType,
Distance distance,
DType dtype,
) {
validateTrainData(fittingData, [targetName]);
validateTrainData(trainData, [targetName]);

final splits = featuresTargetSplit(fittingData,
final splits = featuresTargetSplit(trainData,
targetNames: [targetName],
).toList();

Expand Down
8 changes: 4 additions & 4 deletions lib/src/classifier/knn_classifier/knn_classifier.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ import 'package:ml_linalg/dtype.dart';
abstract class KnnClassifier implements Assessable, Classifier {
/// Parameters:
///
/// [fittingData] Labelled observations, among which will be searched [k]
/// [trainData] Labelled observations, among which will be searched [k]
/// nearest to the given unlabelled observations neighbours. Must contain
/// [targetName] column.
///
/// [targetName] A string, that serves as a name of the column, that contains
/// labels (or outcomes).
///
/// [k] a number of nearest neighbours to be found among [fittingData]
/// [k] a number of nearest neighbours to be found among [trainData]
///
/// [kernel] a type of a kernel function, that will be used to predict an
/// outcome for a new observation
Expand All @@ -40,13 +40,13 @@ abstract class KnnClassifier implements Assessable, Classifier {
/// affect performance or accuracy of the computations. Default value is
/// [DType.float32]
factory KnnClassifier(
DataFrame fittingData,
DataFrame trainData,
String targetName,
int k,
{
KernelType kernel = KernelType.gaussian,
Distance distance = Distance.euclidean,
DType dtype = DType.float32,
}
) => createKnnClassifier(fittingData, targetName, k, kernel, distance, dtype);
) => createKnnClassifier(trainData, targetName, k, kernel, distance, dtype);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ class KnnClassifierFactoryImpl implements KnnClassifierFactory {
const KnnClassifierFactoryImpl();

@override
KnnClassifier create(String targetName,
KnnClassifier create(
String targetName,
List<num> classLabels,
Kernel kernel,
KnnSolver solver,
Expand Down

0 comments on commit 7dc6c4e

Please sign in to comment.