mlpack 4.6.1__cp313-cp313-win_amd64.whl → 4.6.2__cp313-cp313-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mlpack/__init__.py +1 -1
- mlpack/adaboost_classify.cp313-win_amd64.pyd +0 -0
- mlpack/adaboost_probabilities.cp313-win_amd64.pyd +0 -0
- mlpack/adaboost_train.cp313-win_amd64.pyd +0 -0
- mlpack/approx_kfn.cp313-win_amd64.pyd +0 -0
- mlpack/arma_numpy.cp313-win_amd64.pyd +0 -0
- mlpack/bayesian_linear_regression.cp313-win_amd64.pyd +0 -0
- mlpack/cf.cp313-win_amd64.pyd +0 -0
- mlpack/dbscan.cp313-win_amd64.pyd +0 -0
- mlpack/decision_tree.cp313-win_amd64.pyd +0 -0
- mlpack/det.cp313-win_amd64.pyd +0 -0
- mlpack/emst.cp313-win_amd64.pyd +0 -0
- mlpack/fastmks.cp313-win_amd64.pyd +0 -0
- mlpack/gmm_generate.cp313-win_amd64.pyd +0 -0
- mlpack/gmm_probability.cp313-win_amd64.pyd +0 -0
- mlpack/gmm_train.cp313-win_amd64.pyd +0 -0
- mlpack/hmm_generate.cp313-win_amd64.pyd +0 -0
- mlpack/hmm_loglik.cp313-win_amd64.pyd +0 -0
- mlpack/hmm_train.cp313-win_amd64.pyd +0 -0
- mlpack/hmm_viterbi.cp313-win_amd64.pyd +0 -0
- mlpack/hoeffding_tree.cp313-win_amd64.pyd +0 -0
- mlpack/image_converter.cp313-win_amd64.pyd +0 -0
- mlpack/include/mlpack/core/cv/k_fold_cv.hpp +21 -12
- mlpack/include/mlpack/core/cv/k_fold_cv_impl.hpp +49 -39
- mlpack/include/mlpack/core/data/detect_file_type_impl.hpp +9 -46
- mlpack/include/mlpack/core/data/save_impl.hpp +315 -315
- mlpack/include/mlpack/core/data/utilities.hpp +158 -158
- mlpack/include/mlpack/core/math/ccov.hpp +1 -0
- mlpack/include/mlpack/core/math/ccov_impl.hpp +4 -5
- mlpack/include/mlpack/core/math/make_alias.hpp +98 -3
- mlpack/include/mlpack/core/util/arma_traits.hpp +19 -2
- mlpack/include/mlpack/core/util/gitversion.hpp +1 -1
- mlpack/include/mlpack/core/util/sfinae_utility.hpp +24 -2
- mlpack/include/mlpack/core/util/version.hpp +1 -1
- mlpack/include/mlpack/methods/ann/dists/bernoulli_distribution_impl.hpp +1 -2
- mlpack/include/mlpack/methods/ann/init_rules/network_init.hpp +5 -5
- mlpack/include/mlpack/methods/ann/layer/batch_norm.hpp +3 -2
- mlpack/include/mlpack/methods/ann/layer/batch_norm_impl.hpp +19 -20
- mlpack/include/mlpack/methods/ann/layer/concat.hpp +1 -0
- mlpack/include/mlpack/methods/ann/layer/concat_impl.hpp +6 -7
- mlpack/include/mlpack/methods/ann/layer/convolution_impl.hpp +3 -3
- mlpack/include/mlpack/methods/ann/layer/grouped_convolution_impl.hpp +3 -3
- mlpack/include/mlpack/methods/ann/layer/linear3d.hpp +1 -0
- mlpack/include/mlpack/methods/ann/layer/linear3d_impl.hpp +11 -14
- mlpack/include/mlpack/methods/ann/layer/max_pooling.hpp +5 -4
- mlpack/include/mlpack/methods/ann/layer/max_pooling_impl.hpp +15 -14
- mlpack/include/mlpack/methods/ann/layer/mean_pooling.hpp +3 -2
- mlpack/include/mlpack/methods/ann/layer/mean_pooling_impl.hpp +14 -15
- mlpack/include/mlpack/methods/ann/layer/multihead_attention.hpp +6 -5
- mlpack/include/mlpack/methods/ann/layer/multihead_attention_impl.hpp +24 -25
- mlpack/include/mlpack/methods/ann/layer/nearest_interpolation.hpp +1 -0
- mlpack/include/mlpack/methods/ann/layer/nearest_interpolation_impl.hpp +4 -4
- mlpack/include/mlpack/methods/ann/layer/padding.hpp +1 -0
- mlpack/include/mlpack/methods/ann/layer/padding_impl.hpp +12 -13
- mlpack/include/mlpack/methods/ann/layer/recurrent_layer.hpp +3 -2
- mlpack/include/mlpack/methods/ann/loss_functions/cosine_embedding_loss_impl.hpp +5 -4
- mlpack/include/mlpack/methods/ann/rnn.hpp +19 -18
- mlpack/include/mlpack/methods/ann/rnn_impl.hpp +15 -15
- mlpack/include/mlpack/methods/bayesian_linear_regression/bayesian_linear_regression_impl.hpp +3 -8
- mlpack/include/mlpack/methods/decision_tree/fitness_functions/gini_gain.hpp +5 -8
- mlpack/include/mlpack/methods/decision_tree/fitness_functions/information_gain.hpp +5 -8
- mlpack/include/mlpack/methods/gmm/diagonal_gmm_impl.hpp +2 -1
- mlpack/include/mlpack/methods/gmm/eigenvalue_ratio_constraint.hpp +3 -3
- mlpack/include/mlpack/methods/gmm/gmm_impl.hpp +2 -1
- mlpack/include/mlpack/methods/hmm/hmm_impl.hpp +10 -5
- mlpack/include/mlpack/methods/random_forest/random_forest.hpp +57 -37
- mlpack/include/mlpack/methods/random_forest/random_forest_impl.hpp +69 -59
- mlpack/kde.cp313-win_amd64.pyd +0 -0
- mlpack/kernel_pca.cp313-win_amd64.pyd +0 -0
- mlpack/kfn.cp313-win_amd64.pyd +0 -0
- mlpack/kmeans.cp313-win_amd64.pyd +0 -0
- mlpack/knn.cp313-win_amd64.pyd +0 -0
- mlpack/krann.cp313-win_amd64.pyd +0 -0
- mlpack/lars.cp313-win_amd64.pyd +0 -0
- mlpack/linear_regression_predict.cp313-win_amd64.pyd +0 -0
- mlpack/linear_regression_train.cp313-win_amd64.pyd +0 -0
- mlpack/linear_svm.cp313-win_amd64.pyd +0 -0
- mlpack/lmnn.cp313-win_amd64.pyd +0 -0
- mlpack/local_coordinate_coding.cp313-win_amd64.pyd +0 -0
- mlpack/logistic_regression.cp313-win_amd64.pyd +0 -0
- mlpack/lsh.cp313-win_amd64.pyd +0 -0
- mlpack/mean_shift.cp313-win_amd64.pyd +0 -0
- mlpack/nbc.cp313-win_amd64.pyd +0 -0
- mlpack/nca.cp313-win_amd64.pyd +0 -0
- mlpack/nmf.cp313-win_amd64.pyd +0 -0
- mlpack/pca.cp313-win_amd64.pyd +0 -0
- mlpack/perceptron.cp313-win_amd64.pyd +0 -0
- mlpack/preprocess_binarize.cp313-win_amd64.pyd +0 -0
- mlpack/preprocess_describe.cp313-win_amd64.pyd +0 -0
- mlpack/preprocess_one_hot_encoding.cp313-win_amd64.pyd +0 -0
- mlpack/preprocess_scale.cp313-win_amd64.pyd +0 -0
- mlpack/preprocess_split.cp313-win_amd64.pyd +0 -0
- mlpack/radical.cp313-win_amd64.pyd +0 -0
- mlpack/random_forest.cp313-win_amd64.pyd +0 -0
- mlpack/softmax_regression.cp313-win_amd64.pyd +0 -0
- mlpack/sparse_coding.cp313-win_amd64.pyd +0 -0
- mlpack-4.6.2.dist-info/DELVEWHEEL +2 -0
- {mlpack-4.6.1.dist-info → mlpack-4.6.2.dist-info}/METADATA +2 -2
- {mlpack-4.6.1.dist-info → mlpack-4.6.2.dist-info}/RECORD +101 -101
- {mlpack-4.6.1.dist-info → mlpack-4.6.2.dist-info}/WHEEL +1 -1
- mlpack-4.6.1.dist-info/DELVEWHEEL +0 -2
- {mlpack-4.6.1.dist-info → mlpack-4.6.2.dist-info}/top_level.txt +0 -0
mlpack/__init__.py
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
mlpack/cf.cp313-win_amd64.pyd
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
mlpack/det.cp313-win_amd64.pyd
CHANGED
|
Binary file
|
mlpack/emst.cp313-win_amd64.pyd
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
#include <mlpack/core/cv/meta_info_extractor.hpp>
|
|
16
16
|
#include <mlpack/core/cv/cv_base.hpp>
|
|
17
|
+
#include <mlpack/core/util/arma_traits.hpp>
|
|
17
18
|
|
|
18
19
|
namespace mlpack {
|
|
19
20
|
|
|
@@ -280,30 +281,38 @@ class KFoldCV
|
|
|
280
281
|
/**
|
|
281
282
|
* Get the ith training subset from a variable of a matrix type.
|
|
282
283
|
*/
|
|
283
|
-
template<typename
|
|
284
|
-
inline
|
|
285
|
-
|
|
284
|
+
template<typename SubsetMatType>
|
|
285
|
+
inline SubsetMatType GetTrainingSubset(
|
|
286
|
+
SubsetMatType& m,
|
|
287
|
+
const size_t i,
|
|
288
|
+
const typename std::enable_if_t<IsMatrix<SubsetMatType>::value>* = 0);
|
|
286
289
|
|
|
287
290
|
/**
|
|
288
291
|
* Get the ith training subset from a variable of a row type.
|
|
289
292
|
*/
|
|
290
|
-
template<typename
|
|
291
|
-
inline
|
|
292
|
-
|
|
293
|
+
template<typename SubsetRowType>
|
|
294
|
+
inline SubsetRowType GetTrainingSubset(
|
|
295
|
+
SubsetRowType& r,
|
|
296
|
+
const size_t i,
|
|
297
|
+
const typename std::enable_if_t<IsRow<SubsetRowType>::value>* = 0);
|
|
293
298
|
|
|
294
299
|
/**
|
|
295
300
|
* Get the ith validation subset from a variable of a matrix type.
|
|
296
301
|
*/
|
|
297
|
-
template<typename
|
|
298
|
-
inline
|
|
299
|
-
|
|
302
|
+
template<typename SubsetMatType>
|
|
303
|
+
inline SubsetMatType GetValidationSubset(
|
|
304
|
+
SubsetMatType& m,
|
|
305
|
+
const size_t i,
|
|
306
|
+
const typename std::enable_if_t<IsMatrix<SubsetMatType>::value>* = 0);
|
|
300
307
|
|
|
301
308
|
/**
|
|
302
309
|
* Get the ith validation subset from a variable of a row type.
|
|
303
310
|
*/
|
|
304
|
-
template<typename
|
|
305
|
-
inline
|
|
306
|
-
|
|
311
|
+
template<typename SubsetRowType>
|
|
312
|
+
inline SubsetRowType GetValidationSubset(
|
|
313
|
+
SubsetRowType& r,
|
|
314
|
+
const size_t i,
|
|
315
|
+
const typename std::enable_if_t<IsRow<SubsetRowType>::value>* = 0);
|
|
307
316
|
};
|
|
308
317
|
|
|
309
318
|
} // namespace mlpack
|
|
@@ -375,14 +375,15 @@ template<typename MLAlgorithm,
|
|
|
375
375
|
typename MatType,
|
|
376
376
|
typename PredictionsType,
|
|
377
377
|
typename WeightsType>
|
|
378
|
-
template<typename
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
const size_t i
|
|
378
|
+
template<typename SubsetMatType>
|
|
379
|
+
SubsetMatType KFoldCV<MLAlgorithm,
|
|
380
|
+
Metric,
|
|
381
|
+
MatType,
|
|
382
|
+
PredictionsType,
|
|
383
|
+
WeightsType>::GetTrainingSubset(
|
|
384
|
+
SubsetMatType& m,
|
|
385
|
+
const size_t i,
|
|
386
|
+
const typename std::enable_if_t<IsMatrix<SubsetMatType>::value>*)
|
|
386
387
|
{
|
|
387
388
|
// If this is not the first fold, we have to handle it a little bit
|
|
388
389
|
// differently, since the last fold may contain slightly more than 'binSize'
|
|
@@ -390,8 +391,9 @@ arma::Mat<ElementType> KFoldCV<MLAlgorithm,
|
|
|
390
391
|
const size_t subsetSize = (i != 0) ? lastBinSize + (k - 2) * binSize :
|
|
391
392
|
(k - 1) * binSize;
|
|
392
393
|
|
|
393
|
-
|
|
394
|
-
|
|
394
|
+
SubsetMatType alias;
|
|
395
|
+
MakeAlias(alias, m, m.n_rows, subsetSize, m.n_rows * binSize * i);
|
|
396
|
+
return alias;
|
|
395
397
|
}
|
|
396
398
|
|
|
397
399
|
template<typename MLAlgorithm,
|
|
@@ -399,14 +401,15 @@ template<typename MLAlgorithm,
|
|
|
399
401
|
typename MatType,
|
|
400
402
|
typename PredictionsType,
|
|
401
403
|
typename WeightsType>
|
|
402
|
-
template<typename
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
const size_t i
|
|
404
|
+
template<typename SubsetRowType>
|
|
405
|
+
SubsetRowType KFoldCV<MLAlgorithm,
|
|
406
|
+
Metric,
|
|
407
|
+
MatType,
|
|
408
|
+
PredictionsType,
|
|
409
|
+
WeightsType>::GetTrainingSubset(
|
|
410
|
+
SubsetRowType& r,
|
|
411
|
+
const size_t i,
|
|
412
|
+
const typename std::enable_if_t<IsRow<SubsetRowType>::value>*)
|
|
410
413
|
{
|
|
411
414
|
// If this is not the first fold, we have to handle it a little bit
|
|
412
415
|
// differently, since the last fold may contain slightly more than 'binSize'
|
|
@@ -414,7 +417,9 @@ arma::Row<ElementType> KFoldCV<MLAlgorithm,
|
|
|
414
417
|
const size_t subsetSize = (i != 0) ? lastBinSize + (k - 2) * binSize :
|
|
415
418
|
(k - 1) * binSize;
|
|
416
419
|
|
|
417
|
-
|
|
420
|
+
SubsetRowType alias;
|
|
421
|
+
MakeAlias(alias, r, subsetSize, r.n_rows * binSize * i);
|
|
422
|
+
return alias;
|
|
418
423
|
}
|
|
419
424
|
|
|
420
425
|
template<typename MLAlgorithm,
|
|
@@ -422,18 +427,21 @@ template<typename MLAlgorithm,
|
|
|
422
427
|
typename MatType,
|
|
423
428
|
typename PredictionsType,
|
|
424
429
|
typename WeightsType>
|
|
425
|
-
template<typename
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
const size_t i
|
|
430
|
+
template<typename SubsetMatType>
|
|
431
|
+
SubsetMatType KFoldCV<MLAlgorithm,
|
|
432
|
+
Metric,
|
|
433
|
+
MatType,
|
|
434
|
+
PredictionsType,
|
|
435
|
+
WeightsType>::GetValidationSubset(
|
|
436
|
+
SubsetMatType& m,
|
|
437
|
+
const size_t i,
|
|
438
|
+
const typename std::enable_if_t<IsMatrix<SubsetMatType>::value>*)
|
|
433
439
|
{
|
|
434
440
|
const size_t subsetSize = (i == 0) ? lastBinSize : binSize;
|
|
435
|
-
|
|
436
|
-
|
|
441
|
+
SubsetMatType alias;
|
|
442
|
+
MakeAlias(alias, m, m.n_rows, subsetSize,
|
|
443
|
+
m.n_rows * ValidationSubsetFirstCol(i));
|
|
444
|
+
return alias;
|
|
437
445
|
}
|
|
438
446
|
|
|
439
447
|
template<typename MLAlgorithm,
|
|
@@ -441,18 +449,20 @@ template<typename MLAlgorithm,
|
|
|
441
449
|
typename MatType,
|
|
442
450
|
typename PredictionsType,
|
|
443
451
|
typename WeightsType>
|
|
444
|
-
template<typename
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
const size_t i
|
|
452
|
+
template<typename SubsetRowType>
|
|
453
|
+
SubsetRowType KFoldCV<MLAlgorithm,
|
|
454
|
+
Metric,
|
|
455
|
+
MatType,
|
|
456
|
+
PredictionsType,
|
|
457
|
+
WeightsType>::GetValidationSubset(
|
|
458
|
+
SubsetRowType& r,
|
|
459
|
+
const size_t i,
|
|
460
|
+
const typename std::enable_if_t<IsRow<SubsetRowType>::value>*)
|
|
452
461
|
{
|
|
453
462
|
const size_t subsetSize = (i == 0) ? lastBinSize : binSize;
|
|
454
|
-
|
|
455
|
-
|
|
463
|
+
SubsetRowType alias;
|
|
464
|
+
MakeAlias(alias, r, subsetSize, r.n_rows * ValidationSubsetFirstCol(i));
|
|
465
|
+
return alias;
|
|
456
466
|
}
|
|
457
467
|
|
|
458
468
|
} // namespace mlpack
|
|
@@ -73,6 +73,7 @@ inline FileType GuessFileType(std::istream& f)
|
|
|
73
73
|
bool hasBinary = false;
|
|
74
74
|
bool hasBracket = false;
|
|
75
75
|
bool hasComma = false;
|
|
76
|
+
bool hasSemicolon = false;
|
|
76
77
|
|
|
77
78
|
for (arma::uword i = 0; i < nUse; ++i)
|
|
78
79
|
{
|
|
@@ -87,57 +88,16 @@ inline FileType GuessFileType(std::istream& f)
|
|
|
87
88
|
{
|
|
88
89
|
hasBracket = true;
|
|
89
90
|
}
|
|
90
|
-
|
|
91
|
+
|
|
92
|
+
if (val == ';')
|
|
91
93
|
{
|
|
92
|
-
|
|
94
|
+
hasSemicolon = true;
|
|
93
95
|
}
|
|
94
|
-
}
|
|
95
96
|
|
|
96
|
-
|
|
97
|
-
{
|
|
98
|
-
// If we believe we have a CSV file, then we want to try to skip any header
|
|
99
|
-
// row. We'll detect a header row by simply seeing if anything in the first
|
|
100
|
-
// line doesn't parse as a number.
|
|
101
|
-
//
|
|
102
|
-
// TODO: this is not a foolproof algorithm, so there should eventually be a
|
|
103
|
-
// way added for the user to explicitly indicate that there is or isn't a
|
|
104
|
-
// header.
|
|
105
|
-
std::string firstLine;
|
|
106
|
-
std::getline(f, firstLine);
|
|
107
|
-
|
|
108
|
-
std::stringstream str(firstLine);
|
|
109
|
-
std::string token;
|
|
110
|
-
bool allNumeric = true;
|
|
111
|
-
// We'll abuse 'getline()' to split on commas.
|
|
112
|
-
while (std::getline(str, token, ','))
|
|
97
|
+
if (val == ',')
|
|
113
98
|
{
|
|
114
|
-
|
|
115
|
-
double num;
|
|
116
|
-
std::string rest;
|
|
117
|
-
|
|
118
|
-
// Try to parse into a number.
|
|
119
|
-
std::stringstream s(token);
|
|
120
|
-
s >> num;
|
|
121
|
-
if (s.fail())
|
|
122
|
-
{
|
|
123
|
-
allNumeric = false;
|
|
124
|
-
break;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// Now check to see there isn't anything else. (This catches cases like,
|
|
128
|
-
// e.g., "1a".)
|
|
129
|
-
s >> rest;
|
|
130
|
-
if (rest.length() > 0)
|
|
131
|
-
{
|
|
132
|
-
allNumeric = false;
|
|
133
|
-
break;
|
|
134
|
-
}
|
|
99
|
+
hasComma = true;
|
|
135
100
|
}
|
|
136
|
-
|
|
137
|
-
// If we could parse everything into a number, then let's rewind `f` so that
|
|
138
|
-
// it's at the start of the file.
|
|
139
|
-
if (allNumeric)
|
|
140
|
-
f.seekg(pos1);
|
|
141
101
|
}
|
|
142
102
|
|
|
143
103
|
delete[] dataMem;
|
|
@@ -145,6 +105,9 @@ inline FileType GuessFileType(std::istream& f)
|
|
|
145
105
|
if (hasBinary)
|
|
146
106
|
return FileType::RawBinary;
|
|
147
107
|
|
|
108
|
+
if (hasSemicolon && (hasBracket == false))
|
|
109
|
+
return FileType::CSVASCII;
|
|
110
|
+
|
|
148
111
|
if (hasComma && (hasBracket == false))
|
|
149
112
|
return FileType::CSVASCII;
|
|
150
113
|
|