{"id":37128557,"url":"https://github.com/haydenhigg/percy","last_synced_at":"2026-01-14T14:57:50.476Z","repository":{"id":57619403,"uuid":"333829338","full_name":"haydenhigg/percy","owner":"haydenhigg","description":"Quick, straightforward, and easy-to-use Go implementations of the Perceptron and Averaged Perceptron binary classifiers.","archived":false,"fork":false,"pushed_at":"2021-07-25T03:01:52.000Z","size":77,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-20T03:48:31.043Z","etag":null,"topics":["binary-classification","classifier","go","golang","machine-learning","perceptron","weights-and-biases"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/haydenhigg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-28T17:13:02.000Z","updated_at":"2024-06-20T03:48:31.043Z","dependencies_parsed_at":"2022-09-02T14:02:02.912Z","dependency_job_id":null,"html_url":"https://github.com/haydenhigg/percy","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/haydenhigg/percy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haydenhigg%2Fpercy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haydenhigg%2Fpercy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haydenhigg%2Fpercy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haydenhigg%2Fpercy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haydenhigg","download_url":"https://codeload.github.com/haydenhigg/percy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haydenhigg%2Fpercy/sbom","scorecard":{"id":458112,"data":{"date":"2025-08-11","repo":{"name":"github.com/haydenhigg/percy","commit":"2378d7be438c1dd5d2e01e35ee949f749bc702e9"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-19T10:17:49.196Z","repository_id":57619403,"created_at":"2025-08-19T10:17:49.196Z","updated_at":"2025-08-19T10:17:49.196Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28424028,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T13:30:50.153Z","status":"ssl_error","status_checked_at":"2026-01-14T13:29:08.907Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["binary-classification","classifier","go","golang","machine-learning","perceptron","weights-and-biases"],"created_at":"2026-01-14T14:57:49.769Z","updated_at":"2026-01-14T14:57:50.464Z","avatar_url":"https://github.com/haydenhigg.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# percy\n\nQuick, straightforward, and easy-to-use Go implementations of the Perceptron and Averaged Perceptron binary classifiers.\n\n## install\n\nWhile in your project directory:\n`$ git clone https://github.com/haydenhigg/percy`\n\nThen, import it as:\n```go\nimport \"./percy\"\n```\n\n## use\n\n- `Regularize(arr []float64) []float64`: Regularizes the L2 norm of `arr` to 1.\n- `RegularizeAll(mat [][]float64) [][]float64`: Regularizes the L2 norm of every row of `mat` to 1.\n---\n- `NewModel(weights []float64, bias float64) Model`: Creates a model with input `weights` and an input `bias`.\n---\n- `Train(inputs [][]float64, outputs []float64, iters int, alpha float64) Model`: Trains a Perceptron classifier on the training `inputs` matrix and `outputs` vector for `iters` iterations with a learning rate of `alpha`. Returns the final model (see below).\n- `TrainFromModel(init Model, inputs [][]float64, outputs []float64, iters int, alpha float64) Model`: The same as `Train`, but initializes the model to `init` rather than a model with weights as a zero-vector and a bias of zero.\n- `TrainAveraged(inputs [][]float64, outputs []float64, iters int, alpha float64) Model`: The same as `Train`, but trains an Averaged Perceptron classifier instead.\n- `TrainAveragedFromModel(init Model, inputs [][]float64, outputs []float64, iters int, alpha float64) Model`: The same as `TrainFromWeights`, but trains an Averaged Perceptron classifier instead.\n---\n- `(mdl Model) Predict(x []float64) float64`: Returns the predicted output (which will be {-1, 1}) for the model `mdl` and the input vector `x`.\n- `(mdl Model) RawPredict(x []float64) float64`: Returns the output before being binarized to {-1, 1}.\n\n### Model\n\nThe `Model` is just a struct containing the fields `Weights` ([]float64) and `Bias` (float64).\n\n### example\n\n```go\npackage main\n\nimport (\n  \"fmt\"\n  \"./percy\"\n)\n\nfunc main() {\n  inputs := [][]float64{[]float64{...}, []float64{...}, ...}\n  outputs := []float64{1, -1, ...}\n  \n  iters := 200\n  learningRate := 0.01\n  \n  trainedModel := percy.Train(percy.RegularizeAll(inputs), outputs, iters, learningRate)\n  \n  fmt.Println(trainedModel.Predict(percy.Regularize([]float64{...})))\n}\n```\n\n## notes\n\n- Assumptions are not checked by this implementation. For example, if each vector of the `inputs` matrix does not have the same length, this will fail; if `inputs` and `outputs` are different lengths, this will fail; if `learningRate` is a negative number, the algorithm will not converge; etc.\n- Though not necessary, it may be helpful to\n  - shuffle the data before training, especially when using the standard Perceptron\n  - regularize the norms of all training inputs and of all inputs to be predicted (see `Regularize` and `RegularizeAll`)\n  - initialize weights to small random values rather than 0s\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaydenhigg%2Fpercy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaydenhigg%2Fpercy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaydenhigg%2Fpercy/lists"}