Repository navigation
Closed
Description
In MLP, when a parameter is change, it invalidates the fitting. I am surprised it doesn't for (s)kmean when changing the numCluster.
an example of the misunderstood behaviour by yours truly:
----------begin_max5_patcher----------
1884.3oc0ZksbihCE8YmuBU7raWrujm546nyTtjAYa0AKwHDwISWc+sOZCLf
gDCMwS09ABn064bWzUR4GOrxZG8UToE3Qv2.qV8iGVsRUjrfUluWYcB9ZZNr
T0LqT5oSHB2ZstNN5UtpbmMfSvmQ.HvGTPwDNHq7Ih6FPACkgS4OBPLFksFP
nbvdLmiXOQ71He8Ih+FvYJ6YQGB1.xomQL.o5TZdUopYga.kbbdttQqAnWPD
.dOn7HsJOCrCApHpgLqVrxwDTJshnjsPSghgjVwyQbERrMkV.4oGwjCaYnTt
lIh7B2XuFjjHe5Fp9HNZiM3uuLRXR8.4XJDmoHB5tu+E2HKYY+7gGjOV+aRs
gVSE.9g9RY1KzU9Gm.aEPrmBBBVRDDLWD3p0AyBA9KIB7mMBzh9rPf2Rh.uo
if.OknG6OaD3tjHvc1Hv2Y1HvYIQfyjQfSTfTl8muir8b.vITYI7.5J.XBlq
Cv+OUH1aCinZAQWD+sBjFNVVMB9PpqjnMAxvVZ0ks1AxcLz5dMZcB+iCst9I
yFsAKIZurhaInwUSPAkBKYHGSIa6rpp6m.UjDqVp0a5Lg+mld2dI04N50y78
i0qMDNcj5rjHUj0DfyfXhPL+DrsMKcn8mmDLS9iyO1w2dt9wwyArDzYQeuBq
h7tqNU.xGFgtigPYmrV+AHM1jJiZwnfOPoNvZQNtKHPK.OYkxPPNBbBAIkfL
HGVh3OYsjJWCjcMIP3OYLGY0dvQLCPMHckvCLWrcFVoH9ZqQXkErnnUwqZ0E
I87cpZfhW2TDlnKJroHF5Ebc+CZJExDPjKvWESQ.VuFVmaqbXnYHFoBqDEcg
BEkQjTpDBT3kU.S0cVp4pqtEooSXzSQZdd5jVbBtvZBU9gbZ5ynrVo+HTMEH
Qfn1K4zo5LzdXUNe6dJgWh+WkD3HsEGn98FIbv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ciDpB+pnEioh7MQQNWYzX5oSioVn3Wz5Aea3t5V20n3Xg5X8fucUW6G
O1Kocs0oDX0f2lJaoJWbq3q8TmtEQ+zAmf0rRd8kKdpV.yWn5DzxRYIaFi5A
vRddFYa0mcyVHmyv6p35fYsO6tIcFCGxo6f48NXfgNBhGtDRcgN+aaUHNaUt
PfuHe+KpOb0end2Cbo7cvk81.L66W+z07mIcoGdK3AGuqZ+dD6W5KB.70R3o
hVW30Mdd46EaliKOvbEW8dfOzQQ0gZ2M8kDLoSPdIw997Jb1lmUmuyu.e8Lj
Iu4mRfyDg+GdUAdhTuU2as4JCBmLrcWbXaNuqe8A2307Acj4540oV35M8KHo
MlU8pa51ZJnedcFh3p74RZmN2Hox4dIStqn5acdhuSyi6MLOprzc9MmHG+6D
hbBtWST38Zhb07+6qjVpIx9dLQd2vDE0oMmvY5ybu9+gG0ox4Xq+uaHo4ieS
IK5VXfqUp53J8teQ4bz6dE6cmhWeehieWh8uGQUhUic+gO7yG9OP.s.FO
-----------end_max5_patcher-----------
Originally posted by @tremblap in #349 (comment)
Metadata
Metadata
Assignees
Labels
No labels
Activity
weefuzzy commentedon Nov 4, 2026
I would be surprised in the inverse direction – i.e. if MLP invalidated just after a parameter change. Which MLP parameters invalidate a fitted model? If I use an MLP in the patch above and change the hidden layers after fitting, it still predicts afterwards without complaint
tremblap commentedon Nov 4, 2026
OK indeed MLP is also wrong for me as user: certain parameters should invalidate the fitting. for kmeans, it is the number of dimensions. for mlp, the network structure, and both activations (like line 121 of mlpregressorclient is checking). I thought that mTracker was useful for that. So I wonder how we could either change the fitting flag of the mAlgo (which is checked) when we touch those parameters...
or we can add another check at line 173 of the MLPregClient to check if mTracker is unhappy.
In all cases, as a user, if I change this, I have a feeling i'm changing something where I actually I'm not. At least if I write and read, the mAlgo is right under the hood, but this is a sad discrepancy.
updated patch with kmeans and mlpregressor:
weefuzzy commentedon Nov 5, 2026
My counterargument is that neither way is perfect, but the status quo is better.* As it stands, there are a limited number of ways to invalidate a fitted model and, importantly, it's hard to do by accident. I think having it invalidate in response to some (but not all) attribute changes increases the scope for accidental badness without a clear enough benefit in return. Moreover, it would require a some slightly tedious, possibly error prone, coding to achieve.
* b/c these things don't really make sense as attributes, but the alternative was having unwieldy numbers of arguments to
fitmessages in Max and Pdtremblap commentedon Nov 5, 2026
ok so you see them as sampled-and-held values at 'fitting' time. you almost convince me, but I'll have to find a way to put a note in the documentation somewhere...
tremblap commentedon Nov 15, 2026
ok I've done a PR in docs flucoma/flucoma-docs#228 that depends on #349 to be 'true' - actually not really depending on it but tidying it all...