Free cookie consent management tool by TermsFeed Policy Generator

Changeset 8470


Ignore:
Timestamp:
08/10/12 17:07:20 (12 years ago)
Author:
abeham
Message:

#1913: increased point size and converted K to a fixed value parameter

Location:
branches/NCA
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/NCA/HeuristicLab.Algorithms.NCA.Views/3.3/NCADimensionReductionView.cs

    r8466 r8470  
    6464      var rows = Content.ProblemData.ClassValues
    6565        .ToDictionary(c => c, c => new ScatterPlotDataRow(Content.ProblemData.GetClassName(c), string.Empty, Enumerable.Empty<Point2D<double>>()));
     66      foreach (var r in rows.Values)
     67        r.VisualProperties.PointSize = 5;
    6668
    6769      IEnumerable<int> range = null;
  • branches/NCA/HeuristicLab.Algorithms.NCA/3.3/NcaAlgorithm.cs

    r8466 r8470  
    4545  public sealed class NcaAlgorithm : FixedDataAnalysisAlgorithm<IClassificationProblem> {
    4646    #region Parameter Properties
    47     public IValueLookupParameter<IntValue> KParameter {
    48       get { return (IValueLookupParameter<IntValue>)Parameters["K"]; }
     47    public IFixedValueParameter<IntValue> KParameter {
     48      get { return (IFixedValueParameter<IntValue>)Parameters["K"]; }
    4949    }
    5050    public IFixedValueParameter<IntValue> DimensionsParameter {
     
    6363
    6464    #region Properties
    65     private IntValue K {
    66       get { return KParameter.Value; }
     65    private int K {
     66      get { return KParameter.Value.Value; }
     67      set { KParameter.Value.Value = value; }
    6768    }
    6869    private int Dimensions {
     
    8586    public NcaAlgorithm()
    8687      : base() {
    87       Parameters.Add(new ValueLookupParameter<IntValue>("K", "The K for the nearest neighbor.", new IntValue(1)));
     88      Parameters.Add(new FixedValueParameter<IntValue>("K", "The K for the nearest neighbor.", new IntValue(1)));
    8889      Parameters.Add(new FixedValueParameter<IntValue>("Dimensions", "The number of dimensions that NCA should reduce the data to.", new IntValue(2)));
    8990      Parameters.Add(new ConstrainedValueParameter<INCAInitializer>("Initialization", "Which method should be used to initialize the matrix. Typically LDA (linear discriminant analysis) should provide a good estimate."));
     
    110111
    111112    protected override void Run() {
    112       var k = K.Value;
    113113      var initializer = InitializationParameter.Value;
    114114
    115115      var clonedProblem = (IClassificationProblemData)Problem.ProblemData.Clone();
    116       var model = Train(clonedProblem, k, Dimensions, NeighborSamples, Iterations, initializer.Initialize(clonedProblem, Dimensions), ReportQuality, CancellationToken.None);
     116      var model = Train(clonedProblem, K, Dimensions, NeighborSamples, Iterations, initializer.Initialize(clonedProblem, Dimensions), ReportQuality, CancellationToken.None);
    117117      Results.Add(new Result("ClassificationSolution", "The classification solution.", model.CreateClassificationSolution(clonedProblem)));
    118118    }
Note: See TracChangeset for help on using the changeset viewer.