Comments (3)
I have implemented the mixtures option in the MLJ interface as either :diag_gaussian
, :full_gaussian
or :spherical_gaussian
.
For the rest I would prefer keep the model current approach for now.
from betaml.jl.
Hello, I have implemented deepcopy of the model initial mixtures in commit 5ea564f340c9ec9246d51eac8098e44058820ac9 so that the original model mixtures (and initial mixture prior probabilities) aren't modified in fit
.
Be aware however that the check you used still wouldn't work. In Julia indeed custom types (as BetaML.Mixture
) need to implement ==
explicitly and I didn't do it for the mixtures I defined:
struct MyStruct
x::Int64
end
obj1 = MyStruct(1)
obj2 = MyStruct(2)
obj3 = deepcopy(obj1)
obj1 == obj2 # false
obj3 == obj2 # false
# Let's implement `==` for MyStruct:
import Base.==
==(a::MyStruct,b::MyStruct) = a.x == a.x
obj1 == obj2 # now it's true
obj3 == obj2 # now it's true
from betaml.jl.
Yes, you are right, I had overlooked this (despite having overloaded ==
for Model
precisely for this reason 😄 ). This issue should be made explicit in the model API docs.
At first glance, this is likely not an issue in this case. As far as I can tell, the only place ==
for models is used is to check conditions for a "warm restart" when fit!
ing a machine (https://alan-turing-institute.github.io/MLJ.jl/dev/machines/). If your model does not implement MMI.update
, this is a moot point.
However, I think passing "empty objects" as way of specifying what is required is not ideal. What about doing something like mixtures=:diagonal_guassian
. That way the user needn't refer to (and first find) the custom type DiagonalGuassian
(currently buried as BetaML.Clustering.DiagonalGuassian
). If possible, it's nice if users do not need to refer to model-specific types.
If the point is to maintain an interface point for "partially trained" mixtures, then the appropriate way to integrate with MLJ is to pass the mixtures (and posterior class probabilities) calculated by fit
to cache
and implement MMI.update
, which continues training where it left off if the only change to the model is the iteration parameter (tested with MMI.is_same_except
method). See https://alan-turing-institute.github.io/MLJ.jl/dev/adding_models_for_general_use/#Iterative-models-and-the-update!-method-1 . User access to trained mixtures is via fitted_params
. (Another advantage of doing this is that MLJ will very soon have a model wrapper for controlling any iterative model of this kind, provided it is supervised - one reason for my suggesting having an implementation of GMM that is supervised.)
I should say that implementing update
for the EM-based models is bells and whistles that could be added later. But good to keep in mind.
from betaml.jl.
Related Issues (20)
- Trouble interpolating feature names in a wrapped tree HOT 13
- MLJ model docstrings HOT 3
- GaussianMixtureModelClusterer docstring has formatting issues HOT 1
- Can we have floats rounded to 4 significant digits in decision tree displays? HOT 3
- Add PAM algorithm to fit KMedoidsClusterer
- `target_scitype` for MultitargetNeuralNetworkRegressor is too broad HOT 3
- Scaler() of Int matrix result in error
- Scaler() of vectors (instead of matrices) result in errors
- Deprecation warning from ProgressMeter.jl HOT 3
- Rename/Alias `GeneralImputer` to `MICE` HOT 5
- Separate into subpackages? HOT 1
- Iplement comments for AutoEncoderMLJ
- Bug in GMM caused by spelling mistake HOT 1
- Bug in Clustering_MLJ caused by spelling mistake HOT 3
- BetaML v11.0 Gaussian Mixture Model not compatible with MLJ HOT 7
- Problem with MLJ interface for KMedoidsClusterer HOT 1
- Correct the predict in AutoEncoder to consider non-vector layer outputs
- "`findall` is ambiguous" error HOT 3
- MLJ Interface is not working anymore HOT 6
- Cosine distance HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from betaml.jl.