Radial Basis Function (RBF) networks require choosing center locations in the input space around which basis functions are placed. The quality of these centers significantly affects approximation performance.
Implement a function rbf_center_placement that takes a dataset X of shape (n_samples, n_features), a desired number of centers n_centers, a placement strategy, and a random_seed for reproducibility.
Your function should support three center placement strategies:
'random': Randomly select n_centers distinct data points from X as centers (use np.random.choice without replacement).
'maxmin': Greedy farthest-first traversal. Start by selecting a random data point (using np.random.randint). Then iteratively select the data point whose minimum distance to all previously selected centers is the largest. This spreads centers across the input space.
'kmeans': Run k-means clustering to convergence (or up to 100 iterations). Initialize cluster centers by randomly selecting n_centers data points. Assign each sample to its nearest center, recompute centers as cluster means, and repeat until convergence (centers do not change within tolerance 1e-8).
After placing centers, compute a shared RBF width parameter using the heuristic:
Return a dictionary with keys 'centers' (numpy array rounded to 4 decimal places) and 'width' (float rounded to 4 decimal places).