mlpack 4.6.2__cp313-cp313-win_amd64.whl → 4.7.0__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 +4 -4
- 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/base.hpp +1 -0
- mlpack/include/mlpack/core/arma_extend/find_nan.hpp +63 -0
- mlpack/include/mlpack/core/cereal/low_precision.hpp +48 -0
- mlpack/include/mlpack/core/cv/cv_base.hpp +11 -11
- mlpack/include/mlpack/core/cv/cv_base_impl.hpp +7 -7
- mlpack/include/mlpack/core/cv/k_fold_cv.hpp +4 -4
- mlpack/include/mlpack/core/cv/k_fold_cv_impl.hpp +4 -4
- mlpack/include/mlpack/core/cv/meta_info_extractor.hpp +10 -10
- mlpack/include/mlpack/core/cv/metrics/f1_impl.hpp +1 -1
- mlpack/include/mlpack/core/cv/metrics/facilities.hpp +2 -1
- mlpack/include/mlpack/core/cv/metrics/precision_impl.hpp +1 -1
- mlpack/include/mlpack/core/cv/metrics/r2_score_impl.hpp +1 -1
- mlpack/include/mlpack/core/cv/metrics/silhouette_score_impl.hpp +1 -1
- mlpack/include/mlpack/core/cv/simple_cv.hpp +4 -4
- mlpack/include/mlpack/core/cv/simple_cv_impl.hpp +2 -2
- mlpack/include/mlpack/core/data/binarize.hpp +0 -2
- mlpack/include/mlpack/core/data/check_categorical_param.hpp +0 -2
- mlpack/include/mlpack/core/data/combine_options.hpp +151 -0
- mlpack/include/mlpack/core/data/confusion_matrix.hpp +0 -2
- mlpack/include/mlpack/core/data/confusion_matrix_impl.hpp +0 -2
- mlpack/include/mlpack/core/data/data.hpp +6 -4
- mlpack/include/mlpack/core/data/data_options.hpp +341 -18
- mlpack/include/mlpack/core/data/dataset_mapper.hpp +3 -5
- mlpack/include/mlpack/core/data/dataset_mapper_impl.hpp +0 -2
- mlpack/include/mlpack/core/data/detect_file_type.hpp +34 -5
- mlpack/include/mlpack/core/data/detect_file_type_impl.hpp +185 -11
- mlpack/include/mlpack/core/data/extension.hpp +2 -4
- mlpack/include/mlpack/core/data/font8x8_basic.h +152 -0
- mlpack/include/mlpack/core/data/has_serialize.hpp +0 -2
- mlpack/include/mlpack/core/data/image_bounding_box.hpp +36 -0
- mlpack/include/mlpack/core/data/image_bounding_box_impl.hpp +155 -0
- mlpack/include/mlpack/core/data/image_layout.hpp +63 -0
- mlpack/include/mlpack/core/data/image_layout_impl.hpp +75 -0
- mlpack/include/mlpack/core/data/image_letterbox.hpp +116 -0
- mlpack/include/mlpack/core/data/image_options.hpp +257 -0
- mlpack/include/mlpack/core/data/image_resize_crop.hpp +113 -48
- mlpack/include/mlpack/core/data/imputation_methods/custom_imputation.hpp +16 -32
- mlpack/include/mlpack/core/data/imputation_methods/listwise_deletion.hpp +19 -29
- mlpack/include/mlpack/core/data/imputation_methods/mean_imputation.hpp +113 -44
- mlpack/include/mlpack/core/data/imputation_methods/median_imputation.hpp +44 -43
- mlpack/include/mlpack/core/data/imputer.hpp +41 -49
- mlpack/include/mlpack/core/data/is_naninf.hpp +0 -2
- mlpack/include/mlpack/core/data/load.hpp +49 -233
- mlpack/include/mlpack/core/data/load_arff.hpp +0 -2
- mlpack/include/mlpack/core/data/load_arff_impl.hpp +2 -4
- mlpack/include/mlpack/core/data/load_categorical.hpp +1 -4
- mlpack/include/mlpack/core/data/load_categorical_impl.hpp +10 -26
- mlpack/include/mlpack/core/data/load_dense.hpp +279 -0
- mlpack/include/mlpack/core/data/load_deprecated.hpp +466 -0
- mlpack/include/mlpack/core/data/load_image.hpp +71 -43
- mlpack/include/mlpack/core/data/load_impl.hpp +95 -274
- mlpack/include/mlpack/core/data/load_model.hpp +62 -0
- mlpack/include/mlpack/core/data/load_numeric.hpp +124 -87
- mlpack/include/mlpack/core/data/load_sparse.hpp +91 -0
- mlpack/include/mlpack/core/data/map_policies/datatype.hpp +0 -2
- mlpack/include/mlpack/core/data/map_policies/increment_policy.hpp +0 -2
- mlpack/include/mlpack/core/data/map_policies/map_policies.hpp +0 -1
- mlpack/include/mlpack/core/data/matrix_options.hpp +152 -20
- mlpack/include/mlpack/core/data/normalize_labels.hpp +0 -2
- mlpack/include/mlpack/core/data/normalize_labels_impl.hpp +0 -2
- mlpack/include/mlpack/core/data/one_hot_encoding.hpp +2 -4
- mlpack/include/mlpack/core/data/one_hot_encoding_impl.hpp +3 -5
- mlpack/include/mlpack/core/data/save.hpp +26 -120
- mlpack/include/mlpack/core/data/save_dense.hpp +42 -0
- mlpack/include/mlpack/core/data/save_deprecated.hpp +308 -0
- mlpack/include/mlpack/core/data/save_image.hpp +82 -42
- mlpack/include/mlpack/core/data/save_impl.hpp +60 -245
- mlpack/include/mlpack/core/data/save_matrix.hpp +45 -0
- mlpack/include/mlpack/core/data/save_model.hpp +61 -0
- mlpack/include/mlpack/core/data/save_numeric.hpp +60 -0
- mlpack/include/mlpack/core/data/save_sparse.hpp +44 -0
- mlpack/include/mlpack/core/data/scaler_methods/max_abs_scaler.hpp +0 -2
- mlpack/include/mlpack/core/data/scaler_methods/mean_normalization.hpp +2 -4
- mlpack/include/mlpack/core/data/scaler_methods/min_max_scaler.hpp +0 -2
- mlpack/include/mlpack/core/data/scaler_methods/pca_whitening.hpp +1 -3
- mlpack/include/mlpack/core/data/scaler_methods/standard_scaler.hpp +2 -4
- mlpack/include/mlpack/core/data/scaler_methods/zca_whitening.hpp +0 -2
- mlpack/include/mlpack/core/data/split_data.hpp +6 -8
- mlpack/include/mlpack/core/data/string_algorithms.hpp +0 -2
- mlpack/include/mlpack/core/data/string_encoding.hpp +0 -2
- mlpack/include/mlpack/core/data/string_encoding_dictionary.hpp +0 -2
- mlpack/include/mlpack/core/data/string_encoding_impl.hpp +0 -2
- mlpack/include/mlpack/core/data/string_encoding_policies/bag_of_words_encoding_policy.hpp +0 -2
- mlpack/include/mlpack/core/data/string_encoding_policies/dictionary_encoding_policy.hpp +0 -2
- mlpack/include/mlpack/core/data/string_encoding_policies/policy_traits.hpp +0 -2
- mlpack/include/mlpack/core/data/string_encoding_policies/tf_idf_encoding_policy.hpp +0 -2
- mlpack/include/mlpack/core/data/text_options.hpp +91 -53
- mlpack/include/mlpack/core/data/tokenizers/char_extract.hpp +0 -2
- mlpack/include/mlpack/core/data/tokenizers/split_by_any_of.hpp +0 -2
- mlpack/include/mlpack/core/distributions/gamma_distribution_impl.hpp +4 -4
- mlpack/include/mlpack/core/distributions/laplace_distribution.hpp +9 -9
- mlpack/include/mlpack/core/distributions/laplace_distribution_impl.hpp +7 -7
- mlpack/include/mlpack/core/hpt/cv_function.hpp +2 -2
- mlpack/include/mlpack/core/hpt/cv_function_impl.hpp +2 -2
- mlpack/include/mlpack/core/hpt/hpt.hpp +4 -4
- mlpack/include/mlpack/core/hpt/hpt_impl.hpp +9 -9
- mlpack/include/mlpack/core/math/make_alias.hpp +7 -5
- mlpack/include/mlpack/core/math/random.hpp +19 -5
- mlpack/include/mlpack/core/math/shuffle_data.hpp +79 -245
- mlpack/include/mlpack/core/metrics/non_maximal_suppression_impl.hpp +9 -10
- mlpack/include/mlpack/core/stb/bundled/stb_image_resize2.h +291 -239
- mlpack/include/mlpack/core/tree/binary_space_tree/rp_tree_mean_split_impl.hpp +7 -7
- mlpack/include/mlpack/core/tree/cellbound.hpp +2 -2
- mlpack/include/mlpack/core/tree/cosine_tree/cosine_tree_impl.hpp +10 -10
- mlpack/include/mlpack/core/tree/octree/octree.hpp +10 -0
- mlpack/include/mlpack/core/tree/octree/octree_impl.hpp +14 -4
- mlpack/include/mlpack/core/util/arma_traits.hpp +25 -38
- mlpack/include/mlpack/core/util/coot_traits.hpp +97 -0
- mlpack/include/mlpack/core/util/forward.hpp +0 -2
- mlpack/include/mlpack/core/util/param.hpp +4 -4
- mlpack/include/mlpack/core/util/params_impl.hpp +2 -2
- mlpack/include/mlpack/core/util/using.hpp +29 -2
- mlpack/include/mlpack/core/util/version.hpp +5 -3
- mlpack/include/mlpack/core/util/version_impl.hpp +3 -6
- mlpack/include/mlpack/methods/adaboost/adaboost_classify_main.cpp +1 -1
- mlpack/include/mlpack/methods/adaboost/adaboost_main.cpp +3 -3
- mlpack/include/mlpack/methods/adaboost/adaboost_train_main.cpp +2 -2
- mlpack/include/mlpack/methods/ann/activation_functions/activation_functions.hpp +1 -0
- mlpack/include/mlpack/methods/ann/activation_functions/bipolar_sigmoid_function.hpp +6 -4
- mlpack/include/mlpack/methods/ann/activation_functions/elish_function.hpp +17 -12
- mlpack/include/mlpack/methods/ann/activation_functions/elliot_function.hpp +9 -7
- mlpack/include/mlpack/methods/ann/activation_functions/gaussian_function.hpp +7 -6
- mlpack/include/mlpack/methods/ann/activation_functions/gelu_exact_function.hpp +73 -0
- mlpack/include/mlpack/methods/ann/activation_functions/gelu_function.hpp +27 -16
- mlpack/include/mlpack/methods/ann/activation_functions/hard_sigmoid_function.hpp +8 -6
- mlpack/include/mlpack/methods/ann/activation_functions/hard_swish_function.hpp +6 -4
- mlpack/include/mlpack/methods/ann/activation_functions/hyper_sinh_function.hpp +13 -8
- mlpack/include/mlpack/methods/ann/activation_functions/identity_function.hpp +6 -4
- mlpack/include/mlpack/methods/ann/activation_functions/inverse_quadratic_function.hpp +8 -6
- mlpack/include/mlpack/methods/ann/activation_functions/lisht_function.hpp +7 -5
- mlpack/include/mlpack/methods/ann/activation_functions/logistic_function.hpp +14 -12
- mlpack/include/mlpack/methods/ann/activation_functions/mish_function.hpp +7 -5
- mlpack/include/mlpack/methods/ann/activation_functions/multi_quadratic_function.hpp +6 -4
- mlpack/include/mlpack/methods/ann/activation_functions/poisson1_function.hpp +4 -2
- mlpack/include/mlpack/methods/ann/activation_functions/quadratic_function.hpp +6 -4
- mlpack/include/mlpack/methods/ann/activation_functions/rectifier_function.hpp +10 -10
- mlpack/include/mlpack/methods/ann/activation_functions/silu_function.hpp +10 -8
- mlpack/include/mlpack/methods/ann/activation_functions/softplus_function.hpp +12 -9
- mlpack/include/mlpack/methods/ann/activation_functions/softsign_function.hpp +15 -23
- mlpack/include/mlpack/methods/ann/activation_functions/spline_function.hpp +9 -7
- mlpack/include/mlpack/methods/ann/activation_functions/swish_function.hpp +11 -9
- mlpack/include/mlpack/methods/ann/activation_functions/tanh_exponential_function.hpp +9 -7
- mlpack/include/mlpack/methods/ann/activation_functions/tanh_function.hpp +10 -7
- mlpack/include/mlpack/methods/ann/ann.hpp +3 -0
- mlpack/include/mlpack/methods/ann/convolution_rules/base_convolution.hpp +197 -0
- mlpack/include/mlpack/methods/ann/convolution_rules/convolution_rules.hpp +1 -2
- mlpack/include/mlpack/methods/ann/convolution_rules/im2col_convolution.hpp +215 -0
- mlpack/include/mlpack/methods/ann/convolution_rules/naive_convolution.hpp +109 -154
- mlpack/include/mlpack/methods/ann/dag_network.hpp +728 -0
- mlpack/include/mlpack/methods/ann/dag_network_impl.hpp +1640 -0
- mlpack/include/mlpack/methods/ann/dists/bernoulli_distribution_impl.hpp +1 -1
- mlpack/include/mlpack/methods/ann/dists/normal_distribution_impl.hpp +7 -2
- mlpack/include/mlpack/methods/ann/ffn.hpp +39 -3
- mlpack/include/mlpack/methods/ann/ffn_impl.hpp +14 -32
- mlpack/include/mlpack/methods/ann/init_rules/const_init.hpp +4 -4
- mlpack/include/mlpack/methods/ann/init_rules/gaussian_init.hpp +6 -2
- mlpack/include/mlpack/methods/ann/init_rules/he_init.hpp +4 -2
- mlpack/include/mlpack/methods/ann/init_rules/kathirvalavakumar_subavathi_init.hpp +3 -3
- mlpack/include/mlpack/methods/ann/init_rules/lecun_normal_init.hpp +4 -2
- mlpack/include/mlpack/methods/ann/init_rules/nguyen_widrow_init.hpp +2 -2
- mlpack/include/mlpack/methods/ann/init_rules/oivs_init.hpp +2 -2
- mlpack/include/mlpack/methods/ann/init_rules/orthogonal_init.hpp +2 -2
- mlpack/include/mlpack/methods/ann/init_rules/random_init.hpp +8 -4
- mlpack/include/mlpack/methods/ann/layer/adaptive_max_pooling.hpp +21 -23
- mlpack/include/mlpack/methods/ann/layer/adaptive_max_pooling_impl.hpp +15 -15
- mlpack/include/mlpack/methods/ann/layer/adaptive_mean_pooling.hpp +21 -23
- mlpack/include/mlpack/methods/ann/layer/adaptive_mean_pooling_impl.hpp +16 -16
- mlpack/include/mlpack/methods/ann/layer/add.hpp +18 -18
- mlpack/include/mlpack/methods/ann/layer/add_impl.hpp +13 -13
- mlpack/include/mlpack/methods/ann/layer/add_merge.hpp +19 -18
- mlpack/include/mlpack/methods/ann/layer/add_merge_impl.hpp +13 -13
- mlpack/include/mlpack/methods/ann/layer/alpha_dropout.hpp +17 -16
- mlpack/include/mlpack/methods/ann/layer/alpha_dropout_impl.hpp +14 -13
- mlpack/include/mlpack/methods/ann/layer/base_layer.hpp +28 -51
- mlpack/include/mlpack/methods/ann/layer/batch_norm.hpp +16 -18
- mlpack/include/mlpack/methods/ann/layer/batch_norm_impl.hpp +55 -54
- mlpack/include/mlpack/methods/ann/layer/c_relu.hpp +18 -20
- mlpack/include/mlpack/methods/ann/layer/c_relu_impl.hpp +20 -25
- mlpack/include/mlpack/methods/ann/layer/celu.hpp +14 -19
- mlpack/include/mlpack/methods/ann/layer/celu_impl.hpp +25 -34
- mlpack/include/mlpack/methods/ann/layer/concat.hpp +18 -18
- mlpack/include/mlpack/methods/ann/layer/concat_impl.hpp +13 -13
- mlpack/include/mlpack/methods/ann/layer/concatenate.hpp +18 -18
- mlpack/include/mlpack/methods/ann/layer/concatenate_impl.hpp +14 -14
- mlpack/include/mlpack/methods/ann/layer/convolution.hpp +42 -47
- mlpack/include/mlpack/methods/ann/layer/convolution_impl.hpp +170 -159
- mlpack/include/mlpack/methods/ann/layer/dropconnect.hpp +18 -20
- mlpack/include/mlpack/methods/ann/layer/dropconnect_impl.hpp +20 -20
- mlpack/include/mlpack/methods/ann/layer/dropout.hpp +17 -19
- mlpack/include/mlpack/methods/ann/layer/dropout_impl.hpp +14 -21
- mlpack/include/mlpack/methods/ann/layer/elu.hpp +23 -25
- mlpack/include/mlpack/methods/ann/layer/elu_impl.hpp +20 -27
- mlpack/include/mlpack/methods/ann/layer/embedding.hpp +160 -0
- mlpack/include/mlpack/methods/ann/layer/embedding_impl.hpp +189 -0
- mlpack/include/mlpack/methods/ann/layer/flexible_relu.hpp +17 -19
- mlpack/include/mlpack/methods/ann/layer/flexible_relu_impl.hpp +20 -20
- mlpack/include/mlpack/methods/ann/layer/ftswish.hpp +17 -18
- mlpack/include/mlpack/methods/ann/layer/ftswish_impl.hpp +17 -35
- mlpack/include/mlpack/methods/ann/layer/grouped_convolution.hpp +27 -33
- mlpack/include/mlpack/methods/ann/layer/grouped_convolution_impl.hpp +170 -163
- mlpack/include/mlpack/methods/ann/layer/gru.hpp +195 -0
- mlpack/include/mlpack/methods/ann/layer/gru_impl.hpp +325 -0
- mlpack/include/mlpack/methods/ann/layer/hard_tanh.hpp +13 -15
- mlpack/include/mlpack/methods/ann/layer/hard_tanh_impl.hpp +12 -12
- mlpack/include/mlpack/methods/ann/layer/identity.hpp +19 -20
- mlpack/include/mlpack/methods/ann/layer/identity_impl.hpp +12 -12
- mlpack/include/mlpack/methods/ann/layer/layer.hpp +37 -33
- mlpack/include/mlpack/methods/ann/layer/layer_norm.hpp +11 -13
- mlpack/include/mlpack/methods/ann/layer/layer_norm_impl.hpp +16 -16
- mlpack/include/mlpack/methods/ann/layer/layer_types.hpp +4 -1
- mlpack/include/mlpack/methods/ann/layer/leaky_relu.hpp +20 -23
- mlpack/include/mlpack/methods/ann/layer/leaky_relu_impl.hpp +12 -13
- mlpack/include/mlpack/methods/ann/layer/linear.hpp +16 -18
- mlpack/include/mlpack/methods/ann/layer/linear3d.hpp +18 -18
- mlpack/include/mlpack/methods/ann/layer/linear3d_impl.hpp +18 -18
- mlpack/include/mlpack/methods/ann/layer/linear_impl.hpp +15 -15
- mlpack/include/mlpack/methods/ann/layer/linear_no_bias.hpp +15 -17
- mlpack/include/mlpack/methods/ann/layer/linear_no_bias_impl.hpp +20 -20
- mlpack/include/mlpack/methods/ann/layer/linear_recurrent.hpp +25 -14
- mlpack/include/mlpack/methods/ann/layer/linear_recurrent_impl.hpp +60 -31
- mlpack/include/mlpack/methods/ann/layer/log_softmax.hpp +17 -36
- mlpack/include/mlpack/methods/ann/layer/log_softmax_impl.hpp +58 -74
- mlpack/include/mlpack/methods/ann/layer/lstm.hpp +26 -29
- mlpack/include/mlpack/methods/ann/layer/lstm_impl.hpp +128 -124
- mlpack/include/mlpack/methods/ann/layer/max_pooling.hpp +19 -19
- mlpack/include/mlpack/methods/ann/layer/max_pooling_impl.hpp +14 -14
- mlpack/include/mlpack/methods/ann/layer/mean_pooling.hpp +24 -24
- mlpack/include/mlpack/methods/ann/layer/mean_pooling_impl.hpp +16 -16
- mlpack/include/mlpack/methods/ann/layer/multi_layer.hpp +36 -6
- mlpack/include/mlpack/methods/ann/layer/multi_layer_impl.hpp +6 -2
- mlpack/include/mlpack/methods/ann/layer/multihead_attention.hpp +26 -22
- mlpack/include/mlpack/methods/ann/layer/multihead_attention_impl.hpp +161 -64
- mlpack/include/mlpack/methods/ann/layer/nearest_interpolation.hpp +28 -25
- mlpack/include/mlpack/methods/ann/layer/nearest_interpolation_impl.hpp +36 -37
- mlpack/include/mlpack/methods/ann/layer/noisylinear.hpp +39 -42
- mlpack/include/mlpack/methods/ann/layer/noisylinear_impl.hpp +18 -18
- mlpack/include/mlpack/methods/ann/layer/padding.hpp +21 -17
- mlpack/include/mlpack/methods/ann/layer/padding_impl.hpp +33 -19
- mlpack/include/mlpack/methods/ann/layer/parametric_relu.hpp +26 -28
- mlpack/include/mlpack/methods/ann/layer/parametric_relu_impl.hpp +18 -18
- mlpack/include/mlpack/methods/ann/layer/radial_basis_function.hpp +41 -28
- mlpack/include/mlpack/methods/ann/layer/radial_basis_function_impl.hpp +42 -17
- mlpack/include/mlpack/methods/ann/layer/recurrent_layer.hpp +13 -0
- mlpack/include/mlpack/methods/ann/layer/relu6.hpp +19 -21
- mlpack/include/mlpack/methods/ann/layer/relu6_impl.hpp +14 -14
- mlpack/include/mlpack/methods/ann/layer/repeat.hpp +24 -25
- mlpack/include/mlpack/methods/ann/layer/repeat_impl.hpp +10 -10
- mlpack/include/mlpack/methods/ann/layer/serialization.hpp +64 -54
- mlpack/include/mlpack/methods/ann/layer/softmax.hpp +20 -20
- mlpack/include/mlpack/methods/ann/layer/softmax_impl.hpp +10 -10
- mlpack/include/mlpack/methods/ann/layer/softmin.hpp +20 -23
- mlpack/include/mlpack/methods/ann/layer/softmin_impl.hpp +10 -10
- mlpack/include/mlpack/methods/ann/layer/sum_reduce.hpp +103 -0
- mlpack/include/mlpack/methods/ann/layer/sum_reduce_impl.hpp +143 -0
- mlpack/include/mlpack/methods/ann/loss_functions/cosine_embedding_loss_impl.hpp +3 -3
- mlpack/include/mlpack/methods/ann/loss_functions/mean_bias_error_impl.hpp +1 -1
- mlpack/include/mlpack/methods/ann/loss_functions/multilabel_softmargin_loss_impl.hpp +1 -1
- mlpack/include/mlpack/methods/ann/loss_functions/negative_log_likelihood.hpp +2 -2
- mlpack/include/mlpack/methods/ann/loss_functions/negative_log_likelihood_impl.hpp +29 -15
- mlpack/include/mlpack/methods/ann/loss_functions/poisson_nll_loss_impl.hpp +1 -1
- mlpack/include/mlpack/methods/ann/models/models.hpp +17 -0
- mlpack/include/mlpack/methods/ann/models/yolov3/yolov3_layer.hpp +151 -0
- mlpack/include/mlpack/methods/ann/models/yolov3/yolov3_layer_impl.hpp +265 -0
- mlpack/include/mlpack/methods/ann/models/yolov3/yolov3_tiny.hpp +187 -0
- mlpack/include/mlpack/methods/ann/models/yolov3/yolov3_tiny_impl.hpp +206 -0
- mlpack/include/mlpack/methods/ann/regularizer/orthogonal_regularizer_impl.hpp +5 -3
- mlpack/include/mlpack/methods/ann/rnn.hpp +136 -42
- mlpack/include/mlpack/methods/ann/rnn_impl.hpp +230 -38
- mlpack/include/mlpack/methods/approx_kfn/drusilla_select_impl.hpp +1 -1
- mlpack/include/mlpack/methods/bayesian_linear_regression/bayesian_linear_regression_main.cpp +1 -1
- mlpack/include/mlpack/methods/bias_svd/bias_svd_function_impl.hpp +1 -1
- mlpack/include/mlpack/methods/cf/cf_model.hpp +1 -1
- mlpack/include/mlpack/methods/decision_tree/decision_tree.hpp +6 -6
- mlpack/include/mlpack/methods/decision_tree/decision_tree_impl.hpp +12 -12
- mlpack/include/mlpack/methods/decision_tree/decision_tree_main.cpp +0 -1
- mlpack/include/mlpack/methods/decision_tree/decision_tree_regressor.hpp +6 -6
- mlpack/include/mlpack/methods/decision_tree/decision_tree_regressor_impl.hpp +12 -12
- mlpack/include/mlpack/methods/det/det_main.cpp +1 -1
- mlpack/include/mlpack/methods/hmm/hmm_train_main.cpp +4 -4
- mlpack/include/mlpack/methods/hmm/hmm_util_impl.hpp +2 -2
- mlpack/include/mlpack/methods/hoeffding_trees/hoeffding_tree.hpp +6 -6
- mlpack/include/mlpack/methods/hoeffding_trees/hoeffding_tree_impl.hpp +31 -31
- mlpack/include/mlpack/methods/hoeffding_trees/hoeffding_tree_main.cpp +1 -2
- mlpack/include/mlpack/methods/hoeffding_trees/hoeffding_tree_model.hpp +2 -2
- mlpack/include/mlpack/methods/hoeffding_trees/hoeffding_tree_model_impl.hpp +1 -1
- mlpack/include/mlpack/methods/kde/kde_rules_impl.hpp +6 -6
- mlpack/include/mlpack/methods/lars/lars_impl.hpp +3 -3
- mlpack/include/mlpack/methods/linear_svm/linear_svm_function_impl.hpp +4 -4
- mlpack/include/mlpack/methods/linear_svm/linear_svm_main.cpp +3 -3
- mlpack/include/mlpack/methods/lmnn/lmnn_main.cpp +1 -1
- mlpack/include/mlpack/methods/lsh/lsh_main.cpp +1 -1
- mlpack/include/mlpack/methods/matrix_completion/matrix_completion_impl.hpp +1 -1
- mlpack/include/mlpack/methods/naive_bayes/naive_bayes_classifier_impl.hpp +1 -1
- mlpack/include/mlpack/methods/naive_bayes/nbc_main.cpp +3 -3
- mlpack/include/mlpack/methods/nca/nca_main.cpp +1 -1
- mlpack/include/mlpack/methods/neighbor_search/kfn_main.cpp +8 -8
- mlpack/include/mlpack/methods/neighbor_search/knn_main.cpp +8 -8
- mlpack/include/mlpack/methods/neighbor_search/neighbor_search.hpp +154 -34
- mlpack/include/mlpack/methods/neighbor_search/neighbor_search_impl.hpp +190 -51
- mlpack/include/mlpack/methods/neighbor_search/neighbor_search_stat.hpp +10 -0
- mlpack/include/mlpack/methods/neighbor_search/ns_model.hpp +15 -15
- mlpack/include/mlpack/methods/neighbor_search/ns_model_impl.hpp +55 -46
- mlpack/include/mlpack/methods/neighbor_search/typedef.hpp +42 -2
- mlpack/include/mlpack/methods/pca/pca_impl.hpp +2 -2
- mlpack/include/mlpack/methods/perceptron/perceptron.hpp +2 -2
- mlpack/include/mlpack/methods/perceptron/perceptron_impl.hpp +1 -1
- mlpack/include/mlpack/methods/perceptron/perceptron_main.cpp +2 -2
- mlpack/include/mlpack/methods/preprocess/image_converter_main.cpp +2 -3
- mlpack/include/mlpack/methods/preprocess/preprocess_binarize_main.cpp +2 -2
- mlpack/include/mlpack/methods/preprocess/preprocess_describe_main.cpp +0 -1
- mlpack/include/mlpack/methods/preprocess/preprocess_imputer_main.cpp +50 -129
- mlpack/include/mlpack/methods/preprocess/preprocess_one_hot_encoding_main.cpp +6 -6
- mlpack/include/mlpack/methods/preprocess/preprocess_scale_main.cpp +2 -3
- mlpack/include/mlpack/methods/preprocess/preprocess_split_main.cpp +3 -4
- mlpack/include/mlpack/methods/preprocess/scaling_model.hpp +6 -8
- mlpack/include/mlpack/methods/preprocess/scaling_model_impl.hpp +18 -20
- mlpack/include/mlpack/methods/random_forest/random_forest.hpp +5 -5
- mlpack/include/mlpack/methods/random_forest/random_forest_impl.hpp +9 -9
- mlpack/include/mlpack/methods/range_search/range_search_main.cpp +1 -1
- mlpack/include/mlpack/methods/rann/krann_main.cpp +1 -1
- mlpack/include/mlpack/methods/regularized_svd/regularized_svd_function_impl.hpp +1 -1
- mlpack/include/mlpack/methods/reinforcement_learning/async_learning_impl.hpp +8 -8
- mlpack/include/mlpack/methods/reinforcement_learning/ddpg_impl.hpp +16 -16
- mlpack/include/mlpack/methods/reinforcement_learning/environment/acrobot.hpp +4 -4
- mlpack/include/mlpack/methods/reinforcement_learning/environment/cart_pole.hpp +3 -3
- mlpack/include/mlpack/methods/reinforcement_learning/environment/cont_double_pole_cart.hpp +6 -5
- mlpack/include/mlpack/methods/reinforcement_learning/environment/pendulum.hpp +6 -5
- mlpack/include/mlpack/methods/reinforcement_learning/policy/aggregated_policy.hpp +2 -2
- mlpack/include/mlpack/methods/reinforcement_learning/q_learning_impl.hpp +10 -10
- mlpack/include/mlpack/methods/reinforcement_learning/q_networks/categorical_dqn.hpp +21 -17
- mlpack/include/mlpack/methods/reinforcement_learning/q_networks/dueling_dqn.hpp +69 -77
- mlpack/include/mlpack/methods/reinforcement_learning/q_networks/simple_dqn.hpp +9 -9
- mlpack/include/mlpack/methods/reinforcement_learning/sac_impl.hpp +14 -14
- mlpack/include/mlpack/methods/reinforcement_learning/td3_impl.hpp +14 -14
- mlpack/include/mlpack/methods/softmax_regression/softmax_regression_function_impl.hpp +1 -1
- mlpack/include/mlpack/methods/svdplusplus/svdplusplus_function_impl.hpp +1 -1
- mlpack/include/mlpack/namespace_compat.hpp +1 -0
- mlpack/include/mlpack/prereqs.hpp +1 -0
- 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.7.0.dist-info/DELVEWHEEL +2 -0
- {mlpack-4.6.2.dist-info → mlpack-4.7.0.dist-info}/METADATA +2 -2
- {mlpack-4.6.2.dist-info → mlpack-4.7.0.dist-info}/RECORD +396 -377
- {mlpack-4.6.2.dist-info → mlpack-4.7.0.dist-info}/WHEEL +1 -1
- mlpack/include/mlpack/core/data/format.hpp +0 -31
- mlpack/include/mlpack/core/data/image_info.hpp +0 -102
- mlpack/include/mlpack/core/data/image_info_impl.hpp +0 -84
- mlpack/include/mlpack/core/data/load_image_impl.hpp +0 -171
- mlpack/include/mlpack/core/data/load_model_impl.hpp +0 -115
- mlpack/include/mlpack/core/data/load_vec_impl.hpp +0 -154
- mlpack/include/mlpack/core/data/map_policies/missing_policy.hpp +0 -148
- mlpack/include/mlpack/core/data/save_image_impl.hpp +0 -170
- mlpack/include/mlpack/core/data/types.hpp +0 -61
- mlpack/include/mlpack/core/data/types_impl.hpp +0 -83
- mlpack/include/mlpack/core/data/utilities.hpp +0 -158
- mlpack/include/mlpack/core/util/gitversion.hpp +0 -1
- mlpack/include/mlpack/methods/ann/convolution_rules/fft_convolution.hpp +0 -213
- mlpack/include/mlpack/methods/ann/convolution_rules/svd_convolution.hpp +0 -201
- mlpack/include/mlpack/methods/ann/layer/not_adapted/gru.hpp +0 -226
- mlpack/include/mlpack/methods/ann/layer/not_adapted/gru_impl.hpp +0 -367
- mlpack/include/mlpack/methods/ann/layer/not_adapted/lookup.hpp +0 -139
- mlpack/include/mlpack/methods/ann/layer/not_adapted/lookup_impl.hpp +0 -98
- mlpack-4.6.2.dist-info/DELVEWHEEL +0 -2
- {mlpack-4.6.2.dist-info → mlpack-4.7.0.dist-info}/top_level.txt +0 -0
- /mlpack.libs/{libopenblas-9e6d070f769e6580e8c55c0cf83b80a5.dll → libopenblas-c7f521b507686ddc25bee7538a80c374.dll} +0 -0
- /mlpack.libs/{msvcp140-50208655e42969b9a5ab8a4e0186bbb9.dll → msvcp140-a4c2229bdc2a2a630acdc095b4d86008.dll} +0 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file core/data/save_sparse.hpp
|
|
3
|
+
* @author Ryan Curtin
|
|
4
|
+
* @author Omar Shrit
|
|
5
|
+
*
|
|
6
|
+
* Internal implementation of sparse matrix save function.
|
|
7
|
+
*
|
|
8
|
+
* mlpack is free software; you may redistribute it and/or modify it under the
|
|
9
|
+
* terms of the 3-clause BSD license. You should have received a copy of the
|
|
10
|
+
* 3-clause BSD license along with mlpack. If not, see
|
|
11
|
+
* http://www.opensource.org/licenses/BSD-3-Clause for more information.
|
|
12
|
+
*/
|
|
13
|
+
#ifndef MLPACK_CORE_DATA_SAVE_SPARSE_HPP
|
|
14
|
+
#define MLPACK_CORE_DATA_SAVE_SPARSE_HPP
|
|
15
|
+
|
|
16
|
+
#include "save_matrix.hpp"
|
|
17
|
+
|
|
18
|
+
namespace mlpack {
|
|
19
|
+
|
|
20
|
+
// Save a Sparse Matrix
|
|
21
|
+
template<typename eT>
|
|
22
|
+
bool SaveSparse(const arma::SpMat<eT>& matrix,
|
|
23
|
+
TextOptions& opts,
|
|
24
|
+
const std::string& filename,
|
|
25
|
+
std::fstream& stream)
|
|
26
|
+
{
|
|
27
|
+
bool success = false;
|
|
28
|
+
arma::SpMat<eT> tmp;
|
|
29
|
+
|
|
30
|
+
// Transpose the matrix.
|
|
31
|
+
if (!opts.NoTranspose())
|
|
32
|
+
{
|
|
33
|
+
arma::SpMat<eT> tmp = trans(matrix);
|
|
34
|
+
success = SaveMatrix(tmp, opts, filename, stream);
|
|
35
|
+
}
|
|
36
|
+
else
|
|
37
|
+
success = SaveMatrix(matrix, opts, filename, stream);
|
|
38
|
+
|
|
39
|
+
return success;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
} // namespace mlpack
|
|
43
|
+
|
|
44
|
+
#endif
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
#include <mlpack/prereqs.hpp>
|
|
16
16
|
|
|
17
17
|
namespace mlpack {
|
|
18
|
-
namespace data {
|
|
19
18
|
|
|
20
19
|
/**
|
|
21
20
|
* A simple MaxAbs Scaler class.
|
|
@@ -116,7 +115,6 @@ class MaxAbsScaler
|
|
|
116
115
|
arma::vec scale;
|
|
117
116
|
}; // class MaxAbsScaler
|
|
118
117
|
|
|
119
|
-
} // namespace data
|
|
120
118
|
} // namespace mlpack
|
|
121
119
|
|
|
122
120
|
#endif
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
#include <mlpack/prereqs.hpp>
|
|
16
16
|
|
|
17
17
|
namespace mlpack {
|
|
18
|
-
namespace data {
|
|
19
18
|
|
|
20
19
|
/**
|
|
21
20
|
* A simple Mean Normalization class
|
|
@@ -54,9 +53,9 @@ class MeanNormalization
|
|
|
54
53
|
template<typename MatType>
|
|
55
54
|
void Fit(const MatType& input)
|
|
56
55
|
{
|
|
57
|
-
itemMean =
|
|
56
|
+
itemMean = mean(input, 1);
|
|
58
57
|
itemMin = min(input, 1);
|
|
59
|
-
itemMax =
|
|
58
|
+
itemMax = max(input, 1);
|
|
60
59
|
scale = itemMax - itemMin;
|
|
61
60
|
// Handling zeros in scale vector.
|
|
62
61
|
scale.for_each([](arma::vec::elem_type& val) { val =
|
|
@@ -123,7 +122,6 @@ class MeanNormalization
|
|
|
123
122
|
arma::vec scale;
|
|
124
123
|
}; // class MeanNormalization
|
|
125
124
|
|
|
126
|
-
} // namespace data
|
|
127
125
|
} // namespace mlpack
|
|
128
126
|
|
|
129
127
|
#endif
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
#include <mlpack/prereqs.hpp>
|
|
16
16
|
|
|
17
17
|
namespace mlpack {
|
|
18
|
-
namespace data {
|
|
19
18
|
|
|
20
19
|
/**
|
|
21
20
|
* A simple MinMax Scaler class
|
|
@@ -153,7 +152,6 @@ class MinMaxScaler
|
|
|
153
152
|
arma::vec scalerowmin;
|
|
154
153
|
}; // class MinMaxScaler
|
|
155
154
|
|
|
156
|
-
} // namespace data
|
|
157
155
|
} // namespace mlpack
|
|
158
156
|
|
|
159
157
|
#endif
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
#include <mlpack/core/math/ccov.hpp>
|
|
17
17
|
|
|
18
18
|
namespace mlpack {
|
|
19
|
-
namespace data {
|
|
20
19
|
|
|
21
20
|
/**
|
|
22
21
|
* A simple PCAWhitening class.
|
|
@@ -69,7 +68,7 @@ class PCAWhitening
|
|
|
69
68
|
template<typename MatType>
|
|
70
69
|
void Fit(const MatType& input)
|
|
71
70
|
{
|
|
72
|
-
itemMean =
|
|
71
|
+
itemMean = mean(input, 1);
|
|
73
72
|
// Get eigenvectors and eigenvalues of covariance of input matrix.
|
|
74
73
|
eig_sym(eigenValues, eigenVectors, ColumnCovariance(
|
|
75
74
|
input.each_col() - itemMean));
|
|
@@ -139,7 +138,6 @@ class PCAWhitening
|
|
|
139
138
|
arma::vec eigenValues;
|
|
140
139
|
}; // class PCAWhitening
|
|
141
140
|
|
|
142
|
-
} // namespace data
|
|
143
141
|
} // namespace mlpack
|
|
144
142
|
|
|
145
143
|
#endif
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
#include <mlpack/prereqs.hpp>
|
|
16
16
|
|
|
17
17
|
namespace mlpack {
|
|
18
|
-
namespace data {
|
|
19
18
|
|
|
20
19
|
/**
|
|
21
20
|
* A simple Standard Scaler class
|
|
@@ -55,8 +54,8 @@ class StandardScaler
|
|
|
55
54
|
template<typename MatType>
|
|
56
55
|
void Fit(const MatType& input)
|
|
57
56
|
{
|
|
58
|
-
itemMean =
|
|
59
|
-
itemStdDev =
|
|
57
|
+
itemMean = mean(input, 1);
|
|
58
|
+
itemStdDev = stddev(input, 1, 1);
|
|
60
59
|
// Handle zeros in scale vector.
|
|
61
60
|
itemStdDev.for_each([](arma::vec::elem_type& val) { val =
|
|
62
61
|
(val == 0) ? 1 : val; });
|
|
@@ -112,7 +111,6 @@ class StandardScaler
|
|
|
112
111
|
arma::vec itemStdDev;
|
|
113
112
|
}; // class StandardScaler
|
|
114
113
|
|
|
115
|
-
} // namespace data
|
|
116
114
|
} // namespace mlpack
|
|
117
115
|
|
|
118
116
|
#endif
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
#include <mlpack/core/data/scaler_methods/pca_whitening.hpp>
|
|
17
17
|
|
|
18
18
|
namespace mlpack {
|
|
19
|
-
namespace data {
|
|
20
19
|
|
|
21
20
|
/**
|
|
22
21
|
* A simple ZCAWhitening class.
|
|
@@ -111,7 +110,6 @@ class ZCAWhitening
|
|
|
111
110
|
PCAWhitening pca;
|
|
112
111
|
}; // class ZCAWhitening
|
|
113
112
|
|
|
114
|
-
} // namespace data
|
|
115
113
|
} // namespace mlpack
|
|
116
114
|
|
|
117
115
|
#endif
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
#include <mlpack/prereqs.hpp>
|
|
17
17
|
|
|
18
18
|
namespace mlpack {
|
|
19
|
-
namespace data {
|
|
20
19
|
|
|
21
20
|
/**
|
|
22
21
|
* This helper function splits any `input` data into training and testing parts.
|
|
@@ -191,9 +190,9 @@ void StratifiedSplit(const arma::Mat<T>& input,
|
|
|
191
190
|
const bool typeCheck = (arma::is_Row<LabelsType>::value)
|
|
192
191
|
|| (arma::is_Col<LabelsType>::value);
|
|
193
192
|
if (!typeCheck)
|
|
194
|
-
throw std::runtime_error("
|
|
193
|
+
throw std::runtime_error("Split(): when stratified sampling is done, "
|
|
195
194
|
"labels must have type `arma::Row<>`!");
|
|
196
|
-
util::CheckSameSizes(input, inputLabel, "
|
|
195
|
+
util::CheckSameSizes(input, inputLabel, "Split()");
|
|
197
196
|
size_t trainIdx = 0;
|
|
198
197
|
size_t testIdx = 0;
|
|
199
198
|
size_t trainSize = 0;
|
|
@@ -309,7 +308,7 @@ void Split(const MatType& input,
|
|
|
309
308
|
const double testRatio,
|
|
310
309
|
const bool shuffleData = true)
|
|
311
310
|
{
|
|
312
|
-
util::CheckSameSizes(input, inputLabel, "
|
|
311
|
+
util::CheckSameSizes(input, inputLabel, "Split()");
|
|
313
312
|
if (shuffleData)
|
|
314
313
|
{
|
|
315
314
|
arma::uvec order = arma::shuffle(arma::linspace<arma::uvec>(0,
|
|
@@ -422,8 +421,8 @@ void Split(const MatType& input,
|
|
|
422
421
|
const double testRatio,
|
|
423
422
|
const bool shuffleData = true)
|
|
424
423
|
{
|
|
425
|
-
util::CheckSameSizes(input, inputLabels, "
|
|
426
|
-
util::CheckSameSizes(input, inputWeights, "
|
|
424
|
+
util::CheckSameSizes(input, inputLabels, "Split()");
|
|
425
|
+
util::CheckSameSizes(input, inputWeights, "Split()");
|
|
427
426
|
if (shuffleData)
|
|
428
427
|
{
|
|
429
428
|
arma::uvec order = arma::shuffle(arma::linspace<arma::uvec>(0,
|
|
@@ -625,7 +624,7 @@ void Split(const FieldType& input,
|
|
|
625
624
|
const double testRatio,
|
|
626
625
|
const bool shuffleData = true)
|
|
627
626
|
{
|
|
628
|
-
util::CheckSameSizes(input, inputLabel, "
|
|
627
|
+
util::CheckSameSizes(input, inputLabel, "Split()");
|
|
629
628
|
if (shuffleData)
|
|
630
629
|
{
|
|
631
630
|
arma::uvec order = arma::shuffle(arma::linspace<arma::uvec>(0,
|
|
@@ -733,7 +732,6 @@ Split(const FieldType& input,
|
|
|
733
732
|
std::move(testData));
|
|
734
733
|
}
|
|
735
734
|
|
|
736
|
-
} // namespace data
|
|
737
735
|
} // namespace mlpack
|
|
738
736
|
|
|
739
737
|
#endif
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
#define MLPACK_CORE_DATA_STRING_ALGORITHMS_HPP
|
|
15
15
|
|
|
16
16
|
namespace mlpack {
|
|
17
|
-
namespace data {
|
|
18
17
|
|
|
19
18
|
/**
|
|
20
19
|
* Trim off characters from start and end of
|
|
@@ -122,7 +121,6 @@ inline std::vector<std::string> Tokenize(
|
|
|
122
121
|
return tokens;
|
|
123
122
|
}
|
|
124
123
|
|
|
125
|
-
} // namespace data
|
|
126
124
|
} // namespace mlpack
|
|
127
125
|
|
|
128
126
|
#endif
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
#include <vector>
|
|
20
20
|
|
|
21
21
|
namespace mlpack {
|
|
22
|
-
namespace data {
|
|
23
22
|
|
|
24
23
|
/**
|
|
25
24
|
* The class translates a set of strings into numbers using various encoding
|
|
@@ -208,7 +207,6 @@ class StringEncoding
|
|
|
208
207
|
DictionaryType dictionary;
|
|
209
208
|
};
|
|
210
209
|
|
|
211
|
-
} // namespace data
|
|
212
210
|
} // namespace mlpack
|
|
213
211
|
|
|
214
212
|
// Include implementation.
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
#include <unordered_map>
|
|
22
22
|
|
|
23
23
|
namespace mlpack {
|
|
24
|
-
namespace data {
|
|
25
24
|
|
|
26
25
|
/**
|
|
27
26
|
* This class provides a dictionary interface for the purpose of string
|
|
@@ -343,7 +342,6 @@ class StringEncodingDictionary<int>
|
|
|
343
342
|
size_t size;
|
|
344
343
|
};
|
|
345
344
|
|
|
346
|
-
} // namespace data
|
|
347
345
|
} // namespace mlpack
|
|
348
346
|
|
|
349
347
|
#endif
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
#include <type_traits>
|
|
19
19
|
|
|
20
20
|
namespace mlpack {
|
|
21
|
-
namespace data {
|
|
22
21
|
|
|
23
22
|
template<typename EncodingPolicyType, typename DictionaryType>
|
|
24
23
|
template<typename ... ArgTypes>
|
|
@@ -205,7 +204,6 @@ void StringEncoding<EncodingPolicyType, DictionaryType>::serialize(
|
|
|
205
204
|
ar(CEREAL_NVP(dictionary));
|
|
206
205
|
}
|
|
207
206
|
|
|
208
|
-
} // namespace data
|
|
209
207
|
} // namespace mlpack
|
|
210
208
|
|
|
211
209
|
#endif
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
#include <mlpack/core/data/string_encoding.hpp>
|
|
19
19
|
|
|
20
20
|
namespace mlpack {
|
|
21
|
-
namespace data {
|
|
22
21
|
|
|
23
22
|
/**
|
|
24
23
|
* Definition of the BagOfWordsEncodingPolicy class.
|
|
@@ -165,7 +164,6 @@ class BagOfWordsEncodingPolicy
|
|
|
165
164
|
template<typename TokenType>
|
|
166
165
|
using BagOfWordsEncoding = StringEncoding<BagOfWordsEncodingPolicy,
|
|
167
166
|
StringEncodingDictionary<TokenType>>;
|
|
168
|
-
} // namespace data
|
|
169
167
|
} // namespace mlpack
|
|
170
168
|
|
|
171
169
|
#endif
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
#include <mlpack/core/data/string_encoding.hpp>
|
|
19
19
|
|
|
20
20
|
namespace mlpack {
|
|
21
|
-
namespace data {
|
|
22
21
|
|
|
23
22
|
/**
|
|
24
23
|
* DicitonaryEnocdingPolicy is used as a helper class for StringEncoding.
|
|
@@ -144,7 +143,6 @@ struct StringEncodingPolicyTraits<DictionaryEncodingPolicy>
|
|
|
144
143
|
template<typename TokenType>
|
|
145
144
|
using DictionaryEncoding = StringEncoding<DictionaryEncodingPolicy,
|
|
146
145
|
StringEncodingDictionary<TokenType>>;
|
|
147
|
-
} // namespace data
|
|
148
146
|
} // namespace mlpack
|
|
149
147
|
|
|
150
148
|
#endif
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
#include <mlpack/prereqs.hpp>
|
|
18
18
|
|
|
19
19
|
namespace mlpack {
|
|
20
|
-
namespace data {
|
|
21
20
|
|
|
22
21
|
/**
|
|
23
22
|
* This is a template struct that provides some information about various
|
|
@@ -33,7 +32,6 @@ struct StringEncodingPolicyTraits
|
|
|
33
32
|
static const bool onePassEncoding = false;
|
|
34
33
|
};
|
|
35
34
|
|
|
36
|
-
} // namespace data
|
|
37
35
|
} // namespace mlpack
|
|
38
36
|
|
|
39
37
|
#endif
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
#include <mlpack/core/data/string_encoding.hpp>
|
|
19
19
|
|
|
20
20
|
namespace mlpack {
|
|
21
|
-
namespace data {
|
|
22
21
|
|
|
23
22
|
/**
|
|
24
23
|
* Definition of the TfIdfEncodingPolicy class. TfIdfEncodingPolicy is used
|
|
@@ -343,7 +342,6 @@ class TfIdfEncodingPolicy
|
|
|
343
342
|
template<typename TokenType>
|
|
344
343
|
using TfIdfEncoding = StringEncoding<TfIdfEncodingPolicy,
|
|
345
344
|
StringEncodingDictionary<TokenType>>;
|
|
346
|
-
} // namespace data
|
|
347
345
|
} // namespace mlpack
|
|
348
346
|
|
|
349
347
|
#endif
|
|
@@ -19,46 +19,47 @@
|
|
|
19
19
|
#include "matrix_options.hpp"
|
|
20
20
|
|
|
21
21
|
namespace mlpack {
|
|
22
|
-
namespace data {
|
|
23
22
|
|
|
24
23
|
class TextOptions : public MatrixOptionsBase<TextOptions>
|
|
25
24
|
{
|
|
26
25
|
public:
|
|
27
26
|
// TODO: pass through noTranspose option?
|
|
28
|
-
TextOptions(bool hasHeaders =
|
|
29
|
-
bool semicolon =
|
|
30
|
-
bool missingToNan =
|
|
31
|
-
bool categorical =
|
|
32
|
-
bool missingPolicy = defaultMissingPolicy) :
|
|
27
|
+
TextOptions(std::optional<bool> hasHeaders = std::nullopt,
|
|
28
|
+
std::optional<bool> semicolon = std::nullopt,
|
|
29
|
+
std::optional<bool> missingToNan = std::nullopt,
|
|
30
|
+
std::optional<bool> categorical = std::nullopt) :
|
|
33
31
|
MatrixOptionsBase<TextOptions>(),
|
|
34
32
|
hasHeaders(hasHeaders),
|
|
35
33
|
semicolon(semicolon),
|
|
36
34
|
missingToNan(missingToNan),
|
|
37
|
-
categorical(categorical)
|
|
38
|
-
missingPolicy(missingPolicy)
|
|
35
|
+
categorical(categorical)
|
|
39
36
|
{
|
|
40
37
|
// Do Nothing.
|
|
41
38
|
}
|
|
42
39
|
|
|
43
|
-
|
|
40
|
+
//
|
|
41
|
+
// Handling for copy and move operations on other TextOptions objects.
|
|
42
|
+
//
|
|
43
|
+
|
|
44
|
+
TextOptions(const DataOptionsBase<MatrixOptionsBase<TextOptions>>& opts) :
|
|
44
45
|
MatrixOptionsBase<TextOptions>()
|
|
45
46
|
{
|
|
46
47
|
// Delegate to copy operator.
|
|
47
48
|
*this = opts;
|
|
48
49
|
}
|
|
49
50
|
|
|
50
|
-
|
|
51
|
+
TextOptions(DataOptionsBase<MatrixOptionsBase<TextOptions>>&& opts) :
|
|
51
52
|
MatrixOptionsBase<TextOptions>()
|
|
52
53
|
{
|
|
53
54
|
// Delegate to move operator.
|
|
54
55
|
*this = std::move(opts);
|
|
55
56
|
}
|
|
56
57
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
TextOptions& operator=(const TextOptions& other)
|
|
58
|
+
TextOptions& operator=(
|
|
59
|
+
const DataOptionsBase<MatrixOptionsBase<TextOptions>>& otherIn)
|
|
61
60
|
{
|
|
61
|
+
const TextOptions& other = static_cast<const TextOptions&>(otherIn);
|
|
62
|
+
|
|
62
63
|
if (&other == this)
|
|
63
64
|
return *this;
|
|
64
65
|
|
|
@@ -70,12 +71,9 @@ class TextOptions : public MatrixOptionsBase<TextOptions>
|
|
|
70
71
|
missingToNan = *other.missingToNan;
|
|
71
72
|
if (other.categorical.has_value())
|
|
72
73
|
categorical = *other.categorical;
|
|
73
|
-
if (other.missingPolicy.has_value())
|
|
74
|
-
missingPolicy = *other.missingPolicy;
|
|
75
74
|
|
|
76
75
|
headers = other.headers;
|
|
77
76
|
datasetInfo = other.datasetInfo;
|
|
78
|
-
datasetMissingPolicy = other.datasetMissingPolicy;
|
|
79
77
|
|
|
80
78
|
// Copy base members.
|
|
81
79
|
MatrixOptionsBase<TextOptions>::operator=(other);
|
|
@@ -83,8 +81,11 @@ class TextOptions : public MatrixOptionsBase<TextOptions>
|
|
|
83
81
|
return *this;
|
|
84
82
|
}
|
|
85
83
|
|
|
86
|
-
TextOptions& operator=(
|
|
84
|
+
TextOptions& operator=(
|
|
85
|
+
DataOptionsBase<MatrixOptionsBase<TextOptions>>&& otherIn)
|
|
87
86
|
{
|
|
87
|
+
TextOptions&& other = static_cast<TextOptions&&>(otherIn);
|
|
88
|
+
|
|
88
89
|
if (&other == this)
|
|
89
90
|
return *this;
|
|
90
91
|
|
|
@@ -92,11 +93,9 @@ class TextOptions : public MatrixOptionsBase<TextOptions>
|
|
|
92
93
|
semicolon = std::move(other.semicolon);
|
|
93
94
|
missingToNan = std::move(other.missingToNan);
|
|
94
95
|
categorical = std::move(other.categorical);
|
|
95
|
-
missingPolicy = std::move(other.missingPolicy);
|
|
96
96
|
|
|
97
97
|
headers = std::move(other.headers);
|
|
98
98
|
datasetInfo = std::move(other.datasetInfo);
|
|
99
|
-
datasetMissingPolicy = std::move(other.datasetMissingPolicy);
|
|
100
99
|
|
|
101
100
|
// Move base members.
|
|
102
101
|
MatrixOptionsBase<TextOptions>::operator=(std::move(other));
|
|
@@ -104,6 +103,55 @@ class TextOptions : public MatrixOptionsBase<TextOptions>
|
|
|
104
103
|
return *this;
|
|
105
104
|
}
|
|
106
105
|
|
|
106
|
+
//
|
|
107
|
+
// Handling for copy and move operations on other DataOptionsBase types.
|
|
108
|
+
//
|
|
109
|
+
|
|
110
|
+
// Conversions must be explicit.
|
|
111
|
+
template<typename Derived2>
|
|
112
|
+
explicit TextOptions(const DataOptionsBase<Derived2>& other) :
|
|
113
|
+
MatrixOptionsBase<TextOptions>(other) { }
|
|
114
|
+
|
|
115
|
+
template<typename Derived2>
|
|
116
|
+
explicit TextOptions(DataOptionsBase<Derived2>&& other) :
|
|
117
|
+
MatrixOptionsBase<TextOptions>(std::move(other)) { }
|
|
118
|
+
|
|
119
|
+
template<typename Derived2>
|
|
120
|
+
TextOptions& operator=(const DataOptionsBase<Derived2>& other)
|
|
121
|
+
{
|
|
122
|
+
return static_cast<TextOptions&>(
|
|
123
|
+
MatrixOptionsBase<TextOptions>::operator=(other));
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
template<typename Derived2>
|
|
127
|
+
TextOptions& operator=(DataOptionsBase<Derived2>&& other)
|
|
128
|
+
{
|
|
129
|
+
return static_cast<TextOptions&>(
|
|
130
|
+
MatrixOptionsBase<TextOptions>::operator=(std::move(other)));
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
void Combine(const TextOptions& other)
|
|
134
|
+
{
|
|
135
|
+
// Combine all boolean options.
|
|
136
|
+
hasHeaders =
|
|
137
|
+
DataOptionsBase<MatrixOptionsBase<TextOptions>>::CombineBooleanOption(
|
|
138
|
+
hasHeaders, other.hasHeaders, "HasHeaders()");
|
|
139
|
+
missingToNan =
|
|
140
|
+
DataOptionsBase<MatrixOptionsBase<TextOptions>>::CombineBooleanOption(
|
|
141
|
+
missingToNan, other.missingToNan, "MissingToNan()");
|
|
142
|
+
categorical =
|
|
143
|
+
DataOptionsBase<MatrixOptionsBase<TextOptions>>::CombineBooleanOption(
|
|
144
|
+
categorical, other.categorical, "Categorical()");
|
|
145
|
+
semicolon =
|
|
146
|
+
DataOptionsBase<MatrixOptionsBase<TextOptions>>::CombineBooleanOption(
|
|
147
|
+
semicolon, other.semicolon, "Semicolon()");
|
|
148
|
+
|
|
149
|
+
// Whenever we combine two TextOptions, we reset the headers and
|
|
150
|
+
// datasetInfo.
|
|
151
|
+
headers.clear();
|
|
152
|
+
datasetInfo = DatasetInfo();
|
|
153
|
+
}
|
|
154
|
+
|
|
107
155
|
// Print warnings for any members that cannot be represented by a
|
|
108
156
|
// DataOptionsBase<void>.
|
|
109
157
|
void WarnBaseConversion(const char* dataDescription) const
|
|
@@ -133,7 +181,9 @@ class TextOptions : public MatrixOptionsBase<TextOptions>
|
|
|
133
181
|
semicolon.reset();
|
|
134
182
|
missingToNan.reset();
|
|
135
183
|
categorical.reset();
|
|
136
|
-
|
|
184
|
+
|
|
185
|
+
headers.clear();
|
|
186
|
+
datasetInfo = DatasetInfo();
|
|
137
187
|
}
|
|
138
188
|
|
|
139
189
|
// Get if the dataset has headers or not.
|
|
@@ -153,7 +203,7 @@ class TextOptions : public MatrixOptionsBase<TextOptions>
|
|
|
153
203
|
return this->AccessMember(semicolon, defaultSemicolon);
|
|
154
204
|
}
|
|
155
205
|
// Modify the separator type in the matrix.
|
|
156
|
-
bool&
|
|
206
|
+
bool& Semicolon()
|
|
157
207
|
{
|
|
158
208
|
return this->ModifyMember(semicolon, defaultSemicolon);
|
|
159
209
|
}
|
|
@@ -182,63 +232,51 @@ class TextOptions : public MatrixOptionsBase<TextOptions>
|
|
|
182
232
|
return this->ModifyMember(categorical, defaultCategorical);
|
|
183
233
|
}
|
|
184
234
|
|
|
185
|
-
// Get whether the data should be interpreted as categorical when columns are
|
|
186
|
-
// not numeric.
|
|
187
|
-
bool MissingPolicy() const
|
|
188
|
-
{
|
|
189
|
-
return this->AccessMember(missingPolicy, defaultMissingPolicy);
|
|
190
|
-
}
|
|
191
|
-
// Modify whether the data should be interpreted as missingPolicy when columns
|
|
192
|
-
// are not numeric.
|
|
193
|
-
bool& MissingPolicy()
|
|
194
|
-
{
|
|
195
|
-
return this->ModifyMember(missingPolicy, defaultMissingPolicy);
|
|
196
|
-
}
|
|
197
|
-
|
|
198
235
|
// Get the headers.
|
|
199
236
|
const arma::field<std::string>& Headers() const { return headers; }
|
|
200
237
|
// Modify the headers.
|
|
201
238
|
arma::field<std::string>& Headers() { return headers; }
|
|
202
239
|
|
|
203
240
|
// Get the DatasetInfo for categorical data.
|
|
204
|
-
const
|
|
205
|
-
// Modify the DatasetInfo.
|
|
206
|
-
data::DatasetInfo& DatasetInfo() { return datasetInfo; }
|
|
207
|
-
|
|
208
|
-
// Get the DatasetInfo for categorical data.
|
|
209
|
-
const data::DatasetMapper<data::MissingPolicy>& DatasetMissingPolicy() const
|
|
241
|
+
const DatasetMapper<IncrementPolicy>& DatasetInfo() const
|
|
210
242
|
{
|
|
211
|
-
return
|
|
243
|
+
return datasetInfo;
|
|
212
244
|
}
|
|
213
245
|
|
|
214
|
-
// Modify the
|
|
215
|
-
|
|
216
|
-
{
|
|
217
|
-
return datasetMissingPolicy;
|
|
218
|
-
}
|
|
246
|
+
// Modify the DatasetInfo.
|
|
247
|
+
DatasetMapper<IncrementPolicy>& DatasetInfo() { return datasetInfo; }
|
|
219
248
|
|
|
220
249
|
private:
|
|
221
250
|
std::optional<bool> hasHeaders;
|
|
222
251
|
std::optional<bool> semicolon;
|
|
223
252
|
std::optional<bool> missingToNan;
|
|
224
253
|
std::optional<bool> categorical;
|
|
225
|
-
std::optional<bool> missingPolicy;
|
|
226
254
|
|
|
227
255
|
// These are not optional, but if either is specified, then it should be taken
|
|
228
256
|
// to mean that `hasHeaders` or `categorical` has been specified as true.
|
|
229
257
|
arma::field<std::string> headers;
|
|
230
|
-
|
|
231
|
-
// Temporary internal member until MissingPolicy is refactored out.
|
|
232
|
-
data::DatasetMapper<data::MissingPolicy> datasetMissingPolicy;
|
|
258
|
+
DatasetMapper<IncrementPolicy> datasetInfo;
|
|
233
259
|
|
|
234
260
|
constexpr static const bool defaultHasHeaders = false;
|
|
235
261
|
constexpr static const bool defaultSemicolon = false;
|
|
236
262
|
constexpr static const bool defaultMissingToNan = false;
|
|
237
263
|
constexpr static const bool defaultCategorical = false;
|
|
238
|
-
constexpr static const bool defaultMissingPolicy = false;
|
|
239
264
|
};
|
|
240
265
|
|
|
241
|
-
|
|
266
|
+
// Boolean options
|
|
267
|
+
static const TextOptions HasHeaders = TextOptions(true);
|
|
268
|
+
static const TextOptions Semicolon = TextOptions(std::nullopt, true);
|
|
269
|
+
static const TextOptions MissingToNan = TextOptions(std::nullopt, std::nullopt,
|
|
270
|
+
true);
|
|
271
|
+
static const TextOptions Categorical = TextOptions(std::nullopt,
|
|
272
|
+
std::nullopt, std::nullopt, true);
|
|
273
|
+
|
|
274
|
+
template<>
|
|
275
|
+
struct IsDataOptions<TextOptions>
|
|
276
|
+
{
|
|
277
|
+
constexpr static bool value = true;
|
|
278
|
+
};
|
|
279
|
+
|
|
242
280
|
} // namespace mlpack
|
|
243
281
|
|
|
244
282
|
#endif
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
#include <mlpack/prereqs.hpp>
|
|
18
18
|
|
|
19
19
|
namespace mlpack {
|
|
20
|
-
namespace data {
|
|
21
20
|
|
|
22
21
|
/**
|
|
23
22
|
* The class is used to split a string into characters.
|
|
@@ -59,7 +58,6 @@ class CharExtract
|
|
|
59
58
|
}
|
|
60
59
|
};
|
|
61
60
|
|
|
62
|
-
} // namespace data
|
|
63
61
|
} // namespace mlpack
|
|
64
62
|
|
|
65
63
|
#endif
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
#include <array>
|
|
19
19
|
|
|
20
20
|
namespace mlpack {
|
|
21
|
-
namespace data {
|
|
22
21
|
|
|
23
22
|
/**
|
|
24
23
|
* The SplitByAnyOf class tokenizes a string using a set of delimiters.
|
|
@@ -112,7 +111,6 @@ class SplitByAnyOf
|
|
|
112
111
|
MaskType mask;
|
|
113
112
|
};
|
|
114
113
|
|
|
115
|
-
} // namespace data
|
|
116
114
|
} // namespace mlpack
|
|
117
115
|
|
|
118
116
|
#endif
|
|
@@ -59,12 +59,12 @@ inline void GammaDistribution<MatType>::Train(const MatType& rdata,
|
|
|
59
59
|
const ElemType tol)
|
|
60
60
|
{
|
|
61
61
|
// If fittingSet is empty, nothing to do.
|
|
62
|
-
if (
|
|
62
|
+
if (rdata.is_empty())
|
|
63
63
|
return;
|
|
64
64
|
|
|
65
65
|
// Calculate log(mean(x)) and mean(log(x)) of each dataset row.
|
|
66
|
-
const VecType meanLogxVec =
|
|
67
|
-
const VecType meanxVec =
|
|
66
|
+
const VecType meanLogxVec = mean(log(rdata), 1);
|
|
67
|
+
const VecType meanxVec = mean(rdata, 1);
|
|
68
68
|
const VecType logMeanxVec = log(meanxVec);
|
|
69
69
|
|
|
70
70
|
// Call the statistics-only GammaDistribution::Train() function to fit the
|
|
@@ -79,7 +79,7 @@ inline void GammaDistribution<MatType>::Train(const MatType& rdata,
|
|
|
79
79
|
const ElemType tol)
|
|
80
80
|
{
|
|
81
81
|
// If fittingSet is empty, nothing to do.
|
|
82
|
-
if (
|
|
82
|
+
if (rdata.is_empty())
|
|
83
83
|
return;
|
|
84
84
|
|
|
85
85
|
VecType meanLogxVec(rdata.n_rows);
|