• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# IDataset类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IDataset的典型用法代码示例。如果您正苦于以下问题:C# IDataset类的具体用法?C# IDataset怎么用?C# IDataset使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IDataset类属于命名空间,在下文中一共展示了IDataset类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetEstimatedClassValues

    public IEnumerable<double> GetEstimatedClassValues(IDataset dataset, IEnumerable<int> rows) {
      double[,] inputData = AlglibUtil.PrepareInputMatrix(dataset, allowedInputVariables, rows);

      int n = inputData.GetLength(0);
      int columns = inputData.GetLength(1);
      double[] x = new double[columns];
      double[] y = new double[classValues.Length];

      for (int row = 0; row < n; row++) {
        for (int column = 0; column < columns; column++) {
          x[column] = inputData[row, column];
        }
        alglib.mnlprocess(logitModel, x, ref y);
        // find class for with the largest probability value
        int maxProbClassIndex = 0;
        double maxProb = y[0];
        for (int i = 1; i < y.Length; i++) {
          if (maxProb < y[i]) {
            maxProb = y[i];
            maxProbClassIndex = i;
          }
        }
        yield return classValues[maxProbClassIndex];
      }
    }
开发者ID:thunder176,项目名称:HeuristicLab,代码行数:25,代码来源:MultinomialLogitModel.cs


示例2: NetworkDataset

        public NetworkDataset(string configXML, IDataset osmDataset, string ndsName, IGPMessages messages, ITrackCancel trackCancel)
        {
            _xml = new NetworkDatasetXML(configXML, RESMGR);

            _osmDataset = osmDataset;
            _ndsName = ndsName;
            _messages = messages;
            _trackCancel = trackCancel;

            IDataElement deOSM = GPUtil.MakeDataElementFromNameObject(_osmDataset.FullName);
            _dsPath = deOSM.CatalogPath;

            _osmLineName = _osmDataset.Name + "_osm_ln";
            _osmLinePath = _dsPath + "\\" + _osmLineName;
            _osmPointName = _osmDataset.Name + "_osm_pt";
            _osmPointPath = _dsPath + "\\" + _osmPointName;

            // Get the extent from the point feature class
            // NOTE: the feature dataset is not used for this because exceptions occur (SDE only)
            //       if a feature class was recently deleted from the feature dataset.
            IFeatureClass fcPoint = ((IFeatureWorkspace)_osmDataset.Workspace).OpenFeatureClass(_osmPointName);
            IGeoDataset gds = (IGeoDataset)fcPoint;
            _extent = gds.Extent;
            _spatialReference = gds.SpatialReference;
        }
开发者ID:joshuacroff,项目名称:arcgis-osm-editor,代码行数:25,代码来源:NetworkDataset.cs


示例3: FindClosestCenters

    public static IEnumerable<int> FindClosestCenters(IEnumerable<double[]> centers, IDataset dataset, IEnumerable<string> allowedInputVariables, IEnumerable<int> rows) {
      int nRows = rows.Count();
      int nCols = allowedInputVariables.Count();
      int[] closestCenter = new int[nRows];
      double[] bestCenterDistance = Enumerable.Repeat(double.MaxValue, nRows).ToArray();
      int centerIndex = 1;

      foreach (double[] center in centers) {
        if (nCols != center.Length) throw new ArgumentException();
        int rowIndex = 0;
        foreach (var row in rows) {
          // calc euclidian distance of point to center
          double centerDistance = 0;
          int col = 0;
          foreach (var inputVariable in allowedInputVariables) {
            double d = center[col++] - dataset.GetDoubleValue(inputVariable, row);
            d = d * d; // square;
            centerDistance += d;
            if (centerDistance > bestCenterDistance[rowIndex]) break;
          }
          if (centerDistance < bestCenterDistance[rowIndex]) {
            bestCenterDistance[rowIndex] = centerDistance;
            closestCenter[rowIndex] = centerIndex;
          }
          rowIndex++;
        }
        centerIndex++;
      }
      return closestCenter;
    }
开发者ID:t-h-e,项目名称:HeuristicLab,代码行数:30,代码来源:KMeansClusteringUtil.cs


示例4: DeleteFeatureClass

 public static void DeleteFeatureClass(IDataset data)
 {
     if (data.CanDelete())
     {
         data.Delete();
     }
 }
开发者ID:truonghinh,项目名称:TnX,代码行数:7,代码来源:FeatureClassManagement.cs


