1
0
mirror of https://github.com/sjwhitworth/golearn.git synced 2025-04-26 13:49:14 +08:00

Remove excessive logging

This commit is contained in:
Richard Townsend 2017-08-08 12:29:00 +01:00
parent d23619eac2
commit a90ef09781
2 changed files with 0 additions and 12 deletions

View File

@ -10,7 +10,6 @@ import (
"os"
"reflect"
"runtime"
"log"
)
const (
@ -137,7 +136,6 @@ func DeserializeAttribute(data []byte) (Attribute, error) {
Attr json.RawMessage `json:"attr"`
}
log.Printf("DeserializeAttribute = %s", data)
var rawAttr JSONAttribute
err := json.Unmarshal(data, &rawAttr)
if err != nil {
@ -164,7 +162,6 @@ func DeserializeAttribute(data []byte) (Attribute, error) {
return nil, fmt.Errorf("Can't deserialize: %s (error: %s)", rawAttr, err)
}
attr.SetName(rawAttr.Name)
log.Printf("DeserializeAttribute = %s", attr)
return attr, nil
}

View File

@ -7,7 +7,6 @@ import (
"github.com/sjwhitworth/golearn/evaluation"
"encoding/json"
"sort"
"log"
)
// NodeType determines whether a DecisionTreeNode is a leaf or not.
@ -59,7 +58,6 @@ func (d *DecisionTreeRule) unmarshalJSON(data []byte) error {
d.SplitVal = splitVal.(float64)
}
split := jsonMap["split_attribute"]
log.Printf("DecisionTreeRule/UnmarshalJSON: %v", split)
splitBytes, err := json.Marshal(split)
if err != nil {
panic(err)
@ -76,9 +74,7 @@ func (d *DecisionTreeRule) unmarshalJSON(data []byte) error {
}
func (d *DecisionTreeRule) UnmarshalJSON(data []byte) error {
log.Printf("DecisionTreeRule/UnmarshalJSON: input is %s", data)
ret := d.unmarshalJSON(data)
log.Printf("DecisionTreeRule/UnmarshalJSON: output is %s, self = %s", ret, d.String())
return ret
}
@ -162,7 +158,6 @@ func (d *DecisionTreeNode) MarshalJSON() ([]byte, error) {
// UnmarshalJSON reads a JSON representation of this Attribute.
func (d *DecisionTreeNode) UnmarshalJSON(data []byte) error {
log.Printf("Input JSON: %s", string(data))
jsonMap := make(map[string]interface{})
err := json.Unmarshal(data, &jsonMap)
if err != nil {
@ -203,9 +198,6 @@ func (d *DecisionTreeNode) UnmarshalJSON(data []byte) error {
d.ClassAttr = classAttr
d.SplitRule = nil
log.Printf("Before adding children: %s", d.String())
if splitRule, ok := jsonMap["split_rule"]; ok {
d.SplitRule = &DecisionTreeRule{}
splitRuleBytes, err := json.Marshal(splitRule)
@ -234,7 +226,6 @@ func (d *DecisionTreeNode) UnmarshalJSON(data []byte) error {
}
log.Printf("After adding children: %s", d.String())
return nil
}