Code Monkey home page Code Monkey logo

cloudforest's Introduction

Lytics Command Line Tool & Developers Aid

The goal of this tool is to provide CLI access to the Lytics API. It also functions as a developers aid to enable writing and testing LQL (Lytics Query Language) as easily as possible.

We would love any feature requests or ideas that would make this useful to you.

Installation

Download a binary from the releases page and rename to lytics:

# linux/amd64
curl -Lo lytics https://github.com/lytics/lytics/releases/download/latest/lytics_linux \
  && chmod +x lytics \
  && sudo mv lytics /usr/local/bin/

# darwin/amd64
curl -Lo lytics https://github.com/lytics/lytics/releases/download/latest/lytics_mac \
  && chmod +x lytics \
  && sudo mv lytics /usr/local/bin/

Or install from source:

git clone https://github.com/lytics/lytics.git
go build
go install

Or install from the repository via go:

go get -u github.com/lytics/lytics

Usage

All examples use JQ to prettify the JSON output.

export LIOKEY="your_api_key"
lytics --help

Segment Scan Usage

Exporting CSV files, with usage.

Example

# Scan a segment by id
lytics segment scan ab93a9801a72871d689342556b0de2e9 | jq '.'

# Scan a segment by slug
lytics segment scan last_2_hours | jq '.'

# write out this segment to a temp file so we can play with JQ
lytics segment scan last_2_hours > /tmp/users.json

# same thing but with an "ad hoc query"
lytics segment scan '
FILTER AND (
    lastvisit_ts > "now-2d"
    EXISTS email
)
FROM user
' > /tmp/users.json

# use JQ to output a few fields
cat /tmp/users.json | \
 jq -c ' {country: .country, city: .city, org: .org, uid: ._uid, visitct: .visitct} '

# create a CSV file from these users
echo "country,city,org,uid,visitct\n" > /tmp/users.csv
cat /tmp/users.json | \
 jq -r ' [ .country, .city, .org,  ._uid, .visitct ] | @csv ' >> /tmp/users.csv

Lytics Watch Usage

  1. Create NAME.lql (any name) file in a folder.
  2. Assuming you already have data collected, it will use our API to show recent examples against that LQL.

You can open and edit in an editor. Every time you edit it will print resulting users it interpreted from recent data to our API.

Example

# get your API key from the web app account settings screen
export LIOKEY="your_api_key"

cd /path/to/your/project

# create an LQL file
# - utilize the Lytics app "Data -> Data Streams" section to see
#   data fields you are sending to Lytics.

# you can create this in an editor as well
echo '
SELECT
   user_id,
   name,
   todate(ts),
   match("user.") AS user_attributes,
   map(event, todate(ts))   as event_times   KIND map[string]time  MERGEOP LATEST

FROM default
INTO USER
BY user_id
ALIAS my_query
' > default.lql


# start watching
lytics schema queries watch .

# now edit JSON results of how data is interpreted is output

Lytics Watch With Custom Data

  1. Create NAME.lql (any name) file in a folder.
  2. Create NAME.json (any name, must match LQL file name) in folder.
  3. Run the lytics watch command from the folder with files.
  4. Edit .lql, or .json files, upon change the evaluated result of the .lql, JSON will be output.

Example

# get your API key from web app account settings
export LIOKEY="your_api_key"

cd /tmp

# start watching in background
lytics schema queries watch &

# create an LQL file
echo '
SELECT
   user_id,
   name,
   todate(ts),
   match("user.") AS user_attributes,
   map(event, todate(ts))   as event_times   KIND map[string]time  MERGEOP LATEST

FROM data
INTO USER
BY user_id
ALIAS hello
' > hello.lql

# Create an array of JSON events to feed into LQL query
echo '[
    {"user_id":"dump123","name":"Down With","company":"Trump", "event":"project.create", "ts":"2016-11-09"},
    {"user_id":"another234","name":"No More","company":"Trump", "event":"project.signup","user.city":"Portland","user.state":"Or", "ts":"2016-11-09"}
]' > hello.json

