Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added initialize variable to the SKMeans SC class definition #178

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

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 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

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