Snippets created by Faisal Waris

  • Heatmap Color Generating Function

    Function to generate color values to reflect the relative intensity of numeric values in a range. --- Fixed edge case of when max=min

    4 people like this

    Posted: 8 years ago by Faisal Waris

  • Twitter OAuth

    Generates the value string for the "Authorization:" header given Twitter application/user keys and tokens and the parameters for the request being authorized. Slightly updated to allow additional oauth parameters to be included in the header. This version handles the case when the token is not yet available, i.e. when you want to request a new token/token_secret pair.

    2 people like this

    Posted: 7 years ago by Faisal Waris

  • Bin Packing

    Implementation of the 'best fit' heuristic algorithm for bin packing problems. Incudes an implementation of 'binary tree with duplicates'. See this blog post for details: http://fwaris.wordpress.com/2013/04/01/best-fit-bin-packing/ Update: Bug fixes and added 'worst fit' heuristic implementation

    5 people like this

    Posted: 7 years ago by Faisal Waris

  • Simple Crypto

    Simple symmetric key cryptogrphy. Ok for low security usages.

    5 people like this

    Posted: 7 years ago by Faisal Waris

  • Minimum Spanning Tree

    An implementation of a minimum spanning tree calculation algorithm based on Kruskal's algorithm

    2 people like this

    Posted: 6 years ago by Faisal Waris

  • Verify Azure-ACS issued OAuth Simple Web Token

    Verifies the OAuth SWT (simple web token) issued by Azure ACS The SWT may be obtained by many methods; one way is: - "How to: Request a Token from ACS via the OAuth WRAP Protocol" (http://msdn.microsoft.com/en-us/library/windowsazure/hh674475.aspx) (Note I used the userid/password method to obtain the token on behalf of a 'service identity' set up in ACS) The token is normally verifed by a 'relying party' such as an ASP.Net website hosting a Web API General ACS documentation is here: http://msdn.microsoft.com/en-us/library/gg429788.aspx

    0 people like this

    Posted: 6 years ago by Faisal Waris

  • groupAdjacent

    A variation of another snippet "Seq.groupWhen". This one groups adjacent elements based on a predicate that accepts two arguments - the previous and current elements

    5 people like this

    Posted: 6 years ago by Faisal Waris

  • xorshift128plus PRNG that mimics System.Random

    Faster with much better quality random numbers than System.Random. See https://en.wikipedia.org/wiki/Xorshift

    0 people like this

    Posted: 3 years ago by Faisal Waris

  • Observable Agent

    Extension to Control.Observable module to create an Observable linked to a MailboxProcessor. Messages posted to the mailbox are published to subscribers. Requires a cancelation token which when cancelled sends OnComplete to subscribers. Only the Post method is exposed from the internally created MailboxProcessor.

    2 people like this

    Posted: 3 years ago by Faisal Waris

  • Live chart of CNTK Error Rate

    CNTK is Microsoft's deep learning toolkit. This snippets allows one to view the live error rate on a chart. It relies on FSharp.Charting and FSharp.Control.Reactive and a couple of other F# snippets the links for which are referenced in the code. Use 'track' function to start viewing live charts.

    1 people like this

    Posted: 3 years ago by Faisal Waris

  • Frequent Pattern Growth algorithm

    This is a commonly used algorithm for 'market basket' type analysis. It finds frequent itemsets from a series of transactions. Frequent itemsets are the item combinations that are frequently purchased together. See usage comment for example

    0 people like this

    Posted: 2 years ago by Faisal Waris

  • Sentiment Classification and Cross-Validation with ML.Net - Sample - Using Anonymous Records

    ML.Net sentiment classification and cross-validation example using Gradient Boosted trees Needs to be compiled in a dotnet core F# project. Uses F# 4.6 anonymous records which work well with the ML.Net API static api

    2 people like this

    Posted: 1 year ago by Faisal Waris

  • Csv Type Provider Schema Parser

    Parses the schema string format used by the CSV Type Provider from the FSharp.Data library ...because sometimes you need the metadata. Support for names with underscore

    5 people like this

    Posted: 1 year ago by Faisal Waris

  • Minimal AutoML Binary Classification Sample

    Shows how to use ML.Net AutoML capability for binary classification. Now with progress reporting

    2 people like this

    Posted: 1 year ago by Faisal Waris

  • Kernel Density estimation and visualization with MathNet.Numerics and FsPlotly

    Sample to estimate and visualize kernel densities of multiple distributions for visual comparison. Here the distributions of NY taxi fares are being compared by payment type (e.g. cash, credit card, etc.)

    2 people like this

    Posted: 10 months ago by Faisal Waris

  • Configure F# Interactive to use Microsoft.ML.Net

    Until FSI gets package references, we are to reference DLLs individually. This script sets up the FSI session to use ML.Net - assuming the required packages are loaded in the default location for the solution. Normally, referencing the latest AutoML and TimeSeries packages will net all the packages listed here.

    4 people like this

    Posted: 2 months ago by Faisal Waris