SegmentML example

# replace {your model name here} with target_audience::source_audience

# generates tables
lytics segmentml --output all {your model name here}
lytics segmentml --output features {your model name here}
lytics segmentml --output predictions {your model name here}
lytics segmentml --output overview {your model name here}

# for CSV output
lytics --format csv segmentml --output all {your model name here}

# for JSON
lytics --format json segmentml --output all {your model name here}

cloudforest's People

Contributors

drewlanenga avatar giaobhang avatar glycerine avatar junichif avatar rbkreisberg avatar ryanbressler avatar stigz avatar timkaye11 avatar trace-andreason avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cloudforest's Issues

concurrent map writes at catmap.go:20/23

Drat. I tried a simple growforest on the iris data set, and the Go runtime is crashing on concurrent map access.

in catmap.go
func (cm *CatMap) CatToNum(value string) (numericv int) {
    numericv, exsists := cm.Map[value] ///////////////// concurrent read/write here
    if exsists == false {
        numericv = len(cm.Back)
        cm.Map[value] = numericv   ////////////////// concurrent writes here
        cm.Back = append(cm.Back, value)

    }
    return
}

repro: (might need to run a couple of times to get the Go stdlib to detect the concurrent access and panic)

jaten@jatens-MacBook-Pro ~/go/src/github.com/lytics/CloudForest/data (master) $ mkdir tmp
jaten@jatens-MacBook-Pro ~/go/src/github.com/lytics/CloudForest/data (master) $ cp iris.data.fm tmp/train.fm && cd ..
jaten@jatens-MacBook-Pro ~/go/src/github.com/lytics/CloudForest (master) $ go install github.com/lytics/CloudForest/growforest
jaten@jatens-MacBook-Pro ~/go/src/github.com/lytics/CloudForest (master) $ cd data/tmp
jaten@jatens-MacBook-Pro ~/go/src/github.com/lytics/CloudForest/data/tmp (master) $ ls
forest.sf	train.fm
jaten@jatens-MacBook-Pro ~/go/src/github.com/lytics/CloudForest/data/tmp (master) $ ls -al
total 16
drwxrwxr-x  4 jaten  staff   128 Nov 20 14:44 .
drwxrwxr-x  8 jaten  staff   256 Nov 20 14:43 ..
-rw-rw-r--  1 jaten  staff     0 Nov 20 14:44 forest.sf
-rw-rw-r--  1 jaten  staff  4963 Nov 20 14:44 train.fm
jaten@jatens-MacBook-Pro ~/go/src/github.com/lytics/CloudForest/data/tmp (master) $ rm forest.sf 
jaten@jatens-MacBook-Pro ~/go/src/github.com/lytics/CloudForest/data/tmp (master) $ growforest -train train.fm -rfpred forest.sf -target C:Class -oob -nCores 16 -nTrees 1000 -leafSize 8
Threads : 16
nTrees : 1000
Loading data from: train.fm
Target : C:Class
Non Target Features : 4
mTry : 2
non-missing cases: 150
leafSize : 8
nSamples : 150
Recording oob error.
Performing classification with 3 categories.
fatal error: concurrent map writes

goroutine 18 [running]:
runtime.throw(0x11b4b02, 0x15)
	/usr/local/go/src/runtime/panic.go:616 +0x81 fp=0xc42004e7b0 sp=0xc42004e790 pc=0x1027a61
runtime.mapassign_faststr(0x117fdc0, 0xc4200823f0, 0xc4200e7007, 0xb, 0x12d2120)
	/usr/local/go/src/runtime/hashmap_fast.go:703 +0x3e9 fp=0xc42004e820 sp=0xc42004e7b0 pc=0x100b209
github.com/lytics/CloudForest.(*CatMap).CatToNum(...)
	/Users/jaten/go/src/github.com/lytics/CloudForest/catmap.go:23
