Documentation
¶
Overview ¶
Package nncls : NN による分類器のパッケージ Python で学習したモデルデータを使用
Index ¶
- func Init(c Config) (err error)
- func MaxIndex(x []float32) (r int)
- func RoundList(x []float32) (r []int)
- func ToOneHot(classID, numClass int) (r []float32, err error)
- type Config
- type MetricsData
- func (md *MetricsData) Accuracy(classID int) (r float32)
- func (md *MetricsData) Add(classID, pred, answer int)
- func (md *MetricsData) AddClassID(predClassID, answerClassID int) (err error)
- func (md *MetricsData) AddLabels(predLabels, answerLabels []int) (err error)
- func (md *MetricsData) MacroMetrics() (macroPrecision, macroRecall, macroFMeasure, averageAccuracy float32)
- func (md *MetricsData) MicroMetrics() (microPrecision, microRecall, microFMeasure, overallAccuracy float32)
- func (md *MetricsData) Precision(classID int) (r float32)
- func (md *MetricsData) Recall(classID int) (r float32)
- func (md *MetricsData) Total() (r int)
- func (md *MetricsData) TotalFN() (r int)
- func (md *MetricsData) TotalFP() (r int)
- func (md *MetricsData) TotalTN() (r int)
- func (md *MetricsData) TotalTP() (r int)
- type Model
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { ModelDir string // モデルデータのディレクトリ InputName string // 入力のプレースホルダの名前 OutputName string // 出力のプレースホルダの名前 NumInput int // 入力となる特徴量の個数 Threshold float32 // ラベル判定の閾値 }
Config : 設定パラメータ
type MetricsData ¶
type MetricsData struct {
// contains filtered or unexported fields
}
MetricsData : メトリクスを保持するデータ型
func (*MetricsData) Accuracy ¶
func (md *MetricsData) Accuracy(classID int) (r float32)
Accuracy : クラスごとの正解率
func (*MetricsData) Add ¶
func (md *MetricsData) Add(classID, pred, answer int)
Add : クラスごとの予測と回答を追加する
classID --- クラスの識別子 pred --- 予測 (1 or 0) 1:classIDであると予測 / 0:classIDではないと予測 answer --- 回答 (1 or 0) 1:classIDが回答 / 0:classID以外が回答
func (*MetricsData) AddClassID ¶
func (md *MetricsData) AddClassID(predClassID, answerClassID int) (err error)
AddClassID : クラスごとの予測と回答を追加する
predClassID --- 予測したクラス answerClassID --- 回答となるクラス
func (*MetricsData) AddLabels ¶
func (md *MetricsData) AddLabels(predLabels, answerLabels []int) (err error)
AddLabels : マルチラベルの予測と回答を追加する
predLabels --- 予測したマルチラベル answerLabels --- 回答となるクラス
func (*MetricsData) MacroMetrics ¶
func (md *MetricsData) MacroMetrics() (macroPrecision, macroRecall, macroFMeasure, averageAccuracy float32)
MacroMetrics : 全体の Macro なメトリクス
func (*MetricsData) MicroMetrics ¶
func (md *MetricsData) MicroMetrics() (microPrecision, microRecall, microFMeasure, overallAccuracy float32)
MicroMetrics : 全体の Micro なメトリクス
func (*MetricsData) Precision ¶
func (md *MetricsData) Precision(classID int) (r float32)
Precision : クラスごとの適合率
func (*MetricsData) Recall ¶
func (md *MetricsData) Recall(classID int) (r float32)
Recall : クラスごとの再現率
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model : モデルデータを保持するデータ型
func (Model) DumpGraphOperations ¶
func (m Model) DumpGraphOperations()
DumpGraphOperations : モデルデータ内のグラフに含まれるオペレーション名を出力する関数
Click to show internal directories.
Click to hide internal directories.