Class DataFrame
Data frame to load data like CSV, images and text in binary format. The instance is then send to Train or Predict method
Namespace: SiaNet.Data
Assembly: SiaNet.dll
Syntax
public class DataFrame
Properties
| Improve this Doc View SourceItem[UInt32]
Gets the DataFrame at the specified index.
Declaration
public DataFrame this[uint index] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | index | The index. |
Property Value
Type | Description |
---|---|
DataFrame | The DataFrame. |
Item[UInt32, UInt32]
Gets the DataFrame with the specified start and end index.
Declaration
public DataFrame this[uint start, uint end] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | start | The start index. |
System.UInt32 | end | The end index. |
Property Value
Type | Description |
---|---|
DataFrame | The DataFrame. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | End must be greater than start |
Shape
Gets the shape of the data frame.
Declaration
public long[] Shape { get; }
Property Value
Type | Description |
---|---|
System.Int64[] | The shape. |
Methods
| Improve this Doc View SourceGetBatch(Int32, Int32, Int32)
Get batch data with specified start index and size
Declaration
public Tensor GetBatch(int start, int size, int axis = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | start | The start. |
System.Int32 | size | The size. |
System.Int32 | axis | The axis. |
Returns
Type | Description |
---|---|
Tensor |
GetTensor()
Gets the underlaying tensor instance.
Declaration
public Tensor GetTensor()
Returns
Type | Description |
---|---|
Tensor |
Head(UInt32, String)
Prints the dataframe, by default first 5 records are printed. Helpful to understand the data structure.
Declaration
public void Head(uint count = 5U, string title = "")
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | count | The count of records to print. |
System.String | title | The title to display. |
Reshape(Int64[])
Reshapes the data frame to specified new shape.
Declaration
public void Reshape(params long[] newShape)
Parameters
Type | Name | Description |
---|---|---|
System.Int64[] | newShape | The new shape. |
ToFrame(Tensor)
Converts to tensor to a data frame.
Declaration
public virtual void ToFrame(Tensor t)
Parameters
Type | Name | Description |
---|---|---|
Tensor | t | The t. |