当前位置: 首页>>代码示例>>C#>>正文


C# IDataset类代码示例

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


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


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