github.com/lytics/CloudForest.(*CatBallotBox).Vote(0xc42008a100, 0x0, 0xc4200e7007, 0xb, 0x3ff0000000000000)
	/Users/jaten/go/src/github.com/lytics/CloudForest/catballotbox.go:42 +0x277 fp=0xc42004e898 sp=0xc42004e820 pc=0x1117af7
github.com/lytics/CloudForest.(*Tree).VoteCases.func1(0xc420112140, 0xc420114500, 0x15, 0x96, 0x2)
	/Users/jaten/go/src/github.com/lytics/CloudForest/tree.go:421 +0x8e fp=0xc42004e8f0 sp=0xc42004e898 pc=0x113070e
github.com/lytics/CloudForest.(*Node).Recurse(0xc420112140, 0xc42004eb50, 0xc420092f00, 0xc420114500, 0x15, 0x96, 0x2)
	/Users/jaten/go/src/github.com/lytics/CloudForest/node.go:70 +0x7d fp=0xc42004e9a8 sp=0xc42004e8f0 pc=0x11286bd
github.com/lytics/CloudForest.(*Node).Recurse(0xc4201120a0, 0xc42004eb50, 0xc420092f00, 0xc420114500, 0x25, 0x96, 0x2)
	/Users/jaten/go/src/github.com/lytics/CloudForest/node.go:83 +0x27c fp=0xc42004ea60 sp=0xc42004e9a8 pc=0x11288bc
github.com/lytics/CloudForest.(*Node).Recurse(0xc420112000, 0xc42004eb50, 0xc420092f00, 0xc420114500, 0x36, 0x96, 0x1)
	/Users/jaten/go/src/github.com/lytics/CloudForest/node.go:83 +0x27c fp=0xc42004eb18 sp=0xc42004ea60 pc=0x11288bc
github.com/lytics/CloudForest.(*Tree).VoteCases(0xc42000a060, 0xc420092f00, 0x11d3d00, 0xc42008a100, 0xc420114500, 0x36, 0x96)
	/Users/jaten/go/src/github.com/lytics/CloudForest/tree.go:417 +0xba fp=0xc42004eb80 sp=0xc42004eb18 pc=0x112ed6a
main.main.func1()
	/Users/jaten/go/src/github.com/lytics/CloudForest/growforest/growforest.go:696 +0x16a7 fp=0xc42004efe0 sp=0xc42004eb80 pc=0x11588c7
runtime.goexit()
	/usr/local/go/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc42004efe8 sp=0xc42004efe0 pc=0x1050df1
created by main.main
	/Users/jaten/go/src/github.com/lytics/CloudForest/growforest/growforest.go:747 +0x2669

goroutine 1 [semacquire]:
sync.runtime_Semacquire(0xc4200f448c)
	/usr/local/go/src/runtime/sema.go:56 +0x39
sync.(*WaitGroup).Wait(0xc4200f4480)
	/usr/local/go/src/sync/waitgroup.go:129 +0x72
main.main()
	/Users/jaten/go/src/github.com/lytics/CloudForest/growforest/growforest.go:754 +0x3238

goroutine 19 [runnable]:
sync.runtime_SemacquireMutex(0xc42008a044, 0x112c500)
	/usr/local/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc42008a040)
	/usr/local/go/src/sync/mutex.go:134 +0x108
math/rand.(*lockedSource).Int63(0xc42008a040, 0x4ab7118ec39a66a6)
	/usr/local/go/src/math/rand/rand.go:377 +0x2d
math/rand.(*Rand).Int63(0xc420082180, 0x4ab7118ec39a66a6)
	/usr/local/go/src/math/rand/rand.go:82 +0x33
math/rand.(*Rand).Int31(0xc420082180, 0xc44ab7118e)
	/usr/local/go/src/math/rand/rand.go:96 +0x2b
math/rand.(*Rand).Int31n(0xc420082180, 0xc400000096, 0xc400000074)
	/usr/local/go/src/math/rand/rand.go:131 +0x4f