示例5: GetPrognosedValues

    public IEnumerable<IEnumerable<double>> GetPrognosedValues(IDataset dataset, IEnumerable<int> rows, IEnumerable<int> horizons) {
      var rowsEnumerator = rows.GetEnumerator();
      var horizonsEnumerator = horizons.GetEnumerator();
      var targetValues = dataset.GetReadOnlyDoubleValues(TargetVariable);
      // produce a n-step forecast for all rows
      while (rowsEnumerator.MoveNext() & horizonsEnumerator.MoveNext()) {
        int row = rowsEnumerator.Current;
        int horizon = horizonsEnumerator.Current;
        if (row - TimeOffset < 0) {
          yield return Enumerable.Repeat(double.NaN, horizon);
          continue;
        }

        double[] prognosis = new double[horizon];
        for (int h = 0; h < horizon; h++) {
          double estimatedValue = 0.0;
          for (int i = 1; i <= TimeOffset; i++) {
            int offset = h - i;
            if (offset >= 0) estimatedValue += prognosis[offset] * Phi[i - 1];
            else estimatedValue += targetValues[row + offset] * Phi[i - 1];

          }
          estimatedValue += Constant;
          prognosis[h] = estimatedValue;
        }

        yield return prognosis;
      }

      if (rowsEnumerator.MoveNext() || horizonsEnumerator.MoveNext())
        throw new ArgumentException("Number of elements in rows and horizon enumerations doesn't match.");
    }
开发者ID:t-h-e,项目名称:HeuristicLab,代码行数:32,代码来源:TimeSeriesPrognosisAutoRegressiveModel.cs


示例6: GetClassShortName

 public static string GetClassShortName(IDataset paramDS)
 {
     if (paramDS == null)
     {
         return "";
     }
     return GetClassShortName(paramDS.Name.ToUpper());
 }
开发者ID:ismethr,项目名称:gas-geological-map,代码行数:8,代码来源:LayerHelper.cs


示例7: Scaling

 public Scaling(IDataset ds, IEnumerable<string> variables, IEnumerable<int> rows) {
   foreach (var variable in variables) {
     var values = ds.GetDoubleValues(variable, rows);
     var min = values.Where(x => !double.IsNaN(x)).Min();
     var max = values.Where(x => !double.IsNaN(x)).Max();
     scalingParameters[variable] = Tuple.Create(min, max);
   }
 }
开发者ID:t-h-e,项目名称:HeuristicLab,代码行数:8,代码来源:Scaling.cs


示例8: Dataset

 public Dataset(IDataset pIDataset,IWorkspace pWorkspace,bool bCut,IGeometry pCutGeomtry)
 {
     m_pIDataset = pIDataset;
     m_pIWorkspace = pWorkspace;
     m_cutGeometry = pCutGeomtry;
     m_bCut = bCut;
     InitialProjection();
     InitialFeatureList();
 }
开发者ID:hy1314200,项目名称:HyDM,代码行数:9,代码来源:Dataset.cs


示例9: Map

		//---------------------------------------------------------------------

		/// <summary>
		/// Initializes a new instance.
		/// </summary>
		/// <param name="path">
		/// Path to the raster file that represents the map.
		/// </param>
		/// <param name="ecoregions">Dataset of ecoregions</param>
		public Map(string   path,
		           IDataset ecoregions)
		{
			this.path = path;
			this.ecoregions = ecoregions;
			IInputRaster<Pixel> map = Util.Raster.Open<Pixel>(path);
			using (map) {
				this.metadata = map.Metadata;
			}
		}
开发者ID:LANDIS-II-Foundation,项目名称:Libraries,代码行数:19,代码来源:Map.cs


示例10: GetEstimatedClassValueVectors

    public IEnumerable<IEnumerable<double>> GetEstimatedClassValueVectors(IDataset dataset, IEnumerable<int> rows) {
      var estimatedValuesEnumerators = (from model in models
                                        select model.GetEstimatedClassValues(dataset, rows).GetEnumerator())
                                       .ToList();

      while (estimatedValuesEnumerators.All(en => en.MoveNext())) {
        yield return from enumerator in estimatedValuesEnumerators
                     select enumerator.Current;
      }
    }
开发者ID:t-h-e,项目名称:HeuristicLab,代码行数:10,代码来源:ClassificationEnsembleModel.cs


示例11: NetworkTurns

        public NetworkTurns(string turnClassName, IDataset osmDataset, INetworkDataset nds)
        {
            _turnClassName = turnClassName;
            _osmDataset = osmDataset;
            _networkDataset = nds;

            IGPUtilities gpUtil = new GPUtilitiesClass();
            IDataElement de = gpUtil.MakeDataElementFromNameObject(osmDataset.FullName);
            _dsPath = de.CatalogPath;
        }
开发者ID:hallahan,项目名称:arcgis-osm-editor,代码行数:10,代码来源:NetworkTurns.cs


