Changeset 11571 for branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis
- Timestamp:
- 11/24/14 15:16:59 (10 years ago)
- Location:
- branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4
- Files:
-
- 2 added
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/Dataset.cs
r11171 r11571 33 33 [Item("Dataset", "Represents a dataset containing data that should be analyzed.")] 34 34 [StorableClass] 35 public sealed class Dataset : NamedItem, I StringConvertibleMatrix{35 public sealed class Dataset : NamedItem, IDataset { 36 36 [StorableConstructor] 37 37 private Dataset(bool deserializing) : base(deserializing) { } -
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj
r11156 r11571 158 158 <Compile Include="Interfaces\Classification\IDiscriminantFunctionThresholdCalculator.cs" /> 159 159 <Compile Include="Interfaces\IDataAnalysisSolutionExporter.cs" /> 160 <Compile Include="Interfaces\IDataset.cs" /> 160 161 <Compile Include="Interfaces\IDependencyCalculator.cs" /> 161 162 <Compile Include="Interfaces\ITransformation.cs" /> … … 222 223 <Compile Include="Implementation\Classification\ThresholdCalculators\NormalDistributionCutPointsThresholdCalculator.cs" /> 223 224 <Compile Include="Implementation\Classification\ThresholdCalculators\ThresholdCalculator.cs" /> 225 <Compile Include="SimpleDataset.cs" /> 224 226 <None Include="HeuristicLab.snk" /> 225 227 <None Include="Plugin.cs.frame" /> -
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationEnsembleModel.cs
r11171 r11571 67 67 } 68 68 69 public IEnumerable<IEnumerable<double>> GetEstimatedClassValueVectors( Dataset dataset, IEnumerable<int> rows) {69 public IEnumerable<IEnumerable<double>> GetEstimatedClassValueVectors(IDataset dataset, IEnumerable<int> rows) { 70 70 var estimatedValuesEnumerators = (from model in models 71 71 select model.GetEstimatedClassValues(dataset, rows).GetEnumerator()) … … 82 82 #region IClassificationModel Members 83 83 84 public IEnumerable<double> GetEstimatedClassValues( Dataset dataset, IEnumerable<int> rows) {84 public IEnumerable<double> GetEstimatedClassValues(IDataset dataset, IEnumerable<int> rows) { 85 85 foreach (var estimatedValuesVector in GetEstimatedClassValueVectors(dataset, rows)) { 86 86 // return the class which is most often occuring -
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationEnsembleSolution.cs
r11171 r11571 231 231 } 232 232 233 public IEnumerable<IEnumerable<double>> GetEstimatedClassValueVectors( Dataset dataset, IEnumerable<int> rows) {233 public IEnumerable<IEnumerable<double>> GetEstimatedClassValueVectors(IDataset dataset, IEnumerable<int> rows) { 234 234 if (!Model.Models.Any()) yield break; 235 235 var estimatedValuesEnumerators = (from model in Model.Models -
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblemData.cs
r11171 r11571 300 300 } 301 301 302 public ClassificationProblemData( Dataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable, IEnumerable<ITransformation> transformations = null)302 public ClassificationProblemData(IDataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable, IEnumerable<ITransformation> transformations = null) 303 303 : base(dataset, allowedInputVariables, transformations ?? Enumerable.Empty<ITransformation>()) { 304 304 var validTargetVariableValues = CheckVariablesForPossibleTargetVariables(dataset).Select(x => new StringValue(x).AsReadOnly()).ToList(); … … 313 313 } 314 314 315 public static IEnumerable<string> CheckVariablesForPossibleTargetVariables( Dataset dataset) {315 public static IEnumerable<string> CheckVariablesForPossibleTargetVariables(IDataset dataset) { 316 316 int maxSamples = Math.Min(InspectedRowsToDetermineTargets, dataset.Rows); 317 317 var validTargetVariables = (from v in dataset.DoubleVariables -
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/DiscriminantFunctionClassificationModel.cs
r11171 r11571 111 111 112 112 113 public IEnumerable<double> GetEstimatedValues( Dataset dataset, IEnumerable<int> rows) {113 public IEnumerable<double> GetEstimatedValues(IDataset dataset, IEnumerable<int> rows) { 114 114 return model.GetEstimatedValues(dataset, rows); 115 115 } 116 116 117 public IEnumerable<double> GetEstimatedClassValues( Dataset dataset, IEnumerable<int> rows) {117 public IEnumerable<double> GetEstimatedClassValues(IDataset dataset, IEnumerable<int> rows) { 118 118 if (!Thresholds.Any() && !ClassValues.Any()) throw new ArgumentException("No thresholds and class values were set for the current classification model."); 119 119 foreach (var x in GetEstimatedValues(dataset, rows)) { -
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblemData.cs
r11171 r11571 63 63 get { return isEmpty; } 64 64 } 65 public Dataset Dataset {65 public IDataset Dataset { 66 66 get { return DatasetParameter.Value; } 67 67 } … … 126 126 } 127 127 128 protected DataAnalysisProblemData( Dataset dataset, IEnumerable<string> allowedInputVariables, IEnumerable<ITransformation> transformations = null) {128 protected DataAnalysisProblemData(IDataset dataset, IEnumerable<string> allowedInputVariables, IEnumerable<ITransformation> transformations = null) { 129 129 if (dataset == null) throw new ArgumentNullException("The dataset must not be null."); 130 130 if (allowedInputVariables == null) throw new ArgumentNullException("The allowedInputVariables must not be null."); … … 144 144 var transformationsList = new ItemList<ITransformation>(transformations ?? Enumerable.Empty<ITransformation>()); 145 145 146 Parameters.Add(new FixedValueParameter<Dataset>(DatasetParameterName, "", dataset));146 Parameters.Add(new FixedValueParameter<Dataset>(DatasetParameterName, "", (Dataset)dataset)); 147 147 Parameters.Add(new FixedValueParameter<ReadOnlyCheckedItemList<StringValue>>(InputVariablesParameterName, "", inputVariables.AsReadOnly())); 148 148 Parameters.Add(new FixedValueParameter<IntRange>(TrainingPartitionParameterName, "", new IntRange(trainingPartitionStart, trainingPartitionEnd))); -
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/ConstantRegressionModel.cs
r11171 r11571 51 51 } 52 52 53 public IEnumerable<double> GetEstimatedValues( Dataset dataset, IEnumerable<int> rows) {53 public IEnumerable<double> GetEstimatedValues(IDataset dataset, IEnumerable<int> rows) { 54 54 return rows.Select(row => Constant); 55 55 } -
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleModel.cs
r11171 r11571 80 80 } 81 81 82 public IEnumerable<IEnumerable<double>> GetEstimatedValueVectors( Dataset dataset, IEnumerable<int> rows) {82 public IEnumerable<IEnumerable<double>> GetEstimatedValueVectors(IDataset dataset, IEnumerable<int> rows) { 83 83 var estimatedValuesEnumerators = (from model in models 84 84 select model.GetEstimatedValues(dataset, rows).GetEnumerator()) … … 95 95 #region IRegressionModel Members 96 96 97 public IEnumerable<double> GetEstimatedValues( Dataset dataset, IEnumerable<int> rows) {97 public IEnumerable<double> GetEstimatedValues(IDataset dataset, IEnumerable<int> rows) { 98 98 foreach (var estimatedValuesVector in GetEstimatedValueVectors(dataset, rows)) { 99 99 yield return estimatedValuesVector.Average(); -
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleSolution.cs
r11171 r11571 232 232 } 233 233 234 public IEnumerable<IEnumerable<double>> GetEstimatedValueVectors( Dataset dataset, IEnumerable<int> rows) {234 public IEnumerable<IEnumerable<double>> GetEstimatedValueVectors(IDataset dataset, IEnumerable<int> rows) { 235 235 if (!Model.Models.Any()) yield break; 236 236 var estimatedValuesEnumerators = (from model in Model.Models -
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs
r11171 r11571 137 137 } 138 138 139 public RegressionProblemData( Dataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable, IEnumerable<ITransformation> transformations = null)139 public RegressionProblemData(IDataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable, IEnumerable<ITransformation> transformations = null) 140 140 : base(dataset, allowedInputVariables, transformations ?? Enumerable.Empty<ITransformation>()) { 141 141 var variables = InputVariables.Select(x => x.AsReadOnly()).ToList(); -
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/TimeSeriesPrognosis/Models/ConstantTimeSeriesPrognosisModel.cs
r11171 r11571 39 39 public ConstantTimeSeriesPrognosisModel(double constant) : base(constant) { } 40 40 41 public IEnumerable<IEnumerable<double>> GetPrognosedValues( Dataset dataset, IEnumerable<int> rows, IEnumerable<int> horizons) {41 public IEnumerable<IEnumerable<double>> GetPrognosedValues(IDataset dataset, IEnumerable<int> rows, IEnumerable<int> horizons) { 42 42 return horizons.Select(horizon => Enumerable.Repeat(Constant, horizon)); 43 43 } -
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/TimeSeriesPrognosis/Models/TimeSeriesPrognosisAutoRegressiveModel.cs
r11171 r11571 58 58 } 59 59 60 public IEnumerable<IEnumerable<double>> GetPrognosedValues( Dataset dataset, IEnumerable<int> rows, IEnumerable<int> horizons) {60 public IEnumerable<IEnumerable<double>> GetPrognosedValues(IDataset dataset, IEnumerable<int> rows, IEnumerable<int> horizons) { 61 61 var rowsEnumerator = rows.GetEnumerator(); 62 62 var horizonsEnumerator = horizons.GetEnumerator(); … … 91 91 } 92 92 93 public IEnumerable<double> GetEstimatedValues( Dataset dataset, IEnumerable<int> rows) {93 public IEnumerable<double> GetEstimatedValues(IDataset dataset, IEnumerable<int> rows) { 94 94 var targetVariables = dataset.GetReadOnlyDoubleValues(TargetVariable); 95 95 foreach (int row in rows) { -
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/TimeSeriesPrognosis/TimeSeriesPrognosisProblemData.cs
r11171 r11571 1582 1582 TrainingPartition.Start = 50; 1583 1583 } 1584 public TimeSeriesPrognosisProblemData( Dataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable, IEnumerable<ITransformation> transformations = null)1584 public TimeSeriesPrognosisProblemData(IDataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable, IEnumerable<ITransformation> transformations = null) 1585 1585 : base(dataset, allowedInputVariables, targetVariable, transformations ?? Enumerable.Empty<ITransformation>()) { 1586 1586 Parameters.Add(new FixedValueParameter<IntValue>(TrainingHorizonParameterName, "Specifies the horizon (how far the prognosis reaches in the future) for each training sample.", new IntValue(1))); -
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Classification/IClassificationEnsembleModel.cs
r11171 r11571 26 26 void Remove(IClassificationModel model); 27 27 IEnumerable<IClassificationModel> Models { get; } 28 IEnumerable<IEnumerable<double>> GetEstimatedClassValueVectors( Dataset dataset, IEnumerable<int> rows);28 IEnumerable<IEnumerable<double>> GetEstimatedClassValueVectors(IDataset dataset, IEnumerable<int> rows); 29 29 } 30 30 } -
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Classification/IClassificationEnsembleSolution.cs
r11171 r11571 26 26 new IClassificationEnsembleModel Model { get; } 27 27 IItemCollection<IClassificationSolution> ClassificationSolutions { get; } 28 IEnumerable<IEnumerable<double>> GetEstimatedClassValueVectors( Dataset dataset, IEnumerable<int> rows);28 IEnumerable<IEnumerable<double>> GetEstimatedClassValueVectors(IDataset dataset, IEnumerable<int> rows); 29 29 } 30 30 } -
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Classification/IClassificationModel.cs
r11171 r11571 23 23 namespace HeuristicLab.Problems.DataAnalysis { 24 24 public interface IClassificationModel : IDataAnalysisModel { 25 IEnumerable<double> GetEstimatedClassValues( Dataset dataset, IEnumerable<int> rows);25 IEnumerable<double> GetEstimatedClassValues(IDataset dataset, IEnumerable<int> rows); 26 26 IClassificationSolution CreateClassificationSolution(IClassificationProblemData problemData); 27 27 } -
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Classification/IDiscriminantFunctionClassificationModel.cs
r11171 r11571 30 30 // class values and thresholds can only be assigned simultanously 31 31 void SetThresholdsAndClassValues(IEnumerable<double> thresholds, IEnumerable<double> classValues); 32 IEnumerable<double> GetEstimatedValues( Dataset dataset, IEnumerable<int> rows);32 IEnumerable<double> GetEstimatedValues(IDataset dataset, IEnumerable<int> rows); 33 33 34 34 event EventHandler ThresholdsChanged; -
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Clustering/IClusteringModel.cs
r11171 r11571 23 23 namespace HeuristicLab.Problems.DataAnalysis { 24 24 public interface IClusteringModel : IDataAnalysisModel { 25 IEnumerable<int> GetClusterValues( Dataset dataset, IEnumerable<int> rows);25 IEnumerable<int> GetClusterValues(IDataset dataset, IEnumerable<int> rows); 26 26 } 27 27 } -
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisProblemData.cs
r11171 r11571 29 29 bool IsEmpty { get; } 30 30 31 Dataset Dataset { get; }31 IDataset Dataset { get; } 32 32 ICheckedItemList<StringValue> InputVariables { get; } 33 33 IEnumerable<string> AllowedInputVariables { get; } -
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionEnsembleModel.cs
r11171 r11571 26 26 void Remove(IRegressionModel model); 27 27 IEnumerable<IRegressionModel> Models { get; } 28 IEnumerable<IEnumerable<double>> GetEstimatedValueVectors( Dataset dataset, IEnumerable<int> rows);28 IEnumerable<IEnumerable<double>> GetEstimatedValueVectors(IDataset dataset, IEnumerable<int> rows); 29 29 } 30 30 } -
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionEnsembleSolution.cs
r11171 r11571 27 27 new RegressionEnsembleProblemData ProblemData { get; set; } 28 28 IItemCollection<IRegressionSolution> RegressionSolutions { get; } 29 IEnumerable<IEnumerable<double>> GetEstimatedValueVectors( Dataset dataset, IEnumerable<int> rows);29 IEnumerable<IEnumerable<double>> GetEstimatedValueVectors(IDataset dataset, IEnumerable<int> rows); 30 30 } 31 31 } -
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionModel.cs
r11171 r11571 23 23 namespace HeuristicLab.Problems.DataAnalysis { 24 24 public interface IRegressionModel : IDataAnalysisModel { 25 IEnumerable<double> GetEstimatedValues( Dataset dataset, IEnumerable<int> rows);25 IEnumerable<double> GetEstimatedValues(IDataset dataset, IEnumerable<int> rows); 26 26 IRegressionSolution CreateRegressionSolution(IRegressionProblemData problemData); 27 27 } -
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/TimeSeriesPrognosis/ITimeSeriesPrognosisModel.cs
r11171 r11571 23 23 namespace HeuristicLab.Problems.DataAnalysis { 24 24 public interface ITimeSeriesPrognosisModel : IRegressionModel { 25 IEnumerable<IEnumerable<double>> GetPrognosedValues( Dataset dataset, IEnumerable<int> rows, IEnumerable<int> horizons);25 IEnumerable<IEnumerable<double>> GetPrognosedValues(IDataset dataset, IEnumerable<int> rows, IEnumerable<int> horizons); 26 26 ITimeSeriesPrognosisSolution CreateTimeSeriesPrognosisSolution(ITimeSeriesPrognosisProblemData problemData); 27 27 }
Note: See TracChangeset
for help on using the changeset viewer.