repo
stringlengths
6
47
file_url
stringlengths
77
269
file_path
stringlengths
5
186
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-07 08:35:43
2026-01-07 08:55:24
truncated
bool
2 classes
aydinnyunus/wallet-tracker
https://github.com/aydinnyunus/wallet-tracker/blob/3a71f080080541a24ac49aaa22468db8e4dedfc7/domain/repository/redis.go
domain/repository/redis.go
package repository import ( "fmt" ) // global constants for file const () // global variables (not cool) for this file var () // ScammerQueryArgs are arguments you can use to customize your queries. Multiple fields can be used at once, // also empty query args is not a problem. type ScammerQueryArgs struct { // ...
go
Apache-2.0
3a71f080080541a24ac49aaa22468db8e4dedfc7
2026-01-07T09:45:59.997897Z
false
aydinnyunus/wallet-tracker
https://github.com/aydinnyunus/wallet-tracker/blob/3a71f080080541a24ac49aaa22468db8e4dedfc7/domain/cli/cli.go
domain/cli/cli.go
package cli import ( "encoding/json" "io/ioutil" "github.com/pkg/errors" "github.com/aydinnyunus/wallet-tracker/domain/repository" ) /* Here we keep the necessary configuration of our cli. */ // global constants for file. const () // global variables (not cool) for this file. var () type Cli struct { Us...
go
Apache-2.0
3a71f080080541a24ac49aaa22468db8e4dedfc7
2026-01-07T09:45:59.997897Z
false
aydinnyunus/wallet-tracker
https://github.com/aydinnyunus/wallet-tracker/blob/3a71f080080541a24ac49aaa22468db8e4dedfc7/cli/command/neodash/start.go
cli/command/neodash/start.go
package neodash import ( "fmt" "github.com/aydinnyunus/wallet-tracker/domain/cli" models "github.com/aydinnyunus/wallet-tracker/domain/repository" "github.com/fatih/color" "github.com/k0kubun/pp" "github.com/spf13/cobra" "github.com/spf13/viper" "log" "os" "os/exec" "strconv" ) // global constants for file...
go
Apache-2.0
3a71f080080541a24ac49aaa22468db8e4dedfc7
2026-01-07T09:45:59.997897Z
false
aydinnyunus/wallet-tracker
https://github.com/aydinnyunus/wallet-tracker/blob/3a71f080080541a24ac49aaa22468db8e4dedfc7/cli/command/neodash/neodash.go
cli/command/neodash/neodash.go
package neodash import ( "io" "os" "github.com/spf13/cobra" ) // global constants for file const () // global variables (not cool) for this file var () // NewNeodashCommand serves the base command for querying neodash. // // Adds flags and subcommands for neodash commands here, func NewNeodashCommand() *cobra.C...
go
Apache-2.0
3a71f080080541a24ac49aaa22468db8e4dedfc7
2026-01-07T09:45:59.997897Z
false
aydinnyunus/wallet-tracker
https://github.com/aydinnyunus/wallet-tracker/blob/3a71f080080541a24ac49aaa22468db8e4dedfc7/cli/command/commands/commands.go
cli/command/commands/commands.go
package commands import ( "github.com/aydinnyunus/wallet-tracker/cli/command/neodash" "github.com/aydinnyunus/wallet-tracker/cli/command/redis" "github.com/aydinnyunus/wallet-tracker/cli/command/tracker" "github.com/fatih/color" "github.com/spf13/cobra" "io" "os" ) // NewWalletTrackerCommand is the highest com...
go
Apache-2.0
3a71f080080541a24ac49aaa22468db8e4dedfc7
2026-01-07T09:45:59.997897Z
false
aydinnyunus/wallet-tracker
https://github.com/aydinnyunus/wallet-tracker/blob/3a71f080080541a24ac49aaa22468db8e4dedfc7/cli/command/redis/redis.go
cli/command/redis/redis.go
package redis import ( "io" "os" "github.com/spf13/cobra" ) // global constants for file const () // global variables (not cool) for this file var () // NewRedisCommand serves the base command for querying redis. // // Adds flags and subcommands for redis commands here, func NewRedisCommand() *cobra.Command { ...
go
Apache-2.0
3a71f080080541a24ac49aaa22468db8e4dedfc7
2026-01-07T09:45:59.997897Z
false
aydinnyunus/wallet-tracker
https://github.com/aydinnyunus/wallet-tracker/blob/3a71f080080541a24ac49aaa22468db8e4dedfc7/cli/command/redis/get.go
cli/command/redis/get.go
package redis import ( "github.com/fatih/color" "github.com/go-redis/redis/v8" "github.com/k0kubun/pp" "github.com/pkg/errors" "github.com/spf13/cobra" "github.com/spf13/viper" "github.com/aydinnyunus/wallet-tracker/cli/command/repository" models "github.com/aydinnyunus/wallet-tracker/domain/repository" ) //...
go
Apache-2.0
3a71f080080541a24ac49aaa22468db8e4dedfc7
2026-01-07T09:45:59.997897Z
false
aydinnyunus/wallet-tracker
https://github.com/aydinnyunus/wallet-tracker/blob/3a71f080080541a24ac49aaa22468db8e4dedfc7/cli/command/tracker/websocket.go
cli/command/tracker/websocket.go
package tracker import ( "github.com/aydinnyunus/wallet-tracker/cli/command/repository" models "github.com/aydinnyunus/wallet-tracker/domain/repository" "github.com/fatih/color" "github.com/spf13/cobra" "github.com/spf13/viper" ) // global constants for file const () // global variables (not cool) for this file...
go
Apache-2.0
3a71f080080541a24ac49aaa22468db8e4dedfc7
2026-01-07T09:45:59.997897Z
false
aydinnyunus/wallet-tracker
https://github.com/aydinnyunus/wallet-tracker/blob/3a71f080080541a24ac49aaa22468db8e4dedfc7/cli/command/tracker/tracker.go
cli/command/tracker/tracker.go
package tracker import ( "github.com/spf13/cobra" "io" "os" ) // global constants for file const () // global variables (not cool) for this file var () // NewTrackCommand serves the base command for querying redis. // // Adds flags and subcommands for redis commands here, func NewTrackCommand() *cobra.Command { ...
go
Apache-2.0
3a71f080080541a24ac49aaa22468db8e4dedfc7
2026-01-07T09:45:59.997897Z
false
aydinnyunus/wallet-tracker
https://github.com/aydinnyunus/wallet-tracker/blob/3a71f080080541a24ac49aaa22468db8e4dedfc7/cli/command/tracker/track.go
cli/command/tracker/track.go
package tracker import ( "fmt" "github.com/aydinnyunus/blockchain" "github.com/aydinnyunus/wallet-tracker/cli/command/repository" models "github.com/aydinnyunus/wallet-tracker/domain/repository" "github.com/fatih/color" "github.com/k0kubun/pp" "github.com/spf13/cobra" "github.com/spf13/viper" "log" "math/ran...
go
Apache-2.0
3a71f080080541a24ac49aaa22468db8e4dedfc7
2026-01-07T09:45:59.997897Z
false
aydinnyunus/wallet-tracker
https://github.com/aydinnyunus/wallet-tracker/blob/3a71f080080541a24ac49aaa22468db8e4dedfc7/cli/command/repository/parser.go
cli/command/repository/parser.go
package repository import ( "context" "encoding/json" "github.com/PuerkitoBio/goquery" "github.com/go-redis/redis/v8" "golang.org/x/net/html" "io" "io/ioutil" "log" "net/http" "strconv" "strings" ) type exitResponse struct { D struct { TxTotal string `json:"txTotal"` BalanceTotal strin...
go
Apache-2.0
3a71f080080541a24ac49aaa22468db8e4dedfc7
2026-01-07T09:45:59.997897Z
false
aydinnyunus/wallet-tracker
https://github.com/aydinnyunus/wallet-tracker/blob/3a71f080080541a24ac49aaa22468db8e4dedfc7/cli/command/repository/generic.go
cli/command/repository/generic.go
package repository import ( "fmt" "github.com/joho/godotenv" "log" "os" "os/exec" "strings" ) func GetEnv(key, fallback string) string { err := godotenv.Load() if err != nil { log.Fatalf("Error loading .env file") } if value, ok := os.LookupEnv(key); ok { return value } return fallback } func CheckW...
go
Apache-2.0
3a71f080080541a24ac49aaa22468db8e4dedfc7
2026-01-07T09:45:59.997897Z
false
aydinnyunus/wallet-tracker
https://github.com/aydinnyunus/wallet-tracker/blob/3a71f080080541a24ac49aaa22468db8e4dedfc7/cli/command/repository/neo4j.go
cli/command/repository/neo4j.go
package repository import ( "github.com/fatih/color" "github.com/neo4j/neo4j-go-driver/v4/neo4j" ) func Neo4jDatabase(hash, timestamp, totalUSD, totalAmount, flowBTC, flowUSD string, from, toAddress map[int]map[string]string) (string, error) { driver, err := neo4j.NewDriver(Neo4jUri, neo4j.BasicAuth(Neo4jUser, Neo...
go
Apache-2.0
3a71f080080541a24ac49aaa22468db8e4dedfc7
2026-01-07T09:45:59.997897Z
false
aydinnyunus/wallet-tracker
https://github.com/aydinnyunus/wallet-tracker/blob/3a71f080080541a24ac49aaa22468db8e4dedfc7/cli/command/repository/consts.go
cli/command/repository/consts.go
package repository import ( "time" ) const ( BtcNetwork = 1 EthNetwork = 0 importQuery = "MERGE (t:Transaction {hash:$hash}) CREATE (t2:Transaction) SET t.hash = $hash, t.timestamp = datetime($timestamp), " + "t.totalBTC = toFloat($total_amount), t.totalUSD = toFloat($total_usd),t.flowBTC = toFloat($flow_btc)...
go
Apache-2.0
3a71f080080541a24ac49aaa22468db8e4dedfc7
2026-01-07T09:45:59.997897Z
false
aydinnyunus/wallet-tracker
https://github.com/aydinnyunus/wallet-tracker/blob/3a71f080080541a24ac49aaa22468db8e4dedfc7/cli/command/repository/websocket.go
cli/command/repository/websocket.go
package repository import ( "encoding/json" "flag" "fmt" models "github.com/aydinnyunus/wallet-tracker/domain/repository" "github.com/fatih/color" "github.com/gorilla/websocket" "log" "math/rand" "net/url" "os" "os/signal" "strconv" "time" ) type responseJSON struct { Op string `json:"op"` X struct { ...
go
Apache-2.0
3a71f080080541a24ac49aaa22468db8e4dedfc7
2026-01-07T09:45:59.997897Z
false
aydinnyunus/wallet-tracker
https://github.com/aydinnyunus/wallet-tracker/blob/3a71f080080541a24ac49aaa22468db8e4dedfc7/cli/command/repository/db.go
cli/command/repository/db.go
package repository import ( "context" "github.com/aydinnyunus/wallet-tracker/domain/repository" "github.com/go-redis/redis/v8" ) // global constants for file const () // global variables (not cool) for this file var () // ConnectToRedis establishes a live connection to your agents database. // Make sure to have...
go
Apache-2.0
3a71f080080541a24ac49aaa22468db8e4dedfc7
2026-01-07T09:45:59.997897Z
false
aydinnyunus/wallet-tracker
https://github.com/aydinnyunus/wallet-tracker/blob/3a71f080080541a24ac49aaa22468db8e4dedfc7/cli/command/repository/btc.go
cli/command/repository/btc.go
package repository import ( "encoding/json" "fmt" "io" "io/ioutil" "log" "net/http" "strings" ) type Response struct { Usd struct { One5M float64 `json:"15m"` Last float64 `json:"last"` Buy float64 `json:"buy"` Sell float64 `json:"sell"` Symbol string `json:"symbol"` } `json:"USD"` } func...
go
Apache-2.0
3a71f080080541a24ac49aaa22468db8e4dedfc7
2026-01-07T09:45:59.997897Z
false
aydinnyunus/wallet-tracker
https://github.com/aydinnyunus/wallet-tracker/blob/3a71f080080541a24ac49aaa22468db8e4dedfc7/cli/command/repository/graph.go
cli/command/repository/graph.go
package repository // Graph : represents a Graph type Graph struct { Nodes []*GraphNode } // GraphNode : represents a Graph node type GraphNode struct { id int WalletId string value int Edges map[int]int } // New : returns a new instance of a Graph func New() *Graph { return &Graph{ Nodes: []*GraphNode...
go
Apache-2.0
3a71f080080541a24ac49aaa22468db8e4dedfc7
2026-01-07T09:45:59.997897Z
false
mmatczuk/go_generics
https://github.com/mmatczuk/go_generics/blob/0aaa050f9bab8160cf684130d0afa69ff582cbe6/cmd/go_merge/merge.go
cmd/go_merge/merge.go
// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in w...
go
Apache-2.0
0aaa050f9bab8160cf684130d0afa69ff582cbe6
2026-01-07T09:46:00.360379Z
false
mmatczuk/go_generics
https://github.com/mmatczuk/go_generics/blob/0aaa050f9bab8160cf684130d0afa69ff582cbe6/cmd/go_generics/imports.go
cmd/go_generics/imports.go
// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in w...
go
Apache-2.0
0aaa050f9bab8160cf684130d0afa69ff582cbe6
2026-01-07T09:46:00.360379Z
false
mmatczuk/go_generics
https://github.com/mmatczuk/go_generics/blob/0aaa050f9bab8160cf684130d0afa69ff582cbe6/cmd/go_generics/generics.go
cmd/go_generics/generics.go
// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in w...
go
Apache-2.0
0aaa050f9bab8160cf684130d0afa69ff582cbe6
2026-01-07T09:46:00.360379Z
false
mmatczuk/go_generics
https://github.com/mmatczuk/go_generics/blob/0aaa050f9bab8160cf684130d0afa69ff582cbe6/cmd/go_generics/remove.go
cmd/go_generics/remove.go
// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in w...
go
Apache-2.0
0aaa050f9bab8160cf684130d0afa69ff582cbe6
2026-01-07T09:46:00.360379Z
false
mmatczuk/go_generics
https://github.com/mmatczuk/go_generics/blob/0aaa050f9bab8160cf684130d0afa69ff582cbe6/generics_tests/all_types/input.go
generics_tests/all_types/input.go
// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in w...
go
Apache-2.0
0aaa050f9bab8160cf684130d0afa69ff582cbe6
2026-01-07T09:46:00.360379Z
false
mmatczuk/go_generics
https://github.com/mmatczuk/go_generics/blob/0aaa050f9bab8160cf684130d0afa69ff582cbe6/generics_tests/all_types/lib/lib.go
generics_tests/all_types/lib/lib.go
// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in w...
go
Apache-2.0
0aaa050f9bab8160cf684130d0afa69ff582cbe6
2026-01-07T09:46:00.360379Z
false
mmatczuk/go_generics
https://github.com/mmatczuk/go_generics/blob/0aaa050f9bab8160cf684130d0afa69ff582cbe6/generics_tests/all_types/output/output.go
generics_tests/all_types/output/output.go
// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in w...
go
Apache-2.0
0aaa050f9bab8160cf684130d0afa69ff582cbe6
2026-01-07T09:46:00.360379Z
false
mmatczuk/go_generics
https://github.com/mmatczuk/go_generics/blob/0aaa050f9bab8160cf684130d0afa69ff582cbe6/generics_tests/consts/input.go
generics_tests/consts/input.go
// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in w...
go
Apache-2.0
0aaa050f9bab8160cf684130d0afa69ff582cbe6
2026-01-07T09:46:00.360379Z
false
mmatczuk/go_generics
https://github.com/mmatczuk/go_generics/blob/0aaa050f9bab8160cf684130d0afa69ff582cbe6/generics_tests/consts/output/output.go
generics_tests/consts/output/output.go
// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in w...
go
Apache-2.0
0aaa050f9bab8160cf684130d0afa69ff582cbe6
2026-01-07T09:46:00.360379Z
false
mmatczuk/go_generics
https://github.com/mmatczuk/go_generics/blob/0aaa050f9bab8160cf684130d0afa69ff582cbe6/generics_tests/remove_typedef/input.go
generics_tests/remove_typedef/input.go
// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in w...
go
Apache-2.0
0aaa050f9bab8160cf684130d0afa69ff582cbe6
2026-01-07T09:46:00.360379Z
false
mmatczuk/go_generics
https://github.com/mmatczuk/go_generics/blob/0aaa050f9bab8160cf684130d0afa69ff582cbe6/generics_tests/remove_typedef/output/output.go
generics_tests/remove_typedef/output/output.go
// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in w...
go
Apache-2.0
0aaa050f9bab8160cf684130d0afa69ff582cbe6
2026-01-07T09:46:00.360379Z
false
mmatczuk/go_generics
https://github.com/mmatczuk/go_generics/blob/0aaa050f9bab8160cf684130d0afa69ff582cbe6/generics_tests/all_stmts/input.go
generics_tests/all_stmts/input.go
// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in w...
go
Apache-2.0
0aaa050f9bab8160cf684130d0afa69ff582cbe6
2026-01-07T09:46:00.360379Z
false
mmatczuk/go_generics
https://github.com/mmatczuk/go_generics/blob/0aaa050f9bab8160cf684130d0afa69ff582cbe6/generics_tests/all_stmts/output/output.go
generics_tests/all_stmts/output/output.go
// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in w...
go
Apache-2.0
0aaa050f9bab8160cf684130d0afa69ff582cbe6
2026-01-07T09:46:00.360379Z
false
mmatczuk/go_generics
https://github.com/mmatczuk/go_generics/blob/0aaa050f9bab8160cf684130d0afa69ff582cbe6/generics_tests/simple/input.go
generics_tests/simple/input.go
// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in w...
go
Apache-2.0
0aaa050f9bab8160cf684130d0afa69ff582cbe6
2026-01-07T09:46:00.360379Z
false
mmatczuk/go_generics
https://github.com/mmatczuk/go_generics/blob/0aaa050f9bab8160cf684130d0afa69ff582cbe6/generics_tests/simple/output/output.go
generics_tests/simple/output/output.go
// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in w...
go
Apache-2.0
0aaa050f9bab8160cf684130d0afa69ff582cbe6
2026-01-07T09:46:00.360379Z
false
mmatczuk/go_generics
https://github.com/mmatczuk/go_generics/blob/0aaa050f9bab8160cf684130d0afa69ff582cbe6/generics_tests/imports/input.go
generics_tests/imports/input.go
// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in w...
go
Apache-2.0
0aaa050f9bab8160cf684130d0afa69ff582cbe6
2026-01-07T09:46:00.360379Z
false
mmatczuk/go_generics
https://github.com/mmatczuk/go_generics/blob/0aaa050f9bab8160cf684130d0afa69ff582cbe6/generics_tests/imports/output/output.go
generics_tests/imports/output/output.go
// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in w...
go
Apache-2.0
0aaa050f9bab8160cf684130d0afa69ff582cbe6
2026-01-07T09:46:00.360379Z
false
mmatczuk/go_generics
https://github.com/mmatczuk/go_generics/blob/0aaa050f9bab8160cf684130d0afa69ff582cbe6/globals/globals_visitor.go
globals/globals_visitor.go
// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in w...
go
Apache-2.0
0aaa050f9bab8160cf684130d0afa69ff582cbe6
2026-01-07T09:46:00.360379Z
false
mmatczuk/go_generics
https://github.com/mmatczuk/go_generics/blob/0aaa050f9bab8160cf684130d0afa69ff582cbe6/globals/scope.go
globals/scope.go
// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in w...
go
Apache-2.0
0aaa050f9bab8160cf684130d0afa69ff582cbe6
2026-01-07T09:46:00.360379Z
false
google/readahead
https://github.com/google/readahead/blob/eaceba16903255cb149d1efc316f6cc83d765268/readahead_test.go
readahead_test.go
// Copyright 2016 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in...
go
Apache-2.0
eaceba16903255cb149d1efc316f6cc83d765268
2026-01-07T09:46:00.553454Z
false
google/readahead
https://github.com/google/readahead/blob/eaceba16903255cb149d1efc316f6cc83d765268/readahead.go
readahead.go
// Copyright 2016 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in...
go
Apache-2.0
eaceba16903255cb149d1efc316f6cc83d765268
2026-01-07T09:46:00.553454Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter08/deep_learning/example1/myprogram.go
Chapter08/deep_learning/example1/myprogram.go
package main import ( "archive/zip" "bufio" "flag" "fmt" "io" "io/ioutil" "log" "net/http" "os" "path/filepath" tf "github.com/tensorflow/tensorflow/tensorflow/go" "github.com/tensorflow/tensorflow/tensorflow/go/op" ) func main() { // An example for using the TensorFlow Go API for image recognition // ...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter08/utilizing_our_simple_nn/example1/myprogram.go
Chapter08/utilizing_our_simple_nn/example1/myprogram.go
package main import ( "encoding/csv" "errors" "fmt" "log" "math" "math/rand" "os" "strconv" "time" "github.com/gonum/floats" "gonum.org/v1/gonum/mat" ) // neuralNet contains all of the information // that defines a trained neural network. type neuralNet struct { config neuralNetConfig wHidden *mat.Den...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter08/building_a_simple_nn/example1/myprogram.go
Chapter08/building_a_simple_nn/example1/myprogram.go
package main import ( "errors" "fmt" "log" "math" "math/rand" "time" "github.com/gonum/floats" "gonum.org/v1/gonum/mat" ) // neuralNet contains all of the information // that defines a trained neural network. type neuralNet struct { config neuralNetConfig wHidden *mat.Dense bHidden *mat.Dense wOut *...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter04/linear_regression/example2/myprogram.go
Chapter04/linear_regression/example2/myprogram.go
package main import ( "fmt" "log" "os" "github.com/gonum/plot" "github.com/gonum/plot/plotter" "github.com/gonum/plot/vg" "github.com/kniren/gota/dataframe" ) func main() { // Open the advertising dataset file. f, err := os.Open("Advertising.csv") if err != nil { log.Fatal(err) } defer f.Close() // ...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter04/linear_regression/example1/myprogram.go
Chapter04/linear_regression/example1/myprogram.go
package main import ( "fmt" "log" "os" "github.com/kniren/gota/dataframe" ) func main() { // Open the CSV file. advertFile, err := os.Open("Advertising.csv") if err != nil { log.Fatal(err) } defer advertFile.Close() // Create a dataframe from the CSV file. advertDF := dataframe.ReadCSV(advertFile) /...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter04/linear_regression/example3/myprogram.go
Chapter04/linear_regression/example3/myprogram.go
package main import ( "image/color" "log" "os" "github.com/gonum/plot" "github.com/gonum/plot/plotter" "github.com/gonum/plot/vg" "github.com/kniren/gota/dataframe" ) func main() { // Open the advertising dataset file. f, err := os.Open("Advertising.csv") if err != nil { log.Fatal(err) } defer f.Close...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter04/linear_regression/example6/myprogram.go
Chapter04/linear_regression/example6/myprogram.go
package main import ( "encoding/csv" "fmt" "log" "math" "os" "strconv" "github.com/sajari/regression" ) func main() { // Open the training dataset file. f, err := os.Open("training.csv") if err != nil { log.Fatal(err) } defer f.Close() // Create a new CSV reader reading from the opened file. reader...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter04/linear_regression/example5/myprogram.go
Chapter04/linear_regression/example5/myprogram.go
package main import ( "encoding/csv" "fmt" "log" "os" "strconv" "github.com/sajari/regression" ) func main() { // Open the training dataset file. f, err := os.Open("training.csv") if err != nil { log.Fatal(err) } defer f.Close() // Create a new CSV reader reading from the opened file. reader := csv....
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter04/linear_regression/example7/myprogram.go
Chapter04/linear_regression/example7/myprogram.go
package main import ( "image/color" "log" "os" "github.com/gonum/plot" "github.com/gonum/plot/plotter" "github.com/gonum/plot/vg" "github.com/kniren/gota/dataframe" ) func main() { // Open the advertising dataset file. f, err := os.Open("Advertising.csv") if err != nil { log.Fatal(err) } defer f.Close...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter04/linear_regression/example4/myprogram.go
Chapter04/linear_regression/example4/myprogram.go
package main import ( "bufio" "log" "os" "github.com/kniren/gota/dataframe" ) func main() { // Open the advertising dataset file. f, err := os.Open("Advertising.csv") if err != nil { log.Fatal(err) } defer f.Close() // Create a dataframe from the CSV file. // The types of the columns will be inferred....
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter04/multiple_regression/example2/myprogram.go
Chapter04/multiple_regression/example2/myprogram.go
package main import ( "encoding/csv" "fmt" "log" "math" "os" "strconv" "github.com/sajari/regression" ) func main() { // Open the training dataset file. f, err := os.Open("training.csv") if err != nil { log.Fatal(err) } defer f.Close() // Create a new CSV reader reading from the opened file. reader...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter04/multiple_regression/example1/myprogram.go
Chapter04/multiple_regression/example1/myprogram.go
package main import ( "encoding/csv" "fmt" "log" "os" "strconv" "github.com/sajari/regression" ) func main() { // Open the training dataset file. f, err := os.Open("training.csv") if err != nil { log.Fatal(err) } defer f.Close() // Create a new CSV reader reading from the opened file. reader := csv....
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter04/non-linear_regression/example2/myprogram.go
Chapter04/non-linear_regression/example2/myprogram.go
package main import ( "encoding/csv" "fmt" "log" "os" "strconv" "github.com/berkmancenter/ridge" "github.com/gonum/matrix/mat64" ) func main() { // Open the training dataset file. f, err := os.Open("training.csv") if err != nil { log.Fatal(err) } defer f.Close() // Create a new CSV reader reading fr...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter04/non-linear_regression/example1/myprogram.go
Chapter04/non-linear_regression/example1/myprogram.go
package main import ( "encoding/csv" "fmt" "log" "os" "strconv" "github.com/gonum/matrix/mat64" ) func main() { // Open the training dataset file. f, err := os.Open("training.csv") if err != nil { log.Fatal(err) } defer f.Close() // Create a new CSV reader reading from the opened file. reader := csv...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter04/non-linear_regression/example3/myprogram.go
Chapter04/non-linear_regression/example3/myprogram.go
package main import ( "encoding/csv" "fmt" "log" "math" "os" "strconv" ) func main() { // Open the test dataset file. f, err := os.Open("test.csv") if err != nil { log.Fatal(err) } defer f.Close() // Create a new CSV reader reading from the opened file. reader := csv.NewReader(f) // Read in all of ...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter06/distance/example1/myprogram.go
Chapter06/distance/example1/myprogram.go
package main import ( "fmt" "github.com/gonum/floats" ) func main() { // Calculate the Euclidean distance, specified here via // the last argument in the Distance function. distance := floats.Distance([]float64{1, 2}, []float64{3, 4}, 2) fmt.Printf("\nDistance: %0.2f\n\n", distance) }
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter06/k-means/example2/myprogram.go
Chapter06/k-means/example2/myprogram.go
package main import ( "image/color" "log" "os" "github.com/gonum/plot" "github.com/gonum/plot/plotter" "github.com/gonum/plot/vg" "github.com/kniren/gota/dataframe" ) func main() { // Open the driver dataset file. f, err := os.Open("fleet_data.csv") if err != nil { log.Fatal(err) } defer f.Close() /...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter06/k-means/example1/myprogram.go
Chapter06/k-means/example1/myprogram.go
package main import ( "fmt" "log" "os" "github.com/gonum/plot" "github.com/gonum/plot/plotter" "github.com/gonum/plot/vg" "github.com/kniren/gota/dataframe" ) func main() { // Open the CSV file. driverDataFile, err := os.Open("fleet_data.csv") if err != nil { log.Fatal(err) } defer driverDataFile.Clos...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter06/k-means/example3/myprogram.go
Chapter06/k-means/example3/myprogram.go
package main import ( "encoding/csv" "fmt" "io" "log" "os" "strconv" "github.com/mash/gokmeans" ) func main() { // Open the driver dataset file. f, err := os.Open("fleet_data.csv") if err != nil { log.Fatal(err) } defer f.Close() // Create a new CSV reader. r := csv.NewReader(f) r.FieldsPerRecord ...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter06/k-means/example5/myprogram.go
Chapter06/k-means/example5/myprogram.go
package main import ( "fmt" "log" "os" "github.com/gonum/floats" "github.com/kniren/gota/dataframe" ) func main() { // Open the driver dataset file. f, err := os.Open("fleet_data.csv") if err != nil { log.Fatal(err) } defer f.Close() // Create a dataframe from the CSV file. driverDF := dataframe.Read...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter06/k-means/example4/myprogram.go
Chapter06/k-means/example4/myprogram.go
package main import ( "image/color" "log" "os" "github.com/gonum/floats" "github.com/gonum/plot" "github.com/gonum/plot/plotter" "github.com/gonum/plot/vg" "github.com/kniren/gota/dataframe" ) func main() { // Open the driver dataset file. f, err := os.Open("fleet_data.csv") if err != nil { log.Fatal(e...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter06/evaluating/example2/myprogram.go
Chapter06/evaluating/example2/myprogram.go
package main import ( "fmt" "log" "os" "github.com/gonum/floats" "github.com/kniren/gota/dataframe" ) type centroid []float64 func main() { // Pull in the CSV file. irisFile, err := os.Open("iris.csv") if err != nil { log.Fatal(err) } defer irisFile.Close() // Create a dataframe from the CSV file. i...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter06/evaluating/example1/myprogram.go
Chapter06/evaluating/example1/myprogram.go
package main import ( "fmt" "log" "os" "github.com/kniren/gota/dataframe" ) type centroid []float64 func main() { // Pull in the CSV file. irisFile, err := os.Open("iris.csv") if err != nil { log.Fatal(err) } defer irisFile.Close() // Create a dataframe from the CSV file. irisDF := dataframe.ReadCSV(...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter02/vectors/example2/myprogram.go
Chapter02/vectors/example2/myprogram.go
package main import ( "fmt" "github.com/gonum/matrix/mat64" ) func main() { // Create a new vector value. myvector := mat64.NewVector(2, []float64{11.0, 5.2}) fmt.Println(myvector) }
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter02/vectors/example1/myprogram.go
Chapter02/vectors/example1/myprogram.go
package main import "fmt" func main() { // Initialize a "vector" via a slice. var myvector []float64 // Add a couple of components to the vector. myvector = append(myvector, 11.0) myvector = append(myvector, 5.2) fmt.Println(myvector) }
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter02/vectors/example3/myprogram.go
Chapter02/vectors/example3/myprogram.go
package main import ( "fmt" "github.com/gonum/floats" ) func main() { // Initialize a couple of "vectors" represented as slices. vectorA := []float64{11.0, 5.2, -1.3} vectorB := []float64{-7.2, 4.2, 5.1} // Compute the dot product of A and B // (https://en.wikipedia.org/wiki/Dot_product). dotProduct := flo...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter02/vectors/example4/myprogram.go
Chapter02/vectors/example4/myprogram.go
package main import ( "fmt" "github.com/gonum/blas/blas64" "github.com/gonum/matrix/mat64" ) func main() { // Initialize a couple of "vectors" represented as slices. vectorA := mat64.NewVector(3, []float64{11.0, 5.2, -1.3}) vectorB := mat64.NewVector(3, []float64{-7.2, 4.2, 5.1}) // Compute the dot product ...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter02/statistical_visualizations/example2/myprogram.go
Chapter02/statistical_visualizations/example2/myprogram.go
package main import ( "log" "os" "github.com/gonum/plot" "github.com/gonum/plot/plotter" "github.com/gonum/plot/vg" "github.com/kniren/gota/dataframe" ) func main() { // Open the CSV file. irisFile, err := os.Open("../data/iris.csv") if err != nil { log.Fatal(err) } defer irisFile.Close() // Create a...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter02/statistical_visualizations/example1/myprogram.go
Chapter02/statistical_visualizations/example1/myprogram.go
package main import ( "fmt" "log" "os" "github.com/gonum/plot" "github.com/gonum/plot/plotter" "github.com/gonum/plot/vg" "github.com/kniren/gota/dataframe" ) func main() { // Open the CSV file. irisFile, err := os.Open("../data/iris.csv") if err != nil { log.Fatal(err) } defer irisFile.Close() // C...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter02/matrices/example2/myprogram.go
Chapter02/matrices/example2/myprogram.go
package main import ( "fmt" "github.com/gonum/matrix/mat64" ) func main() { // Create a flat representation of our matrix. data := []float64{1.2, -5.7, -2.4, 7.3} // Form our matrix. a := mat64.NewDense(2, 2, data) // Get a single value from the matrix. val := a.At(0, 1) fmt.Printf("The value of a at (0,...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter02/matrices/example1/myprogram.go
Chapter02/matrices/example1/myprogram.go
package main import ( "fmt" "github.com/gonum/matrix/mat64" ) func main() { // Create a flat representation of our matrix. data := []float64{1.2, -5.7, -2.4, 7.3} // Form our matrix. a := mat64.NewDense(2, 2, data) // As a sanity check, output the matrix to standard out. fa := mat64.Formatted(a, mat64.Pre...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter02/matrices/example3/myprogram.go
Chapter02/matrices/example3/myprogram.go
package main import ( "fmt" "log" "github.com/gonum/matrix/mat64" ) func main() { // Create a new matrix a. a := mat64.NewDense(3, 3, []float64{1, 2, 3, 0, 4, 5, 0, 0, 6}) // Compute and output the transpose of the matrix. ft := mat64.Formatted(a.T(), mat64.Prefix(" ")) fmt.Printf("a^T = %v\n\n", ft) ...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter02/statistical_measures/example2/myprogram.go
Chapter02/statistical_measures/example2/myprogram.go
package main import ( "fmt" "log" "os" "github.com/gonum/floats" "github.com/gonum/stat" "github.com/kniren/gota/dataframe" ) func main() { // Open the CSV file. irisFile, err := os.Open("../data/iris.csv") if err != nil { log.Fatal(err) } defer irisFile.Close() // Create a dataframe from the CSV fil...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter02/statistical_measures/example1/myprogram.go
Chapter02/statistical_measures/example1/myprogram.go
package main import ( "fmt" "log" "os" "github.com/gonum/stat" "github.com/kniren/gota/dataframe" "github.com/montanaflynn/stats" ) func main() { // Open the CSV file. irisFile, err := os.Open("../data/iris.csv") if err != nil { log.Fatal(err) } defer irisFile.Close() // Create a dataframe from the C...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter02/hypothesis_testing/example2/myprogram.go
Chapter02/hypothesis_testing/example2/myprogram.go
package main import ( "fmt" "github.com/gonum/stat" "github.com/gonum/stat/distuv" ) func main() { // Define the observed frequencies. observed := []float64{ 260.0, // This number is the number of observed with no regular exercise. 135.0, // This number is the number of observed with sporatic exercise. 1...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter02/hypothesis_testing/example1/myprogram.go
Chapter02/hypothesis_testing/example1/myprogram.go
package main import ( "fmt" "github.com/gonum/stat" ) func main() { // Define observed and expected values. Most // of the time these will come from your // data (website visits, etc.). observed := []float64{48, 52} expected := []float64{50, 50} // Calculate the ChiSquare test statistic. chiSquare := stat...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter05/naive_bayes/example1/myprogram.go
Chapter05/naive_bayes/example1/myprogram.go
package main import ( "fmt" "log" "github.com/sjwhitworth/golearn/base" "github.com/sjwhitworth/golearn/evaluation" "github.com/sjwhitworth/golearn/filters" "github.com/sjwhitworth/golearn/naive" ) func main() { // Read in the loan training data set into golearn "instances". trainingData, err := base.ParseC...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter05/decision_tree/example2/myprogram.go
Chapter05/decision_tree/example2/myprogram.go
package main import ( "fmt" "log" "math" "math/rand" "github.com/sjwhitworth/golearn/base" "github.com/sjwhitworth/golearn/ensemble" "github.com/sjwhitworth/golearn/evaluation" ) func main() { // Read in the iris data set into golearn "instances". irisData, err := base.ParseCSVToInstances("iris.csv", true)...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter05/decision_tree/example1/myprogram.go
Chapter05/decision_tree/example1/myprogram.go
package main import ( "fmt" "log" "math" "math/rand" "github.com/sjwhitworth/golearn/base" "github.com/sjwhitworth/golearn/evaluation" "github.com/sjwhitworth/golearn/trees" ) func main() { // Read in the iris data set into golearn "instances". irisData, err := base.ParseCSVToInstances("iris.csv", true) i...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter05/kNN/example1/myprogram.go
Chapter05/kNN/example1/myprogram.go
package main import ( "fmt" "log" "math" "github.com/sjwhitworth/golearn/base" "github.com/sjwhitworth/golearn/evaluation" "github.com/sjwhitworth/golearn/knn" ) func main() { // Read in the iris data set into golearn "instances". irisData, err := base.ParseCSVToInstances("iris.csv", true) if err != nil { ...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter05/logistic_regression/example2/myprogram.go
Chapter05/logistic_regression/example2/myprogram.go
package main import ( "image/color" "log" "math" "github.com/gonum/plot" "github.com/gonum/plot/plotter" "github.com/gonum/plot/vg" ) func main() { // Create a new plot. p, err := plot.New() if err != nil { log.Fatal(err) } p.Title.Text = "Logistic Function" p.X.Label.Text = "x" p.Y.Label.Text = "f(x...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter05/logistic_regression/example1/myprogram.go
Chapter05/logistic_regression/example1/myprogram.go
package main import ( "fmt" "math" ) func main() { fmt.Println(logistic(1.0)) } // logistic implements the logistic function, which // is used in logistic regression. func logistic(x float64) float64 { return 1 / (1 + math.Exp(-x)) }
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter05/logistic_regression/example3/myprogram.go
Chapter05/logistic_regression/example3/myprogram.go
package main import ( "encoding/csv" "log" "os" "strconv" "strings" ) func main() { // Open the loan dataset file. f, err := os.Open("loan_data.csv") if err != nil { log.Fatal(err) } defer f.Close() // Create a new CSV reader reading from the opened file. reader := csv.NewReader(f) reader.FieldsPerRe...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter05/logistic_regression/example6/myprogram.go
Chapter05/logistic_regression/example6/myprogram.go
package main import ( "encoding/csv" "fmt" "log" "math" "math/rand" "os" "strconv" "time" "github.com/gonum/matrix/mat64" ) func main() { // Open the training dataset file. f, err := os.Open("training.csv") if err != nil { log.Fatal(err) } defer f.Close() // Create a new CSV reader reading from th...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter05/logistic_regression/example5/myprogram.go
Chapter05/logistic_regression/example5/myprogram.go
package main import ( "bufio" "log" "os" "github.com/kniren/gota/dataframe" ) func main() { // Open the clean loan dataset file. f, err := os.Open("clean_loan_data.csv") if err != nil { log.Fatal(err) } defer f.Close() // Create a dataframe from the CSV file. // The types of the columns will be inferr...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter05/logistic_regression/example7/myprogram.go
Chapter05/logistic_regression/example7/myprogram.go
package main import ( "encoding/csv" "fmt" "io" "log" "math" "os" "strconv" ) func main() { // Open the test examples. f, err := os.Open("test.csv") if err != nil { log.Fatal(err) } defer f.Close() // Create a new CSV reader reading from the opened file. reader := csv.NewReader(f) // observed and ...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter05/logistic_regression/example4/myprogram.go
Chapter05/logistic_regression/example4/myprogram.go
package main import ( "fmt" "log" "os" "github.com/gonum/plot" "github.com/gonum/plot/plotter" "github.com/gonum/plot/vg" "github.com/kniren/gota/dataframe" ) func main() { // Open the CSV file. loanDataFile, err := os.Open("clean_loan_data.csv") if err != nil { log.Fatal(err) } defer loanDataFile.Clo...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter03/validation/training_test/example1/myprogram.go
Chapter03/validation/training_test/example1/myprogram.go
package main import ( "bufio" "log" "os" "github.com/kniren/gota/dataframe" ) func main() { // Open the diabetes dataset file. f, err := os.Open("diabetes.csv") if err != nil { log.Fatal(err) } defer f.Close() // Create a dataframe from the CSV file. // The types of the columns will be inferred. diab...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter03/evaluation/categorical_metrics/example2/myprogram.go
Chapter03/evaluation/categorical_metrics/example2/myprogram.go
package main import ( "encoding/csv" "fmt" "io" "log" "os" "strconv" ) func main() { // Open the labeled observations and predictions. f, err := os.Open("labeled.csv") if err != nil { log.Fatal(err) } defer f.Close() // Create a new CSV reader reading from the opened file. reader := csv.NewReader(f) ...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter03/evaluation/categorical_metrics/example1/myprogram.go
Chapter03/evaluation/categorical_metrics/example1/myprogram.go
package main import ( "encoding/csv" "fmt" "io" "log" "os" "strconv" ) func main() { // Open the binary observations and predictions. f, err := os.Open("labeled.csv") if err != nil { log.Fatal(err) } defer f.Close() // Create a new CSV reader reading from the opened file. reader := csv.NewReader(f) ...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter03/evaluation/categorical_metrics/example3/myprogram.go
Chapter03/evaluation/categorical_metrics/example3/myprogram.go
package main import ( "fmt" "github.com/gonum/stat" "gonum.org/v1/gonum/integrate" ) func main() { // Define our scores and classes. scores := []float64{0.1, 0.35, 0.4, 0.8} classes := []bool{true, false, true, false} // Calculate the true positive rates (recalls) and // false positive rates. tpr, fpr := ...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter03/evaluation/continuous_metrics/example2/myprogram.go
Chapter03/evaluation/continuous_metrics/example2/myprogram.go
package main import ( "encoding/csv" "fmt" "io" "log" "os" "strconv" "github.com/gonum/stat" ) func main() { // Open the continuous observations and predictions. f, err := os.Open("continuous_data.csv") if err != nil { log.Fatal(err) } defer f.Close() // Create a new CSV reader reading from the open...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter03/evaluation/continuous_metrics/example1/myprogram.go
Chapter03/evaluation/continuous_metrics/example1/myprogram.go
package main import ( "encoding/csv" "fmt" "io" "log" "math" "os" "strconv" ) func main() { // Open the continuous observations and predictions. f, err := os.Open("continuous_data.csv") if err != nil { log.Fatal(err) } defer f.Close() // Create a new CSV reader reading from the opened file. reader :...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter07/auto_regressive/example2/myprogram.go
Chapter07/auto_regressive/example2/myprogram.go
package main import ( "encoding/csv" "image/color" "log" "math" "os" "strconv" "github.com/gonum/plot" "github.com/gonum/plot/plotter" "github.com/gonum/plot/vg" "github.com/kniren/gota/dataframe" ) func main() { // Open the CSV file. passengersFile, err := os.Open("AirPassengers.csv") if err != nil { ...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter07/auto_regressive/example1/myprogram.go
Chapter07/auto_regressive/example1/myprogram.go
package main import ( "encoding/csv" "image/color" "log" "os" "strconv" "github.com/gonum/plot" "github.com/gonum/plot/plotter" "github.com/gonum/plot/vg" "github.com/kniren/gota/dataframe" ) func main() { // Open the CSV file. passengersFile, err := os.Open("AirPassengers.csv") if err != nil { log.Fa...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter07/auto_regressive/example3/myprogram.go
Chapter07/auto_regressive/example3/myprogram.go
package main import ( "log" "math" "os" "github.com/gonum/plot" "github.com/gonum/plot/plotter" "github.com/gonum/plot/plotutil" "github.com/gonum/plot/vg" "github.com/gonum/stat" "github.com/kniren/gota/dataframe" ) func main() { // Open the CSV file. passengersFile, err := os.Open("log_diff_series.csv"...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter07/auto_regressive/example6/myprogram.go
Chapter07/auto_regressive/example6/myprogram.go
package main import ( "encoding/csv" "fmt" "log" "math" "os" "strconv" "github.com/gonum/plot" "github.com/gonum/plot/plotter" "github.com/gonum/plot/vg" ) func main() { // Open the log differenced dataset file. transFile, err := os.Open("log_diff_series.csv") if err != nil { log.Fatal(err) } defer ...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter07/auto_regressive/example5/myprogram.go
Chapter07/auto_regressive/example5/myprogram.go
package main import ( "fmt" "log" "os" "strconv" "github.com/kniren/gota/dataframe" "github.com/sajari/regression" ) func main() { // Open the CSV file. passengersFile, err := os.Open("log_diff_series.csv") if err != nil { log.Fatal(err) } defer passengersFile.Close() // Create a dataframe from the C...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter07/auto_regressive/example4/myprogram.go
Chapter07/auto_regressive/example4/myprogram.go
package main import ( "log" "os" "strconv" "github.com/gonum/plot" "github.com/gonum/plot/plotter" "github.com/gonum/plot/plotutil" "github.com/gonum/plot/vg" "github.com/kniren/gota/dataframe" "github.com/sajari/regression" ) func main() { // Open the CSV file. passengersFile, err := os.Open("log_diff_s...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter07/representing_time_series/example2/myprogram.go
Chapter07/representing_time_series/example2/myprogram.go
package main import ( "image/color" "log" "os" "github.com/gonum/plot" "github.com/gonum/plot/plotter" "github.com/gonum/plot/vg" "github.com/kniren/gota/dataframe" ) func main() { // Open the CSV file. passengersFile, err := os.Open("AirPassengers.csv") if err != nil { log.Fatal(err) } defer passenge...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false
PacktPublishing/Machine-Learning-With-Go
https://github.com/PacktPublishing/Machine-Learning-With-Go/blob/8ce2d8a9e5880c3eda3dc012be6d016a04bdde69/Chapter07/representing_time_series/example1/myprogram.go
Chapter07/representing_time_series/example1/myprogram.go
package main import ( "fmt" "log" "os" "github.com/kniren/gota/dataframe" ) func main() { // Open the CSV file. passengersFile, err := os.Open("AirPassengers.csv") if err != nil { log.Fatal(err) } defer passengersFile.Close() // Create a dataframe from the CSV file. passengersDF := dataframe.ReadCSV(p...
go
MIT
8ce2d8a9e5880c3eda3dc012be6d016a04bdde69
2026-01-07T09:46:00.525197Z
false