math/rand.(*Rand).Intn(0xc420082180, 0x96, 0x74)
	/usr/local/go/src/math/rand/rand.go:169 +0x45
math/rand.Intn(0x96, 0x74)
	/usr/local/go/src/math/rand/rand.go:326 +0x37
main.main.func1()
	/Users/jaten/go/src/github.com/lytics/CloudForest/growforest/growforest.go:632 +0x1ac8
created by main.main
	/Users/jaten/go/src/github.com/lytics/CloudForest/growforest/growforest.go:747 +0x2669

goroutine 20 [runnable]:
main.main.func1()
	/Users/jaten/go/src/github.com/lytics/CloudForest/growforest/growforest.go:592
created by main.main
	/Users/jaten/go/src/github.com/lytics/CloudForest/growforest/growforest.go:747 +0x2669

goroutine 21 [runnable]:
sync.runtime_SemacquireMutex(0xc42008a044, 0x112c501)
	/usr/local/go/src/runtime/sema.go:71 +0x3d
sync.(*Mutex).Lock(0xc42008a040)
	/usr/local/go/src/sync/mutex.go:134 +0x108
math/rand.(*lockedSource).Int63(0xc42008a040, 0x341e252378ba9d7b)
	/usr/local/go/src/math/rand/rand.go:377 +0x2d
math/rand.(*Rand).Int63(0xc420082180, 0x341e252378ba9d7b)
	/usr/local/go/src/math/rand/rand.go:82 +0x33
math/rand.(*Rand).Int31(0xc420082180, 0xc4341e2523)
	/usr/local/go/src/math/rand/rand.go:96 +0x2b
math/rand.(*Rand).Int31n(0xc420082180, 0xc400000096, 0xc400000013)
	/usr/local/go/src/math/rand/rand.go:131 +0x4f
math/rand.(*Rand).Intn(0xc420082180, 0x96, 0x13)
	/usr/local/go/src/math/rand/rand.go:169 +0x45
math/rand.Intn(0x96, 0x13)
	/usr/local/go/src/math/rand/rand.go:326 +0x37
main.main.func1()
	/Users/jaten/go/src/github.com/lytics/CloudForest/growforest/growforest.go:632 +0x1ac8
created by main.main
	/Users/jaten/go/src/github.com/lytics/CloudForest/growforest/growforest.go:747 +0x2669

goroutine 22 [runnable]:
syscall.Syscall(0x4, 0x3, 0xc42017a000, 0x4c, 0x4c, 0x0, 0x0)
	/usr/local/go/src/syscall/asm_darwin_amd64.s:16 +0x5
syscall.write(0x3, 0xc42017a000, 0x4c, 0x80, 0xc42016a001, 0x0, 0x0)
	/usr/local/go/src/syscall/zsyscall_darwin_amd64.go:1321 +0x5f
syscall.Write(0x3, 0xc42017a000, 0x4c, 0x80, 0x4b, 0x0, 0xc4201a78d0)
	/usr/local/go/src/syscall/syscall_unix.go:181 +0x49
internal/poll.(*FD).Write(0xc42009e460, 0xc42017a000, 0x4c, 0x80, 0x0, 0x0, 0x0)
	/usr/local/go/src/internal/poll/fd_unix.go:256 +0x142
os.(*File).write(0xc42009c058, 0xc42017a000, 0x4c, 0x80, 0xc4201d0020, 0x76, 0xc42016e000)
	/usr/local/go/src/os/file_unix.go:243 +0x4e
os.(*File).Write(0xc42009c058, 0xc42017a000, 0x4c, 0x80, 0x103f137, 0xc4201a79d8, 0x100d18a)
	/usr/local/go/src/os/file.go:144 +0x6f
fmt.Fprintln(0x11d3380, 0xc42009c058, 0xc4201a7a88, 0x1, 0x1, 0xc4201d8000, 0x4b, 0x18)
	/usr/local/go/src/fmt/print.go:255 +0x8b