示例12: GetEstimatedClassValues

 public IEnumerable<double> GetEstimatedClassValues(IDataset dataset, IEnumerable<int> rows) {
   foreach (var estimatedValuesVector in GetEstimatedClassValueVectors(dataset, rows)) {
     // return the class which is most often occuring
     yield return
       estimatedValuesVector
       .GroupBy(x => x)
       .OrderBy(g => -g.Count())
       .Select(g => g.Key)
       .First();
   }
 }
开发者ID:thunder176,项目名称:HeuristicLab,代码行数:11,代码来源:ClassificationEnsembleModel.cs


示例13: NcaModel

    public NcaModel(int k, double[,] transformationMatrix, IDataset dataset, IEnumerable<int> rows, string targetVariable, IEnumerable<string> allowedInputVariables, double[] classValues) {
      Name = ItemName;
      Description = ItemDescription;
      this.transformationMatrix = (double[,])transformationMatrix.Clone();
      this.allowedInputVariables = allowedInputVariables.ToArray();
      this.targetVariable = targetVariable;
      this.classValues = (double[])classValues.Clone();

      var ds = ReduceDataset(dataset, rows);
      nnModel = new NearestNeighbourModel(ds, Enumerable.Range(0, ds.Rows), k, ds.VariableNames.Last(), ds.VariableNames.Take(transformationMatrix.GetLength(1)), classValues);
    }
开发者ID:thunder176,项目名称:HeuristicLab,代码行数:11,代码来源:NcaModel.cs


示例14: ZPath

 //
 // CONSTRUCTOR
 //
 public ZPath(IDataset dataset)
 {
     IWorkspace workspace = dataset.Workspace;
     ISQLSyntax sqlSyntax = (ISQLSyntax)workspace;
     string database;
     string owner;
     string table;
     sqlSyntax.ParseTableName(dataset.Name, out database, out owner, out table);
     this.Database = database;
     this.Owner = owner;
     this.Table = table;
 }
开发者ID:qjw2bqn,项目名称:Esri-Geometry-Network-Configuration-Manager,代码行数:15,代码来源:ZPath.cs


示例15: Map

        //---------------------------------------------------------------------

        /// <summary>
        /// Initializes a new instance.
        /// </summary>
        /// <param name="path">
        /// Path to the raster file that represents the map.
        /// </param>
        /// <param name="ecoregions">
        /// The dataset of ecoregions that are in the map.
        /// </param>
        /// <param name="rasterFactory">
        /// The raster factory to use to read the map.
        /// </param>
        public Map(string         path,
                   IDataset       ecoregions,
                   IRasterFactory rasterFactory)
        {
            this.path = path;
            this.ecoregions = ecoregions;
            this.rasterFactory = rasterFactory;
            IInputRaster<Pixel> map = rasterFactory.OpenRaster<Pixel>(path);
            using (map) {
                this.metadata = map.Metadata;
            }
        }
开发者ID:LANDIS-II-Foundation,项目名称:Libraries,代码行数:26,代码来源:Map.cs


示例16: Format

    public string Format(ISymbolicExpressionTree symbolicExpressionTree, IDataset dataset) {
      var stringBuilder = new StringBuilder();
      if (dataset != null) CalculateVariableMapping(symbolicExpressionTree, dataset);

      stringBuilder.Append("=");
      stringBuilder.Append(FormatRecursively(symbolicExpressionTree.Root));

      foreach (var variable in variableNameMapping) {
        stringBuilder.AppendLine();
        stringBuilder.Append(variable.Key + " = " + variable.Value);
      }
      return stringBuilder.ToString();
    }
开发者ID:thunder176,项目名称:HeuristicLab,代码行数:13,代码来源:SymbolicDataAnalysisExpressionExcelFormatter.cs


示例17: CalculateIntraClusterSumOfSquares

    public static double CalculateIntraClusterSumOfSquares(KMeansClusteringModel model, IDataset dataset, IEnumerable<int> rows) {
      List<int> clusterValues = model.GetClusterValues(dataset, rows).ToList();
      List<string> allowedInputVariables = model.AllowedInputVariables.ToList();
      int nCols = allowedInputVariables.Count;
      Dictionary<int, List<double[]>> clusterPoints = new Dictionary<int, List<double[]>>();
      Dictionary<int, double[]> clusterMeans = new Dictionary<int, double[]>();
      foreach (var clusterValue in clusterValues.Distinct()) {
        clusterPoints.Add(clusterValue, new List<double[]>());
      }

      // collect points of clusters
      int clusterValueIndex = 0;
      foreach (var row in rows) {
        double[] p = new double[allowedInputVariables.Count];
        for (int i = 0; i < nCols; i++) {
          p[i] = dataset.GetDoubleValue(allowedInputVariables[i], row);
        }
        clusterPoints[clusterValues[clusterValueIndex++]].Add(p);
      }
      // calculate cluster means
      foreach (var pair in clusterPoints) {
        double[] mean = new double[nCols];
        foreach (var p in pair.Value) {
          for (int i = 0; i < nCols; i++) {
            mean[i] += p[i];
          }
        }
        for (int i = 0; i < nCols; i++) {
          mean[i] /= pair.Value.Count;
        }
        clusterMeans[pair.Key] = mean;
      }
      // calculate distances
      double allCenterDistances = 0;
      foreach (var pair in clusterMeans) {
        double[] mean = pair.Value;
        double centerDistances = 0;
        foreach (var clusterPoint in clusterPoints[pair.Key]) {
          double centerDistance = 0;
          for (int i = 0; i < nCols; i++) {
            double d = mean[i] - clusterPoint[i];
            d = d * d;
            centerDistance += d;
          }
          centerDistances += centerDistance;
        }
        allCenterDistances += centerDistances;
      }
      return allCenterDistances;
    }
