diff --git a/src/Bmlj/Clustering_mlj.jl b/src/Bmlj/Clustering_mlj.jl index bca2e604..ae4ac525 100644 --- a/src/Bmlj/Clustering_mlj.jl +++ b/src/Bmlj/Clustering_mlj.jl @@ -209,7 +209,10 @@ end # Model metadata for registration in MLJ... MMI.metadata_model(KMeansClusterer, - input_scitype = MMI.Table(MMI.Continuous), # scitype of the inputs + input_scitype = Union{ # scitype of the inputs + MMI.Table(MMI.Continuous), + AbstractMatrix{<: MMI.Continuous}, + }, output_scitype = MMI.Table(MMI.Continuous), # scitype of the output of `transform` target_scitype = AbstractArray{<:MMI.Multiclass}, # scitype of the output of `predict` supports_weights = false, # does the model support sample weights? @@ -217,7 +220,10 @@ MMI.metadata_model(KMeansClusterer, ) MMI.metadata_model(KMedoidsClusterer, - input_scitype = MMI.Table(MMI.Continuous), # scitype of the inputs + input_scitype = Union{ # scitype of the inputs + MMI.Table(MMI.Continuous), + AbstractMatrix{<: MMI.Continuous}, + }, output_scitype = MMI.Table(MMI.Continuous), # scitype of the output of `transform` target_scitype = AbstractArray{<:MMI.Multiclass}, # scitype of the output of `predict` supports_weights = false, # does the model support sample weights? diff --git a/src/Bmlj/GMM_mlj.jl b/src/Bmlj/GMM_mlj.jl index 2eea2f78..1c0a1bdd 100644 --- a/src/Bmlj/GMM_mlj.jl +++ b/src/Bmlj/GMM_mlj.jl @@ -426,7 +426,10 @@ end # Model metadata for registration in MLJ... MMI.metadata_model(GaussianMixtureClusterer, - input_scitype = MMI.Table(Union{MMI.Continuous,MMI.Missing}), + input_scitype = Union{ + MMI.Table(Union{MMI.Continuous,MMI.Missing}), + AbstractMatrix{<:Union{MMI.Continuous,MMI.Missing}}, + }, output_scitype = AbstractArray{<:MMI.Multiclass}, # scitype of the output of `transform` target_scitype = AbstractArray{<:MMI.Multiclass}, # scitype of the output of `predict` #prediction_type = :probabilistic, # option not added to metadata_model function, need to do it separately @@ -436,13 +439,19 @@ MMI.metadata_model(GaussianMixtureClusterer, MMI.prediction_type(::Type{<:GaussianMixtureClusterer}) = :probabilistic MMI.metadata_model(GaussianMixtureRegressor, - input_scitype = MMI.Table(Union{MMI.Missing, MMI.Infinite}), + input_scitype = Union{ + MMI.Table(Union{MMI.Infinite,MMI.Missing}), + AbstractMatrix{<:Union{MMI.Infinite,MMI.Missing}}, + }, target_scitype = AbstractVector{<: MMI.Continuous}, # for a supervised model, what target? supports_weights = false, # does the model support sample weights? load_path = "BetaML.Bmlj.GaussianMixtureRegressor" ) MMI.metadata_model(MultitargetGaussianMixtureRegressor, - input_scitype = MMI.Table(Union{MMI.Missing, MMI.Infinite}), + input_scitype = Union{ + MMI.Table(Union{MMI.Infinite,MMI.Missing}), + AbstractMatrix{<:Union{MMI.Infinite,MMI.Missing}}, + }, target_scitype = AbstractMatrix{<: MMI.Continuous}, # for a supervised model, what target? supports_weights = false, # does the model support sample weights? load_path = "BetaML.Bmlj.MultitargetGaussianMixtureRegressor" diff --git a/src/Bmlj/Imputation_mlj.jl b/src/Bmlj/Imputation_mlj.jl index 4cd1b366..3279eecd 100644 --- a/src/Bmlj/Imputation_mlj.jl +++ b/src/Bmlj/Imputation_mlj.jl @@ -482,27 +482,39 @@ end # Model metadata for registration in MLJ... MMI.metadata_model(SimpleImputer, - input_scitype = MMI.Table(Union{MMI.Continuous,MMI.Missing}), + input_scitype = Union{ + MMI.Table(Union{MMI.Continuous,MMI.Missing}), + AbstractMatrix{<:Union{MMI.Continuous,MMI.Missing}}, + }, output_scitype = MMI.Table(MMI.Continuous), # for an unsupervised, what output? supports_weights = false, # does the model support sample weights? load_path = "BetaML.Bmlj.SimpleImputer" ) MMI.metadata_model(GaussianMixtureImputer, - input_scitype = MMI.Table(Union{MMI.Continuous,MMI.Missing}), + input_scitype = Union{ + MMI.Table(Union{MMI.Continuous,MMI.Missing}), + AbstractMatrix{<:Union{MMI.Continuous,MMI.Missing}}, + }, output_scitype = MMI.Table(MMI.Continuous), # for an unsupervised, what output? supports_weights = false, # does the model support sample weights? load_path = "BetaML.Bmlj.GaussianMixtureImputer" ) MMI.metadata_model(RandomForestImputer, - input_scitype = MMI.Table(Union{MMI.Missing, MMI.Known}), + input_scitype = Union{ + MMI.Table(Union{MMI.Known,MMI.Missing}), + AbstractMatrix{<:Union{MMI.Known,MMI.Missing}}, + }, output_scitype = MMI.Table(MMI.Known), # for an unsupervised, what output? supports_weights = false, # does the model support sample weights? load_path = "BetaML.Bmlj.RandomForestImputer" ) MMI.metadata_model(GeneralImputer, - input_scitype = MMI.Table(Union{MMI.Missing, MMI.Known}), + input_scitype = Union{ + MMI.Table(Union{MMI.Known,MMI.Missing}), + AbstractMatrix{<:Union{MMI.Known,MMI.Missing}}, + }, output_scitype = MMI.Table(MMI.Known), # for an unsupervised, what output? supports_weights = false, # does the model support sample weights? load_path = "BetaML.Bmlj.GeneralImputer" diff --git a/src/Bmlj/Nn_mlj.jl b/src/Bmlj/Nn_mlj.jl index 9a10d6b6..c6a813d4 100644 --- a/src/Bmlj/Nn_mlj.jl +++ b/src/Bmlj/Nn_mlj.jl @@ -110,7 +110,10 @@ function MMI.fit(m::NeuralNetworkRegressor, verbosity, X, y) MMI.predict(m::NeuralNetworkRegressor, fitresult, Xnew) = BetaML.Api.predict(fitresult, MMI.matrix(Xnew)) MMI.metadata_model(NeuralNetworkRegressor, - input_scitype = MMI.Table(Union{MMI.Continuous,MMI.Count}), + input_scitype = Union{ + MMI.Table(Union{MMI.Continuous,MMI.Count}), + AbstractMatrix{<:Union{MMI.Continuous,MMI.Count}}, + }, target_scitype = AbstractVector{<: Union{MMI.Continuous,MMI.Count}}, supports_weights = false, load_path = "BetaML.Bmlj.NeuralNetworkRegressor" @@ -223,7 +226,10 @@ function MMI.fit(m::MultitargetNeuralNetworkRegressor, verbosity, X, y) MMI.predict(m::MultitargetNeuralNetworkRegressor, fitresult, Xnew) = BetaML.Api.predict(fitresult, MMI.matrix(Xnew)) MMI.metadata_model(MultitargetNeuralNetworkRegressor, - input_scitype = MMI.Table(Union{MMI.Continuous,MMI.Count}), + input_scitype = Union{ + MMI.Table(Union{MMI.Continuous,MMI.Count}), + AbstractMatrix{<:Union{MMI.Continuous,MMI.Count}}, + }, target_scitype = AbstractMatrix{<: Union{MMI.Continuous,MMI.Count}}, supports_weights = false, load_path = "BetaML.Bmlj.MultitargetNeuralNetworkRegressor" @@ -365,7 +371,10 @@ function MMI.predict(m::NeuralNetworkClassifier, fitresult, Xnew) end MMI.metadata_model(NeuralNetworkClassifier, - input_scitype = MMI.Table(Union{MMI.Continuous,MMI.Count}), + input_scitype = Union{ + MMI.Table(Union{MMI.Continuous,MMI.Count}), + AbstractMatrix{<:Union{MMI.Continuous,MMI.Count}}, + }, target_scitype = AbstractVector{<: Union{MMI.Multiclass,MMI.Finite,MMI.Count}}, supports_weights = false, load_path = "BetaML.Bmlj.NeuralNetworkClassifier" diff --git a/src/Bmlj/Perceptron_mlj.jl b/src/Bmlj/Perceptron_mlj.jl index 54098411..8c23b047 100644 --- a/src/Bmlj/Perceptron_mlj.jl +++ b/src/Bmlj/Perceptron_mlj.jl @@ -304,21 +304,30 @@ end # Model metadata for registration in MLJ... MMI.metadata_model(PerceptronClassifier, - input_scitype = MMI.Table(MMI.Infinite), + input_scitype = Union{ + MMI.Table(MMI.Infinite), + AbstractMatrix{<: MMI.Infinite}, + }, target_scitype = AbstractVector{<: MMI.Finite}, supports_weights = false, load_path = "BetaML.Bmlj.PerceptronClassifier" ) MMI.metadata_model(KernelPerceptronClassifier, - input_scitype = MMI.Table(MMI.Infinite), + input_scitype = Union{ + MMI.Table(MMI.Infinite), + AbstractMatrix{<: MMI.Infinite}, + }, target_scitype = AbstractVector{<: MMI.Finite}, supports_weights = false, load_path = "BetaML.Bmlj.KernelPerceptronClassifier" ) MMI.metadata_model(PegasosClassifier, - input_scitype = MMI.Table(MMI.Infinite), + input_scitype = Union{ + MMI.Table(MMI.Infinite), + AbstractMatrix{<: MMI.Infinite}, + }, target_scitype = AbstractVector{<: MMI.Finite}, supports_weights = false, load_path = "BetaML.Bmlj.PegasosClassifier" diff --git a/src/Bmlj/Trees_mlj.jl b/src/Bmlj/Trees_mlj.jl index 9330979f..780a6565 100644 --- a/src/Bmlj/Trees_mlj.jl +++ b/src/Bmlj/Trees_mlj.jl @@ -378,25 +378,37 @@ end # Model metadata for registration in MLJ... MMI.metadata_model(DecisionTreeRegressor, - input_scitype = MMI.Table(Union{MMI.Missing, MMI.Known}), + input_scitype = Union{ + MMI.Table(Union{MMI.Known,MMI.Missing}), + AbstractMatrix{<:Union{MMI.Known,MMI.Missing}}, + }, target_scitype = AbstractVector{<: MMI.Continuous}, # for a supervised model, what target? supports_weights = false, # does the model support sample weights? load_path = "BetaML.Bmlj.DecisionTreeRegressor" ) MMI.metadata_model(RandomForestRegressor, - input_scitype = MMI.Table(Union{MMI.Missing, MMI.Known}), + input_scitype = Union{ + MMI.Table(Union{MMI.Known,MMI.Missing}), + AbstractMatrix{<:Union{MMI.Known,MMI.Missing}}, + }, target_scitype = AbstractVector{<: MMI.Continuous}, supports_weights = false, load_path = "BetaML.Bmlj.RandomForestRegressor" ) MMI.metadata_model(DecisionTreeClassifier, - input_scitype = MMI.Table(Union{MMI.Missing, MMI.Known}), + input_scitype = Union{ + MMI.Table(Union{MMI.Known,MMI.Missing}), + AbstractMatrix{<:Union{MMI.Known,MMI.Missing}}, + }, target_scitype = AbstractVector{<: Union{MMI.Missing,MMI.Finite}}, supports_weights = false, load_path = "BetaML.Bmlj.DecisionTreeClassifier" ) MMI.metadata_model(RandomForestClassifier, - input_scitype = MMI.Table(Union{MMI.Missing, MMI.Known}), + input_scitype = Union{ + MMI.Table(Union{MMI.Known,MMI.Missing}), + AbstractMatrix{<:Union{MMI.Known,MMI.Missing}}, + }, target_scitype = AbstractVector{<: Union{MMI.Missing,MMI.Finite}}, supports_weights = false, load_path = "BetaML.Bmlj.RandomForestClassifier" diff --git a/src/Bmlj/Utils_mlj.jl b/src/Bmlj/Utils_mlj.jl index 03aa11d6..290dd410 100644 --- a/src/Bmlj/Utils_mlj.jl +++ b/src/Bmlj/Utils_mlj.jl @@ -157,9 +157,11 @@ function MMI.fit(m::AutoEncoder, verbosity, X) MMI.inverse_transform(m::AutoEncoder, fitresult, Xnew) = BetaML.Api.inverse_predict(fitresult, MMI.matrix(Xnew)) - MMI.metadata_model(AutoEncoder, - input_scitype = MMI.Table(Union{MMI.Continuous,MMI.Count}), + input_scitype = Union{ + MMI.Table(Union{MMI.Continuous,MMI.Count}), + AbstractMatrix{<:Union{MMI.Continuous,MMI.Count}}, + }, output_scitype = AbstractMatrix{<: Union{MMI.Continuous,MMI.Count}}, supports_weights = false, load_path = "BetaML.Bmlj.AutoEncoder"