github.com/lytics/CloudForest.(*ForestWriter).WriteNode(0xc420081020, 0xc420156000, 0x11b18f4, 0x1)
	/Users/jaten/go/src/github.com/lytics/CloudForest/forestwriter.go:95 +0x17d
github.com/lytics/CloudForest.(*ForestWriter).WriteNodeAndChildren(0xc420081020, 0xc420156000, 0x11b18f4, 0x1)
	/Users/jaten/go/src/github.com/lytics/CloudForest/forestwriter.go:63 +0x4d
github.com/lytics/CloudForest.(*ForestWriter).WriteTree(0xc420081020, 0xc420158000, 0x0)
	/Users/jaten/go/src/github.com/lytics/CloudForest/forestwriter.go:38 +0x8b
main.main.func1()
	/Users/jaten/go/src/github.com/lytics/CloudForest/growforest/growforest.go:705 +0x15b6
created by main.main
	/Users/jaten/go/src/github.com/lytics/CloudForest/growforest/growforest.go:747 +0x2669

goroutine 23 [runnable]:
github.com/lytics/CloudForest.(*CatBallotBox).Vote(0xc42008a100, 0x2, 0xc4200e7007, 0xb, 0x3ff0000000000000)
	/Users/jaten/go/src/github.com/lytics/CloudForest/catballotbox.go:47 +0x13e
github.com/lytics/CloudForest.(*Tree).VoteCases.func1(0xc42009e690, 0xc420146500, 0x15, 0x96, 0x2)
	/Users/jaten/go/src/github.com/lytics/CloudForest/tree.go:421 +0x8e
github.com/lytics/CloudForest.(*Node).Recurse(0xc42009e690, 0xc42011fb50, 0xc420092f00, 0xc420146500, 0x15, 0x96, 0x2)
	/Users/jaten/go/src/github.com/lytics/CloudForest/node.go:70 +0x7d
github.com/lytics/CloudForest.(*Node).Recurse(0xc42009e5f0, 0xc42011fb50, 0xc420092f00, 0xc420146500, 0x17, 0x96, 0x2)
	/Users/jaten/go/src/github.com/lytics/CloudForest/node.go:83 +0x27c
github.com/lytics/CloudForest.(*Node).Recurse(0xc42009e550, 0xc42011fb50, 0xc420092f00, 0xc420146500, 0x36, 0x96, 0x1)
	/Users/jaten/go/src/github.com/lytics/CloudForest/node.go:83 +0x27c
github.com/lytics/CloudForest.(*Tree).VoteCases(0xc42008a2a0, 0xc420092f00, 0x11d3d00, 0xc42008a100, 0xc420146500, 0x36, 0x96)
	/Users/jaten/go/src/github.com/lytics/CloudForest/tree.go:417 +0xba
main.main.func1()
	/Users/jaten/go/src/github.com/lytics/CloudForest/growforest/growforest.go:696 +0x16a7
created by main.main
	/Users/jaten/go/src/github.com/lytics/CloudForest/growforest/growforest.go:747 +0x2669

goroutine 24 [runnable]:
main.main.func1()
	/Users/jaten/go/src/github.com/lytics/CloudForest/growforest/growforest.go:592
created by main.main
	/Users/jaten/go/src/github.com/lytics/CloudForest/growforest/growforest.go:747 +0x2669

goroutine 25 [runnable]:
main.main.func1()
	/Users/jaten/go/src/github.com/lytics/CloudForest/growforest/growforest.go:592
created by main.main
	/Users/jaten/go/src/github.com/lytics/CloudForest/growforest/growforest.go:747 +0x2669

goroutine 26 [runnable]:
main.main.func1()
	/Users/jaten/go/src/github.com/lytics/CloudForest/growforest/growforest.go:592
created by main.main
	/Users/jaten/go/src/github.com/lytics/CloudForest/growforest/growforest.go:747 +0x2669