开发者ID:t-h-e,项目名称:HeuristicLab,代码行数:50,代码来源:KMeansClusteringUtil.cs


示例18: FeatureSelectionRegressionProblemData

 public FeatureSelectionRegressionProblemData(IDataset ds, IEnumerable<string> allowedInputVariables, string targetVariable, string[] selectedFeatures, double[] weights, double optimalRSquared)
   : base(ds, allowedInputVariables, targetVariable) {
   if (selectedFeatures.Length != weights.Length) throw new ArgumentException("Length of selected features vector does not match the length of the weights vector");
   if (optimalRSquared < 0 || optimalRSquared > 1) throw new ArgumentException("Optimal R² is not in range [0..1]");
   Parameters.Add(new FixedValueParameter<StringArray>(
     SelectedFeaturesParameterName,
     "Array of features used to generate the target values.",
     new StringArray(selectedFeatures).AsReadOnly()));
   Parameters.Add(new FixedValueParameter<DoubleArray>(
     WeightsParameterName,
     "Array of weights used to generate the target values.",
     (DoubleArray)(new DoubleArray(weights).AsReadOnly())));
   Parameters.Add(new FixedValueParameter<DoubleValue>(
     OptimalRSquaredParameterName,
     "R² of the optimal solution.",
     (DoubleValue)(new DoubleValue(optimalRSquared).AsReadOnly())));
 }
开发者ID:thunder176,项目名称:HeuristicLab,代码行数:17,代码来源:FeatureSelectionRegressionProblemData.cs


示例19: CalculateReplacementValue

    protected static double CalculateReplacementValue(ISymbolicExpressionTreeNode node, ISymbolicExpressionTree sourceTree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter,
      IDataset dataset, IEnumerable<int> rows) {
      //optimization: constant nodes return always the same value
      ConstantTreeNode constantNode = node as ConstantTreeNode;
      if (constantNode != null) return constantNode.Value;

      var rootSymbol = new ProgramRootSymbol().CreateTreeNode();
      var startSymbol = new StartSymbol().CreateTreeNode();
      rootSymbol.AddSubtree(startSymbol);
      startSymbol.AddSubtree((ISymbolicExpressionTreeNode)node.Clone());

      var tempTree = new SymbolicExpressionTree(rootSymbol);
      // clone ADFs of source tree
      for (int i = 1; i < sourceTree.Root.SubtreeCount; i++) {
        tempTree.Root.AddSubtree((ISymbolicExpressionTreeNode)sourceTree.Root.GetSubtree(i).Clone());
      }
      return interpreter.GetSymbolicExpressionTreeValues(tempTree, dataset, rows).Median();
    }
开发者ID:t-h-e,项目名称:HeuristicLab,代码行数:18,代码来源:SymbolicDataAnalysisSolutionImpactValuesCalculator.cs


示例20: PrepareAndScaleInputMatrix

    public static double[,] PrepareAndScaleInputMatrix(IDataset dataset, IEnumerable<string> variables, IEnumerable<int> rows, Scaling scaling) {
      List<string> variablesList = variables.ToList();
      List<int> rowsList = rows.ToList();

      double[,] matrix = new double[rowsList.Count, variablesList.Count];

      int col = 0;
      foreach (string column in variables) {
        var values = scaling.GetScaledValues(dataset, column, rows);
        int row = 0;
        foreach (var value in values) {
          matrix[row, col] = value;
          row++;
        }
        col++;
      }

      return matrix;
    }
开发者ID:t-h-e,项目名称:HeuristicLab,代码行数:19,代码来源:AlglibUtil.cs



注:本文中的IDataset类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IDateTime类代码示例发布时间:2022-05-24
下一篇:
C# IDataflowObject类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap