Changeset 2000
- Timestamp:
- 06/04/09 15:18:29 (16 years ago)
- Location:
- trunk/sources
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.CEDMA.Core/3.3/Console.cs
r1529 r2000 37 37 } 38 38 39 private DataSet List dataSetList;40 public DataSet List DataSetList {41 get { return dataSet List; }39 private DataSet dataSet; 40 public DataSet DataSet { 41 get { return dataSet; } 42 42 } 43 43 44 44 public Console() 45 45 : base() { 46 dataSet List = new DataSetList();46 dataSet = new DataSet(); 47 47 } 48 48 … … 71 71 72 72 internal void Connect(string serverUri) { 73 DataSetList.Store = new StoreProxy(serverUri); 73 IStore store = new StoreProxy(serverUri); 74 var variableBindings = store.Query("?Dataset <" + Ontology.PredicateInstanceOf + "> <" + Ontology.TypeDataSet + "> .", 0, 10).ToArray(); 75 if (variableBindings.Length > 0) { 76 dataSet = new DataSet(store, (Entity)variableBindings[0].Get("Dataset")); 77 } else { 78 dataSet.Store = store; 79 } 74 80 } 75 81 } -
trunk/sources/HeuristicLab.CEDMA.Core/3.3/ConsoleEditor.cs
r1529 r2000 42 42 InitializeComponent(); 43 43 this.console = console; 44 serverPanel.Enabled = false;45 44 } 46 45 … … 111 110 serverPanel.Enabled = true; 112 111 serverPanel.Controls.Clear(); 113 Control dataSet ListView = (Control)console.DataSetList.CreateView();114 dataSet ListView.Dock = DockStyle.Fill;115 serverPanel.Controls.Add(dataSet ListView);112 Control dataSetView = (Control)console.DataSet.CreateView(); 113 dataSetView.Dock = DockStyle.Fill; 114 serverPanel.Controls.Add(dataSetView); 116 115 } catch(CommunicationException ex) { 117 116 MessageBox.Show("Exception while trying to connect to " + uriTextBox.Text + "\n" + ex.Message); -
trunk/sources/HeuristicLab.CEDMA.Core/3.3/DataSet.cs
r1529 r2000 61 61 } 62 62 63 private bool activated; 64 public bool Activated { 65 get { return activated; } 66 } 67 63 68 public DataSet() 64 69 : base() { 65 70 guid = Guid.NewGuid(); 66 71 name = "Data set"; 72 activated = false; 67 73 } 68 74 … … 72 78 guid = new Guid(dataSetEntity.Uri.Remove(0, Ontology.CedmaNameSpace.Length)); 73 79 name = guid.ToString(); 80 activated = true; 74 81 } 75 82 … … 79 86 Store.Add(new Statement(myEntity, Ontology.PredicateSerializedData, new Literal(Convert.ToBase64String(PersistenceManager.SaveToGZip(problem))))); 80 87 Store.Add(new Statement(myEntity, Ontology.PredicateName, new Literal(name))); 88 activated = true; 81 89 } 82 90 … … 87 95 internal Results GetResults() { 88 96 Results results = new Results(Store); 89 results.FilterDataSet(new Entity(Ontology.CedmaNameSpace + Guid));90 97 return results; 91 98 } -
trunk/sources/HeuristicLab.CEDMA.Core/3.3/DataSetView.cs
r1529 r2000 58 58 PopulateViewComboBox(); 59 59 resultsButton.Enabled = viewComboBox.SelectedItem != null; 60 if (dataSet.Activated) { 61 activateButton.Enabled = false; 62 editorGroupBox.Enabled = false; 63 viewComboBox.Enabled = true; 64 resultsButton.Enabled = true; 65 progressBar.Enabled = true; 66 } else { 67 activateButton.Enabled = true; 68 editorGroupBox.Enabled = true; 69 viewComboBox.Enabled = false; 70 resultsButton.Enabled = false; 71 progressBar.Enabled = false; 72 } 60 73 } 61 74 -
trunk/sources/HeuristicLab.CEDMA.Core/3.3/HeuristicLab.CEDMA.Core-3.3.csproj
r1534 r2000 103 103 <Compile Include="Problem.cs" /> 104 104 <Compile Include="DataSet.cs" /> 105 <Compile Include="DataSetList.cs" />106 <Compile Include="DataSetListView.cs">107 <SubType>UserControl</SubType>108 </Compile>109 <Compile Include="DataSetListView.Designer.cs">110 <DependentUpon>DataSetListView.cs</DependentUpon>111 </Compile>112 105 <Compile Include="DataSetView.cs"> 113 106 <SubType>UserControl</SubType> … … 163 156 <SubType>Designer</SubType> 164 157 </EmbeddedResource> 165 <EmbeddedResource Include="DataSetListView.resx">166 <DependentUpon>DataSetListView.cs</DependentUpon>167 </EmbeddedResource>168 158 <EmbeddedResource Include="DataSetView.resx"> 169 159 <DependentUpon>DataSetView.cs</DependentUpon> -
trunk/sources/HeuristicLab.CEDMA.Core/3.3/Problem.cs
r1529 r2000 45 45 /// </summary> 46 46 public class Problem : ItemBase { 47 private string name;48 public string Name {49 get { return name; }50 }51 47 private HeuristicLab.DataAnalysis.Dataset dataset; 52 public HeuristicLab.DataAnalysis.Dataset Data Set {48 public HeuristicLab.DataAnalysis.Dataset Dataset { 53 49 get { return dataset; } 54 50 } -
trunk/sources/HeuristicLab.CEDMA.Core/3.3/ProblemView.cs
r1529 r2000 44 44 protected override void UpdateControls() { 45 45 base.UpdateControls(); 46 datasetView.Dataset = problem.Data Set;46 datasetView.Dataset = problem.Dataset; 47 47 trainingSamplesStartTextBox.Text = problem.TrainingSamplesStart.ToString(); 48 48 trainingSamplesEndTextBox.Text = problem.TrainingSamplesEnd.ToString(); … … 61 61 targetsListBox.Items.Clear(); 62 62 inputsListBox.Items.Clear(); 63 for (int i = 0; i < problem.Data Set.Columns; i++) {64 targetsListBox.Items.Add(problem.Data Set.GetVariableName(i), problem.AllowedTargetVariables.Contains(i));65 inputsListBox.Items.Add(problem.Data Set.GetVariableName(i), problem.AllowedInputVariables.Contains(i));63 for (int i = 0; i < problem.Dataset.Columns; i++) { 64 targetsListBox.Items.Add(problem.Dataset.GetVariableName(i), problem.AllowedTargetVariables.Contains(i)); 65 inputsListBox.Items.Add(problem.Dataset.GetVariableName(i), problem.AllowedInputVariables.Contains(i)); 66 66 } 67 67 } … … 89 89 } 90 90 if (success) { 91 Dataset dataset = (Dataset)problem.Data Set;91 Dataset dataset = (Dataset)problem.Dataset; 92 92 dataset.Rows = parser.Rows; 93 93 dataset.Columns = parser.Columns; … … 98 98 dataset.Samples = new double[dataset.Rows * dataset.Columns]; 99 99 Array.Copy(parser.Samples, dataset.Samples, dataset.Columns * dataset.Rows); 100 datasetView.Dataset = problem.Data Set;100 datasetView.Dataset = problem.Dataset; 101 101 102 102 problem.TrainingSamplesStart = parser.TrainingSamplesStart; … … 116 116 } 117 117 } 118 119 118 } 120 119 … … 146 145 int testEnd = int.Parse(testSamplesEndTextBox.Text); 147 146 if (trainingStart < 0 || validationStart < 0 || testStart < 0 || 148 trainingEnd >= problem.Data Set.Rows || validationEnd >= problem.DataSet.Rows || testEnd >= problem.DataSet.Rows ||147 trainingEnd >= problem.Dataset.Rows || validationEnd >= problem.Dataset.Rows || testEnd >= problem.Dataset.Rows || 149 148 trainingStart >= trainingEnd || 150 149 validationStart >= validationEnd || -
trunk/sources/HeuristicLab.CEDMA.Core/3.3/Results.cs
r1529 r2000 68 68 private Dictionary<string, Dictionary<object, double>> categoricalValueIndices = new Dictionary<string, Dictionary<object, double>>(); 69 69 70 private Entity dataSetEntity;71 72 70 public Results(IStore store) { 73 71 this.store = store; 74 }75 76 internal void FilterDataSet(Entity entity) {77 this.dataSetEntity = entity;78 72 } 79 73 … … 93 87 entries = new List<ResultsEntry>(); 94 88 do { 95 var allBindings = store.Query(" <" + dataSetEntity + "><" + Ontology.PredicateHasModel + "> ?Model ." + Environment.NewLine +89 var allBindings = store.Query("?Dataset <" + Ontology.PredicateHasModel + "> ?Model ." + Environment.NewLine + 96 90 "?Model ?Attribute ?Value .", page, PAGE_SIZE); 97 91 var allModelBindings = allBindings.GroupBy(x => (Entity)x.Get("Model")); -
trunk/sources/HeuristicLab.CEDMA.Server/3.3/DispatcherBase.cs
r1922 r2000 65 65 string targetVariableName = dataSet.Problem.GetVariableName(targetVariable); 66 66 67 68 67 if (selectedAlgorithm != null) { 69 68 SetProblemParameters(selectedAlgorithm, dataSet.Problem, targetVariable); … … 77 76 78 77 private void SetProblemParameters(IAlgorithm algo, Problem problem, int targetVariable) { 79 algo.Dataset = problem.Data Set;78 algo.Dataset = problem.Dataset; 80 79 algo.TargetVariable = targetVariable; 81 80 algo.ProblemInjector.GetVariable("TrainingSamplesStart").GetValue<IntData>().Data = problem.TrainingSamplesStart; … … 94 93 } else if (problem.LearningTask == LearningTask.Classification) { 95 94 ItemList<DoubleData> classValues = algo.ProblemInjector.GetVariable("TargetClassValues").GetValue<ItemList<DoubleData>>(); 96 foreach (double classValue in GetDifferentClassValues(problem.Data Set, targetVariable)) classValues.Add(new DoubleData(classValue));95 foreach (double classValue in GetDifferentClassValues(problem.Dataset, targetVariable)) classValues.Add(new DoubleData(classValue)); 97 96 } 98 97 } -
trunk/sources/HeuristicLab.CEDMA.Server/3.3/ExecuterBase.cs
r1922 r2000 71 71 protected void StoreResults(IAlgorithm finishedAlgorithm) { 72 72 Entity modelEntity = new Entity(Ontology.CedmaNameSpace + Guid.NewGuid()); 73 // TODO (gkronber 27052009)74 73 // store.Add(new Statement(finishedAlgorithm.DataSetEntity, Ontology.PredicateHasModel, modelEntity)); 75 74 StoreModelAttribute(modelEntity, Ontology.TargetVariable, finishedAlgorithm.Model.TargetVariable);
Note: See TracChangeset
for help on using the changeset viewer.