Documentation ¶
Index ¶
Constants ¶
View Source
const (
DEFAULT_TRAINING_SHARE = .75
)
View Source
const (
NO_PREDICTION = -1
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataSet ¶
type DataSet struct { ClassNames []string `json:"classes"` AttributeNames []string `json:"attributes"` Records []Record `json:"data"` }
func FromCSV ¶
FromCSV builds a DataSet from CSV data. Returns nil and an error if the data cannot be processed correctly.
func FromCSVFile ¶
FromCSVFile reads the CSV-formatted file and creates a DataSet from it.
func FromJSONFile ¶
func (*DataSet) Attributes ¶
func (*DataSet) MarshalCSV ¶
MarshalCSV converts the DataSet to a byte slice containing the CSV representation (including a header row listing the attributes and terminated by the column header for the class column).
func (*DataSet) Split ¶
func (ds *DataSet) Split(cfg *DataSplitConfig) (*DataSet, *DataSet, error)
Split divides the dataset into separate datasets - the first is the training data, the second is the test data Passing nil for the config results in a random split with 75% of the records used for training. This does not modify the original DataSet.
type DataSplitConfig ¶
type DataSplitConfig struct { Method DataSplitMethod }
type DataSplitMethod ¶
type DataSplitMethod int
const ( SplitRandom DataSplitMethod = iota SplitSequential )
type TestResult ¶
type TestResults ¶
type TestResults []TestResult
func (TestResults) Analyze ¶
func (trs TestResults) Analyze() TestResultsAnalysis
Click to show internal directories.
Click to hide internal directories.