Skip to content

Conversation

@tremblap
Copy link
Member

@tremblap tremblap commented Nov 1, 2024

this seems to work, although with the code below I do not see much of an improvment, so maybe have done something wrong

~ds = FluidDataSet(s).read("/Users/pa/Documents/recherche/projets/flucoma/sources/flucoma-max/misc/rays.json");

(
~ds.dump({
	arg dict;
	defer{
		~fp = FluidPlotter(dict:dict,xmin:-1,ymin:-1).pointSizeScale_(3);
	};
});
)

(
~ls = FluidLabelSet(s);
~skm = FluidSKMeans(s,maxIter: 1000);
)

// 10 inits, graphically, one per second
(
Routine{10.do{
~skm.clear;
~skm.fitPredict(~ds,~ls,{
			~ls.dump({
				arg dict;
				~fp.categories_(dict);
	})
});
	1.wait;
};}.play;
)

// rerun above with other initialisation
~skm.initialize_(1)

@tremblap tremblap requested a review from weefuzzy November 1, 2024 17:50
@tremblap tremblap marked this pull request as draft November 1, 2024 17:50
@weefuzzy weefuzzy changed the title added initialize variable to the class definition added initialize variable to the SKMeans SC class definition Nov 2, 2024
@weefuzzy
Copy link
Member

weefuzzy commented Nov 2, 2024

I now realise after some prodding that the rays data also presents a difficult case for initialising the means (which is good). I'll put some comparison plots up on the core PR so you can see

@weefuzzy
Copy link
Member

KMeans will need updating too, and the possible modes are now 0, 1, 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants