1 %> @brief 1D Scatterplot with x-axis values associated to classes and curve fit
3 %> @sa uip_vis_curvefit.m
14 o.classtitle = '"Build Curves"';
19 methods(Access=protected)
20 function out = do_use(o, data)
23 if length(o.conc) ~= data.nc
24 irerror(sprintf('Concentration vector and data classes don''t match cardinality (which are respectively %d and %d)', length(o.conc), data.nc));
27 % Sorts concentrations
29 temp = [x' (1:data.nc)'];
30 temp = sortrows(temp);
31 indexes = temp(:, 2)';
35 data = data.select_features(o.idx_fea);
40 % Extracts class means
42 mean_control = mean(pieces(indexes(1)).X(:, 1));
43 irverbose(sprintf('* Mean "%s": %g', pieces(indexes(1)).classlabels{1}, mean_control), 1);
44 y = zeros(1, data.nc);
46 % y(i) = abs(mean(pieces(indexes(i)).X(:, 1))-mean_control);
47 y(i) = mean(pieces(indexes(i)).X(:, 1))-mean_control;
51 irverbose(sprintf(
'* Mean "%s": %g', pieces(indexes(i)).classlabels{1}, y(i)), 1);
55 % p = polyfit(x, y, data.nc-4);
56 % yp = polyval(p, xp);
59 xp_ = linspace(log10(x(2)), log10(x(data.nc)), 100);
61 yp_ = spline(x_, y_, xp_);
65 plot(xp_, yp_,
'k',
'LineWidth', 4);
69 v = pieces(indexes(i)).X(:, 1);
71 plot(x_(i-1)*ones(length(v), 1), v,
'Color',
find_color(indexes(i)),
'Marker',
find_marker(indexes(i)),
'MarkerSize', 10,
'LineStyle',
'none',
'LineWidth', 2);
75 plot(x_, y_,
'ks',
'MarkerFaceColor',
'k',
'MarkerSize', 20);
77 text(x_(i)+.13, y_(i), sprintf(
'%g', x(i+1)),
'FontSize', 25);
79 % set(gca,
'XLim', [x_(1)-.00001, x_(end)+.00001]);
80 set(gca,
'XLim', [x_(1)-.25, x_(end)+.25]);
81 xlabel(
'log_{10}(Concentration)');
82 ylabel(
'Distance from reference class');
83 %title(
'Effect curve');
function irverbose(in s, in level)
function find_marker(in i)
function find_color(in i)
Visualization base class.
function data_split_classes(in data, in hierarchy)
1D Scatterplot with x-axis values associated to classes and curve fit
function set_title(in s, in obj)