goroutine 27 [runnable]:
main.main.func1()
	/Users/jaten/go/src/github.com/lytics/CloudForest/growforest/growforest.go:592
created by main.main
	/Users/jaten/go/src/github.com/lytics/CloudForest/growforest/growforest.go:747 +0x2669

goroutine 28 [runnable]:
main.main.func1()
	/Users/jaten/go/src/github.com/lytics/CloudForest/growforest/growforest.go:592
created by main.main
	/Users/jaten/go/src/github.com/lytics/CloudForest/growforest/growforest.go:747 +0x2669

goroutine 29 [runnable]:
main.main.func1()
	/Users/jaten/go/src/github.com/lytics/CloudForest/growforest/growforest.go:592
created by main.main
	/Users/jaten/go/src/github.com/lytics/CloudForest/growforest/growforest.go:747 +0x2669

goroutine 30 [runnable]:
main.main.func1()
	/Users/jaten/go/src/github.com/lytics/CloudForest/growforest/growforest.go:592
created by main.main
	/Users/jaten/go/src/github.com/lytics/CloudForest/growforest/growforest.go:747 +0x2669

goroutine 31 [runnable]:
main.main.func1()
	/Users/jaten/go/src/github.com/lytics/CloudForest/growforest/growforest.go:592
created by main.main
	/Users/jaten/go/src/github.com/lytics/CloudForest/growforest/growforest.go:747 +0x2669

goroutine 32 [runnable]:
main.main.func1()
	/Users/jaten/go/src/github.com/lytics/CloudForest/growforest/growforest.go:592
created by main.main
	/Users/jaten/go/src/github.com/lytics/CloudForest/growforest/growforest.go:747 +0x2669

goroutine 33 [runnable]:
sync.(*Mutex).Lock(0xc420080a90)
	/usr/local/go/src/sync/mutex.go:72 +0x2e9
github.com/lytics/CloudForest.(*CatBallotBox).Vote(0xc42008a100, 0x3e, 0xc4200e722d, 0xf, 0x3ff0000000000000)
	/Users/jaten/go/src/github.com/lytics/CloudForest/catballotbox.go:43 +0xa7
github.com/lytics/CloudForest.(*Tree).VoteCases.func1(0xc420122280, 0xc42013a578, 0xb, 0x87, 0x3)
	/Users/jaten/go/src/github.com/lytics/CloudForest/tree.go:421 +0x8e
github.com/lytics/CloudForest.(*Node).Recurse(0xc420122280, 0xc42011eb50, 0xc420092f00, 0xc42013a578, 0xb, 0x87, 0x3)
	/Users/jaten/go/src/github.com/lytics/CloudForest/node.go:70 +0x7d
github.com/lytics/CloudForest.(*Node).Recurse(0xc4201221e0, 0xc42011eb50, 0xc420092f00, 0xc42013a578, 0x11, 0x87, 0x3)
	/Users/jaten/go/src/github.com/lytics/CloudForest/node.go:83 +0x27c
github.com/lytics/CloudForest.(*Node).Recurse(0xc420122190, 0xc42011eb50, 0xc420092f00, 0xc42013a578, 0x26, 0x87, 0x2)
	/Users/jaten/go/src/github.com/lytics/CloudForest/node.go:83 +0x27c
github.com/lytics/CloudForest.(*Node).Recurse(0xc42009e4b0, 0xc42011eb50, 0xc420092f00, 0xc42013a500, 0x35, 0x96, 0x1)
	/Users/jaten/go/src/github.com/lytics/CloudForest/node.go:86 +0x203
github.com/lytics/CloudForest.(*Tree).VoteCases(0xc42008a180, 0xc420092f00, 0x11d3d00, 0xc42008a100, 0xc42013a500, 0x35, 0x96)
	/Users/jaten/go/src/github.com/lytics/CloudForest/tree.go:417 +0xba
main.main.func1()
	/Users/jaten/go/src/github.com/lytics/CloudForest/growforest/growforest.go:696 +0x16a7
