Changeset 17448
- Timestamp:
- 02/25/20 07:41:01 (5 years ago)
- Location:
- branches/3040_VectorBasedGP
- Files:
-
- 2 deleted
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3040_VectorBasedGP/HeuristicLab.DataPreprocessing/3.4/Data/PreprocessingData.cs
r17418 r17448 31 31 using HeuristicLab.Problems.DataAnalysis; 32 32 33 using DoubleVector = MathNet.Numerics.LinearAlgebra.Vector<double>; 34 33 35 namespace HeuristicLab.DataPreprocessing { 34 36 -
branches/3040_VectorBasedGP/HeuristicLab.DataPreprocessing/3.4/HeuristicLab.DataPreprocessing-3.4.csproj
r16658 r17448 73 73 </PropertyGroup> 74 74 <ItemGroup> 75 <Reference Include="MathNet.Numerics, Version=4.9.0.0, Culture=neutral, processorArchitecture=MSIL"> 76 <SpecificVersion>False</SpecificVersion> 77 <HintPath>..\..\bin\MathNet.Numerics.dll</HintPath> 78 </Reference> 75 79 <Reference Include="System" /> 76 80 <Reference Include="System.Core" /> -
branches/3040_VectorBasedGP/HeuristicLab.DataPreprocessing/3.4/Plugin.cs.frame
r17184 r17448 39 39 [PluginDependency("HeuristicLab.Random", "3.3")] 40 40 [PluginDependency("HeuristicLab.Visualization.ChartControlsExtensions", "3.3")] 41 [PluginDependency("HeuristicLab.MathNet.Numerics", "4.9.0")] 41 42 public class HeuristicLabDataPreprocessingPlugin : PluginBase { 42 43 } -
branches/3040_VectorBasedGP/HeuristicLab.MathNet.Numerics/HeuristicLab.MathNet.Numerics.csproj
r17447 r17448 48 48 </ItemGroup> 49 49 <ItemGroup> 50 <PackageReference Include="MathNet.Numerics ">50 <PackageReference Include="MathNet.Numerics.Signed"> 51 51 <Version>4.9.0</Version> 52 52 </PackageReference> -
branches/3040_VectorBasedGP/HeuristicLab.MathNet.Numerics/Plugin.cs.frame
r17447 r17448 24 24 namespace HeuristicLab.MathNet.Numerics { 25 25 [Plugin("HeuristicLab.MathNet.Numerics", "HeuristicLab wrapper for MathNet.Numerics nuget package.", "4.9.0.$WCREV$")] 26 [PluginFile("HeuristicLab.MathNet.Numerics ", PluginFileType.Assembly)]26 [PluginFile("HeuristicLab.MathNet.Numerics.dll", PluginFileType.Assembly)] 27 27 [PluginFile("MathNet.Numerics.dll", PluginFileType.Assembly)] 28 28 //[PluginFile("MathNet.Numerics.License.txt", PluginFileType.License)] -
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj
r17401 r17448 115 115 <HintPath>..\..\bin\HeuristicLab.Problems.DataAnalysis.Symbolic.NativeInterpreter-0.1.dll</HintPath> 116 116 <Private>False</Private> 117 </Reference> 118 <Reference Include="MathNet.Numerics, Version=4.9.0.0, Culture=neutral, processorArchitecture=MSIL"> 119 <SpecificVersion>False</SpecificVersion> 120 <HintPath>..\..\bin\MathNet.Numerics.dll</HintPath> 117 121 </Reference> 118 122 <Reference Include="System" /> -
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeInterpreter.cs
r17401 r17448 20 20 #endregion 21 21 22 using DoubleVector = MathNet.Numerics.LinearAlgebra.Vector<double>; 23 22 24 using System; 23 25 using System.Collections.Generic; … … 28 30 using HeuristicLab.Parameters; 29 31 using HEAL.Attic; 32 using MathNet.Numerics.Statistics; 30 33 31 34 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { … … 566 569 DoubleVector s = VectorEvaluate(dataset, ref row, state); 567 570 for (int i = 1; i < currentInstr.nArguments; i++) { 568 s *= VectorEvaluate(dataset, ref row, state);571 s = s.PointwiseMultiply(VectorEvaluate(dataset, ref row, state)); 569 572 } 570 573 return s; … … 579 582 580 583 case OpCodes.VectorVariable: { 581 if (row < 0 || row >= dataset.Rows) return new DoubleVector(new[] { double.NaN });584 if (row < 0 || row >= dataset.Rows) return DoubleVector.Build.Dense(new[] { double.NaN }); 582 585 var vectorVarTreeNode = currentInstr.dynamicNode as VectorVariableTreeNode; 583 586 return ((IList<DoubleVector>)currentInstr.data)[row] * vectorVarTreeNode.Weight; -
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Plugin.cs.frame
r17184 r17448 47 47 [PluginDependency("HeuristicLab.Random", "3.3")] 48 48 [PluginDependency("HeuristicLab.Selection", "3.3")] 49 [PluginDependency("HeuristicLab.MathNet.Numerics", "4.9.0")] 49 50 public class HeuristicLabProblemsDataAnalysisSymbolicPlugin : PluginBase { 50 51 } -
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs
r17369 r17448 35 35 using HeuristicLab.Problems.Instances; 36 36 37 using DoubleVector = MathNet.Numerics.LinearAlgebra.Vector<double>; 38 37 39 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { 38 40 [StorableType("59935E69-C4A5-480E-8FFB-D9669DE9BFD4")] -
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis/3.4/Dataset.cs
r17403 r17448 30 30 using HeuristicLab.Data; 31 31 32 using DoubleVector = MathNet.Numerics.LinearAlgebra.Vector<double>; 33 32 34 namespace HeuristicLab.Problems.DataAnalysis { 33 35 [Item("Dataset", "Represents a dataset containing data that should be analyzed.")] … … 144 146 else if (iter.Current[i] is DoubleVector dv) 145 147 transposed.Add(new List<DoubleVector>() { dv }); 146 else if (iter.Current[i] is StringVector sv)147 transposed.Add(new List<StringVector>() { sv });148 else if (iter.Current[i] is DateTimeVector dtv)149 transposed.Add(new List<DateTimeVector>() { dtv });150 148 else throw new NotSupportedException(string.Format("Variable {0} has type {1}. This is not supported when converting from row-wise data.", vnames[i], iter.Current[i].GetType())); 151 149 } … … 227 225 get { return variableValues.Where(p => p.Value is IList<DoubleVector>).Select(p => p.Key); } 228 226 } 229 public IEnumerable<string> StringVectorVariables {230 get { return variableValues.Where(p => p.Value is IList<StringVector>).Select(p => p.Key); }231 }232 public IEnumerable<string> DateTimeVectorVariables {233 get { return variableValues.Where(p => p.Value is IList<DateTimeVector>).Select(p => p.Key); }234 }235 227 236 228 public IEnumerable<double> GetDoubleValues(string variableName) { … … 245 237 public IEnumerable<DoubleVector> GetDoubleVectorValues(string variableName) { 246 238 return GetValues<DoubleVector>(variableName); 247 }248 public IEnumerable<StringVector> GetStringVectorValues(string variableName) {249 return GetValues<StringVector>(variableName);250 }251 public IEnumerable<DateTimeVector> GetDateTimeVectorValues(string variableName) {252 return GetValues<DateTimeVector>(variableName);253 239 } 254 240 … … 299 285 var values = GetValues<DoubleVector>(variableName); 300 286 return new ReadOnlyCollection<DoubleVector>(values); 301 }302 303 public StringVector GetStringVectorValue(string variableName, int row) {304 var values = GetValues<StringVector>(variableName);305 return values[row];306 }307 public IEnumerable<StringVector> GetStringVectorValues(string variableName, IEnumerable<int> rows) {308 return GetValues<StringVector>(variableName, rows);309 }310 public ReadOnlyCollection<StringVector> GetReadOnlyStringVectorValues(string variableName) {311 var values = GetValues<StringVector>(variableName);312 return new ReadOnlyCollection<StringVector>(values);313 }314 315 public DateTimeVector GetDateTimeVectorValue(string variableName, int row) {316 var values = GetValues<DateTimeVector>(variableName);317 return values[row];318 }319 public IEnumerable<DateTimeVector> GetDateTimeVectorValues(string variableName, IEnumerable<int> rows) {320 return GetValues<DateTimeVector>(variableName, rows);321 }322 public ReadOnlyCollection<DateTimeVector> GetReadOnlyDateTimeVectorValues(string variableName) {323 var values = GetValues<DateTimeVector>(variableName);324 return new ReadOnlyCollection<DateTimeVector>(values);325 287 } 326 288 … … 356 318 } 357 319 protected static bool IsAllowedType(Type type) { 358 return type == typeof(double) || type == typeof(string) || type == typeof(DateTime) 359 || type == typeof(DoubleVector) || type == typeof(StringVector) || type == typeof(DateTimeVector); 320 return type == typeof(double) || type == typeof(string) || type == typeof(DateTime) || type == typeof(DoubleVector); 360 321 } 361 322 … … 403 364 404 365 var doubleVectorValues = values as IList<DoubleVector>; 405 if (doubleVectorValues != null) return doubleVectorValues.Select(x => new DoubleVector(x)).ToList(); 406 407 var stringVectorValues = values as IList<StringVector>; 408 if (stringVectorValues != null) return stringVectorValues.Select(x => new StringVector(x)).ToList(); 409 410 var dateTimeVectorValues = values as IList<DateTimeVector>; 411 if (dateTimeVectorValues != null) return dateTimeVectorValues.Select(x => new DateTimeVector(x)).ToList(); 366 if (doubleVectorValues != null) return doubleVectorValues.Select(x => DoubleVector.Build.DenseOfVector(x)).ToList(); 412 367 413 368 throw new ArgumentException(string.Format("Unsupported variable type {0}.", GetElementType(values))); … … 450 405 string IStringConvertibleMatrix.GetValue(int rowIndex, int columnIndex) { 451 406 var value = variableValues[variableNames[columnIndex]][rowIndex]; 452 if (value is IVector vector) { 453 const int maxCount = 10; 454 string extension = vector.Count > maxCount ? ", ..." : ""; 455 return $"[{string.Join(", ", vector.Cast<object>().Take(Math.Min(vector.Count, maxCount)))}{extension}]"; 407 if (value is DoubleVector vector) { 408 return $"[{vector.ToVectorString(10, 80)}]"; 409 //const int maxCount = 10; 410 //string extension = vector.Count > maxCount ? ", ..." : ""; 411 //return $"[{string.Join(", ", vector.Cast<object>().Take(Math.Min(vector.Count, maxCount)))}{extension}]"; 456 412 } 457 413 -
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj
r17365 r17448 103 103 <Private>False</Private> 104 104 </Reference> 105 <Reference Include="MathNet.Numerics, Version=4.9.0.0, Culture=neutral, processorArchitecture=MSIL"> 106 <SpecificVersion>False</SpecificVersion> 107 <HintPath>..\..\bin\MathNet.Numerics.dll</HintPath> 108 <Private>False</Private> 109 </Reference> 105 110 <Reference Include="System" /> 106 111 <Reference Include="System.Core"> … … 167 172 <Compile Include="Implementation\Transformations\ShiftToRangeTransformation.cs" /> 168 173 <Compile Include="Implementation\Transformations\Transformation.cs" /> 169 <Compile Include="Implementation\Vectors\DateTimeVector.cs" />170 <Compile Include="Implementation\Vectors\StringVector.cs" />171 <Compile Include="Implementation\Vectors\DoubleVector.cs" />172 <Compile Include="Implementation\Vectors\Vector.cs" />173 174 <Compile Include="Interfaces\Classification\IClassificationEnsembleModel.cs"> 174 175 <SubType>Code</SubType> … … 183 184 <Compile Include="Interfaces\ITransformation.cs" /> 184 185 <Compile Include="Interfaces\ITransformationMapper.cs" /> 185 <Compile Include="Interfaces\IVector.cs" />186 186 <Compile Include="Interfaces\Regression\IConfidenceRegressionModel.cs" /> 187 187 <Compile Include="Interfaces\Regression\IConfidenceRegressionSolution.cs" /> -
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblemData.cs
r17365 r17448 30 30 using HEAL.Attic; 31 31 32 using DoubleVector = MathNet.Numerics.LinearAlgebra.Vector<double>; 33 32 34 namespace HeuristicLab.Problems.DataAnalysis { 33 35 [StorableType("85AE1542-D563-434F-A760-1D181EFC2101")] … … 162 164 163 165 var variables = dataset.VariableNames.Where(variable => 164 dataset.VariableHasType<double>(variable) || dataset.VariableHasType<string>(variable) || dataset.VariableHasType<DoubleVector> 166 dataset.VariableHasType<double>(variable) || dataset.VariableHasType<string>(variable) || dataset.VariableHasType<DoubleVector>(variable)); 165 167 var inputVariables = new CheckedItemList<StringValue>(variables.Select(x => new StringValue(x).AsReadOnly())); 166 168 foreach (StringValue x in inputVariables) -
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolutionVariableImpactsCalculator.cs
r17416 r17448 33 33 using HeuristicLab.Random; 34 34 35 using DoubleVector = MathNet.Numerics.LinearAlgebra.Vector<double>; 36 35 37 namespace HeuristicLab.Problems.DataAnalysis { 36 38 [StorableType("414B25CD-6643-4E42-9EB2-B9A24F5E1528")] … … 319 321 // new var has same empirical distribution but the relation to y is broken 320 322 // prepare a complete column for the dataset 321 replacementValues = Enumerable.Repeat( new DoubleVector(new[] { double.NaN }), modifiableDataset.Rows).ToList();323 replacementValues = Enumerable.Repeat(DoubleVector.Build.Dense(new[] { double.NaN }), modifiableDataset.Rows).ToList(); 322 324 // shuffle only the selected rows 323 325 var shuffledValues = rows.Select(r => originalValues[r]).Shuffle(random).ToList(); -
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataset.cs
r17365 r17448 27 27 using HEAL.Attic; 28 28 29 using DoubleVector = MathNet.Numerics.LinearAlgebra.Vector<double>; 30 29 31 namespace HeuristicLab.Problems.DataAnalysis { 30 32 [StorableType("55cc9211-2136-41a0-a5bc-0d51e915d1b4")] … … 35 37 IEnumerable<string> DateTimeVariables { get; } 36 38 IEnumerable<string> DoubleVectorVariables { get; } 37 IEnumerable<string> StringVectorVariables { get; }38 IEnumerable<string> DateTimeVectorVariables { get; }39 39 40 40 bool ContainsVariable(string variablename); … … 60 60 IEnumerable<DoubleVector> GetDoubleVectorValues(string variableName, IEnumerable<int> rows); 61 61 ReadOnlyCollection<DoubleVector> GetReadOnlyDoubleVectorValues(string variableName); 62 63 StringVector GetStringVectorValue(string variableName, int row);64 IEnumerable<StringVector> GetStringVectorValues(string variableName);65 IEnumerable<StringVector> GetStringVectorValues(string variableName, IEnumerable<int> rows);66 ReadOnlyCollection<StringVector> GetReadOnlyStringVectorValues(string variableName);67 68 DateTimeVector GetDateTimeVectorValue(string variableName, int row);69 IEnumerable<DateTimeVector> GetDateTimeVectorValues(string variableName);70 IEnumerable<DateTimeVector> GetDateTimeVectorValues(string variableName, IEnumerable<int> rows);71 ReadOnlyCollection<DateTimeVector> GetReadOnlyDateTimeVectorValues(string variableName);72 62 } 73 63 } -
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis/3.4/Plugin.cs.frame
r17184 r17448 39 39 [PluginDependency("HeuristicLab.Problems.Instances", "3.3")] 40 40 [PluginDependency("HeuristicLab.Random", "3.3")] 41 [PluginDependency("HeuristicLab.MathNet.Numerics", "4.9.0")] 41 42 public class HeuristicLabProblemsDataAnalysisPlugin : PluginBase { 42 43 } -
branches/3040_VectorBasedGP/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Classification/TimeSeries/TimeSeriesInstanceProvider.cs
r17418 r17448 30 30 using System.Linq; 31 31 using HeuristicLab.Problems.DataAnalysis; 32 33 using DoubleVector = MathNet.Numerics.LinearAlgebra.Vector<double>; 32 34 33 35 namespace HeuristicLab.Problems.Instances.DataAnalysis { … … 160 162 var numbers = variable 161 163 .Split(',') 162 .Select(ParseNumber) 163 .ToList(); 164 inputsData[i].Add(new DoubleVector(numbers)); 164 .Select(ParseNumber); 165 inputsData[i].Add(DoubleVector.Build.DenseOfEnumerable(numbers)); 165 166 } 166 167 -
branches/3040_VectorBasedGP/HeuristicLab.Problems.Instances.DataAnalysis/3.3/HeuristicLab.Problems.Instances.DataAnalysis-3.3.csproj
r17418 r17448 114 114 <SpecificVersion>False</SpecificVersion> 115 115 <HintPath>..\..\bin\ALGLIB-3.7.0.dll</HintPath> 116 </Reference> 117 <Reference Include="MathNet.Numerics, Version=4.9.0.0, Culture=neutral, processorArchitecture=MSIL"> 118 <SpecificVersion>False</SpecificVersion> 119 <HintPath>..\..\bin\MathNet.Numerics.dll</HintPath> 116 120 </Reference> 117 121 <Reference Include="System" /> -
branches/3040_VectorBasedGP/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Plugin.cs.frame
r17184 r17448 35 35 [PluginDependency("HeuristicLab.Problems.Instances", "3.3")] 36 36 [PluginDependency("HeuristicLab.Random", "3.3")] 37 [PluginDependency("HeuristicLab.MathNet.Numerics", "4.9.0")] 37 38 public class HeuristicLabProblemsInstancesDataAnalysisPlugin : PluginBase { 38 39 } -
branches/3040_VectorBasedGP/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/VectorData/AzzaliBenchmark1.cs
r17418 r17448 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.Collections; 3 24 using System.Collections.Generic; … … 7 28 using HeuristicLab.Problems.DataAnalysis; 8 29 using HeuristicLab.Random; 30 using MathNet.Numerics.Statistics; 31 32 using DoubleVector = MathNet.Numerics.LinearAlgebra.Vector<double>; 9 33 10 34 namespace HeuristicLab.Problems.Instances.DataAnalysis { -
branches/3040_VectorBasedGP/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/VectorData/AzzaliBenchmark2.cs
r17418 r17448 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.Collections; 3 24 using System.Collections.Generic; … … 7 28 using HeuristicLab.Problems.DataAnalysis; 8 29 using HeuristicLab.Random; 30 using MathNet.Numerics.Statistics; 31 32 using DoubleVector = MathNet.Numerics.LinearAlgebra.Vector<double>; 9 33 10 34 namespace HeuristicLab.Problems.Instances.DataAnalysis { 11 35 public class AzzaliBenchmark2 : ArtificialRegressionDataDescriptor { 12 public override string Name { get { return "Azzali Benchmark2 B2 = ((X3 + X1) / mean(X4)) * X2"; } }36 public override string Name { get { return "Azzali Benchmark2 B2 = ((X3 + X1) / CumMean(X4)) * X2"; } } 13 37 public override string Description { get { return "I. Azzali, L. Vanneschi, S. Silva, I. Bakurov, and M. Giacobini, “A Vectorial Approach to Genetic Programming,” EuroGP, pp. 213–227, 2019."; } } 14 38 … … 47 71 var x4 = rand.NextDoubleVector(-5, +5, 10); 48 72 49 var b2 = ((x3 + x1) / x4.CumulativeMean()) * x2; 73 var cumMean = x4.MapIndexed((j, v) => x4.SubVector(0, j + 1).Mean()); 74 var b2 = ((x3 + x1) / cumMean) * x2; 50 75 51 76 x1Column.Add(x1); -
branches/3040_VectorBasedGP/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/VectorData/AzzaliBenchmark3.cs
r17418 r17448 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.Collections; 3 24 using System.Collections.Generic; … … 8 29 using HeuristicLab.Random; 9 30 31 using DoubleVector = MathNet.Numerics.LinearAlgebra.Vector<double>; 32 10 33 namespace HeuristicLab.Problems.Instances.DataAnalysis { 11 34 public class AzzaliBenchmark3 : ArtificialRegressionDataDescriptor { 12 public override string Name { get { return "Azzali Benchmark2 B3 = "; } }35 public override string Name { get { return "Azzali Benchmark2 B3 = CumMin[3,3] * (X2 / X3) + X4"; } } 13 36 public override string Description { get { return "I. Azzali, L. Vanneschi, S. Silva, I. Bakurov, and M. Giacobini, “A Vectorial Approach to Genetic Programming,” EuroGP, pp. 213–227, 2019."; } } 14 37 … … 49 72 var x5 = rand.NextDouble(0, 1); 50 73 51 int p = 3, q = 3;52 var cumulativeMin = new DoubleVector(74 const int p = 3, q = 3; 75 var cumulativeMin = DoubleVector.Build.DenseOfEnumerable( 53 76 Enumerable.Range(0, x1.Count) 54 77 .Select(idx => Enumerable.Range(idx - p, q)) // build index ranges for each target entry -
branches/3040_VectorBasedGP/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/VectorData/AzzaliKorns5.cs
r17418 r17448 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.Collections; 3 24 using System.Collections.Generic; … … 8 29 using HeuristicLab.Random; 9 30 31 using DoubleVector = MathNet.Numerics.LinearAlgebra.Vector<double>; 32 10 33 namespace HeuristicLab.Problems.Instances.DataAnalysis { 11 34 public class AzzaliKorns5 : ArtificialRegressionDataDescriptor { 12 public override string Name { get { return "Azzali Korns5 K5 = "; } }35 public override string Name { get { return "Azzali Korns5 K5 = 3.0 + 2.23 * log(X4)"; } } 13 36 public override string Description { get { return "I. Azzali, L. Vanneschi, S. Silva, I. Bakurov, and M. Giacobini, “A Vectorial Approach to Genetic Programming,” EuroGP, pp. 213–227, 2019."; } } 14 37 … … 47 70 var x4 = rand.NextDoubleVector(-50, +50, 10); 48 71 49 var k5 = 3 + 2.13 * new DoubleVector(x4.Select(d4 => Math.Log(d4)));72 var k5 = 3 + 2.13 * x4.PointwiseLog(); 50 73 51 74 x1Column.Add(x1); -
branches/3040_VectorBasedGP/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/VectorData/RandomExtensions.cs
r17400 r17448 1 using HeuristicLab.Core; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using HeuristicLab.Core; 2 23 using HeuristicLab.Problems.DataAnalysis; 24 25 using DoubleVector = MathNet.Numerics.LinearAlgebra.Vector<double>; 3 26 4 27 namespace HeuristicLab.Problems.Instances.DataAnalysis { … … 12 35 values[i] = rand.NextDouble(min, max); 13 36 } 14 return new DoubleVector(values);37 return DoubleVector.Build.Dense(values); 15 38 } 16 39 } -
branches/3040_VectorBasedGP/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/VectorData/VectorDataTestOne.cs
r17419 r17448 27 27 using HeuristicLab.Problems.DataAnalysis; 28 28 using HeuristicLab.Random; 29 using MathNet.Numerics.Statistics; 30 31 using DoubleVector = MathNet.Numerics.LinearAlgebra.Vector<double>; 29 32 30 33 namespace HeuristicLab.Problems.Instances.DataAnalysis { -
branches/3040_VectorBasedGP/HeuristicLab.Problems.Instances.DataAnalysis/3.3/TableFileParser.cs
r17414 r17448 30 30 using HeuristicLab.Problems.DataAnalysis; 31 31 32 using DoubleVector = MathNet.Numerics.LinearAlgebra.Vector<double>; 33 32 34 namespace HeuristicLab.Problems.Instances.DataAnalysis { 33 35 public class TableFileParser : Progress<long> { // reports the number of bytes read … … 272 274 var vectorList = new List<DoubleVector>(stringList.Count); 273 275 for (int j = 0; j < doubles.Length; j++) { 274 vectorList.Add( new DoubleVector(doubles[j]));276 vectorList.Add(DoubleVector.Build.Dense(doubles[j])); 275 277 } 276 278
Note: See TracChangeset
for help on using the changeset viewer.