created by main.main
	/Users/jaten/go/src/github.com/lytics/CloudForest/growforest/growforest.go:747 +0x2669
jaten@jatens-MacBook-Pro ~/go/src/github.com/lytics/CloudForest/data/tmp (master) $ go version
go version go1.10.2 darwin/amd64
jaten@jatens-MacBook-Pro ~/go/src/github.com/lytics/CloudForest/data/tmp (master) $ 
jaten@jatens-MacBook-Pro ~/go/src/github.com/lytics/CloudForest/data/tmp (master) $ git log
commit 24f133408db30c1c6663d332d684012aed50c299 (HEAD -> master, origin/master, origin/HEAD)
Merge: cd7d62f fb121eb
Author: Nicolas Lanker <[email protected]>
Date:   Tue Jun 12 12:58:31 2018 -0700

    Merge pull request #17 from lytics/transpose_output_change

    changes bug in featurematrix output from transpose to not transpose

applyforest not happy with gradient boosting via -gbt

Seems like the -gbt gradient boosting might need a little love. I could get it to grow, but applyforest was unhappy (crashed; see below).

## first without -gbt, works:
jaten@jatens-MacBook-Pro ~/go/src/github.com/lytics/CloudForest (master) $ growforest -train data/iris.data.fm -rfpred forest.sf -target C:Class -mTry 2 -nTrees 20 -leafSize 1 
Threads : 1
nTrees : 20
Loading data from: data/iris.data.fm
Target : C:Class
Non Target Features : 4
mTry : 2
non-missing cases: 150
leafSize : 1
nSamples : 150
Performing classification with 3 categories.
Total training time (seconds): 0.008251627
jaten@jatens-MacBook-Pro ~/go/src/github.com/lytics/CloudForest (master) $ applyforest -fm ./data/iris.data.fm -rfpred forest.sf -preds pred.tsv
Target is C:Class in feature 4
Error: 0.00666666666666671
Outputting label predicted actual tsv to pred.tsv

## now with -gbt, growforest works, but applyforest crashes:
jaten@jatens-MacBook-Pro ~/go/src/github.com/lytics/CloudForest (master) $ growforest -train data/iris.data.fm -rfpred forest.sf -target C:Class -mTry 2 -nTrees 20 -leafSize 1 -gbt 0.0001
Threads : 1
nTrees : 20
Loading data from: data/iris.data.fm
Target : C:Class
Non Target Features : 4
mTry : 2
non-missing cases: 150
leafSize : 1
nSamples : 150
Performing classification with 3 categories.
Using Gradient Boosting Classification with postive class: True
Total training time (seconds): 0.002043676
jaten@jatens-MacBook-Pro ~/go/src/github.com/lytics/CloudForest (master) $ applyforest -fm ./data/iris.data.fm -rfpred forest.sf -preds pred.tsv
Target is C:Class in feature 4
Error: 1
Outputting label predicted actual tsv to pred.tsv
panic: interface conversion: CloudForest.VoteTallyer is *CloudForest.CatBallotBox, not *CloudForest.NumBallotBox

goroutine 1 [running]:
main.main()
	/Users/jaten/go/src/github.com/lytics/CloudForest/applyforest/applyforest.go:96 +0x14af
jaten@jatens-MacBook-Pro ~/go/src/github.com/lytics/CloudForest (master) $ git log|head
commit 1af2b08f235b69b4393276f293055e1d89d1a555
Merge: 0e79e70 7075fe5
Author: Tim Kaye <[email protected]>
Date:   Wed Nov 21 10:24:03 2018 -0800

    Merge pull request #18 from lytics/determinstic_ballotbox
    
    Ensure that predictions/tallies are always deterministic

commit 7075fe572867b7e6ac7ea9fc4fea4f9f603c6025
jaten@jatens-MacBook-Pro ~/go/src/github.com/lytics/CloudForest (master) $ go version
go version go1.10.2 darwin/amd64

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.