Skip to content

Instantly share code, notes, and snippets.

View codingnirvana's full-sized avatar

Rajesh Muppalla codingnirvana

View GitHub Profile
object scala {
val version = "SCALA_VERSION$"
}
val xml = <dependencies>
<dependency>
<groupId>org.scalanlp</groupId>
<artifactId>scalala_${scala.version}</artifactId>
<version>0.3.1</version>
</dependency>
@codingnirvana
codingnirvana / SampleClusterMember.Scala
Last active December 18, 2015 22:09
Akka Cluster Master/Member Impln.
object SampleClusterMember {
def main(args: Array[String]): Unit = {
val config = ConfigFactory.parseString("""
akka {
actor {
provider = "akka.cluster.ClusterActorRefProvider"
}
remote {
@codingnirvana
codingnirvana / Debug1.scala
Created January 23, 2015 11:20
Debugging Challenge #1
object Foo extends App{
val TAKE_COUNT = 5
def filterFirstFive(xs: List[Int]) = xs.take(TAKE_COUNT)
}
object FooSpec extends App {
assert(Foo.filterFirstFive(List(1,2,3,4,5,6)).size == 5)
}
@codingnirvana
codingnirvana / ubuntu_setup.sh
Last active October 23, 2017 06:35 — forked from tonyzhu/ubuntu_setup.sh
VS-Code + latest scala + slack + sublime text
# Ubuntu 16.04
# Forked from tonyzhu/ubuntu_setup.sh
#
# Requirements:
# sudo apt-get install curl -y
#
# Post install if you hadn't done so:
# 1. Install Dropbox Daemon
# Add all third party repositories
_ = require('underscore'),
requestLibrary = require('request');
module.exports = {
getProjectedQcuh : function(qcuh){
var today = new Date();
var dayOfMonth = today.getDate();
var daysInCurrentMonth = new Date(today.getFullYear(), today.getMonth()+1, 0).getDate();
return ((qcuh * 1.0)/dayOfMonth) * daysInCurrentMonth;

On the seasonablity example, we have currently only one model in production that is built using predictive modeling and that explicitly takes seasonality into account. Slide #10 mentions it - left column, item #4.

We use the following techniques to minimize the deterioration of models in production.

Amount of New data vs Data used to generate the training data

We use lambda architecture at Indix and our batch pipelines usually run every week. Lets assume we built a classifier model on Day 1. These pipelines use a prediction cache so that we can reuse the scoring output for already seen data. I did not mention this in my talk but for the deployment in batch mode, the prediction cache, we call it IB (information base) internally, is an artifact in addition to the model container. Now lets assume the batch pipelines runs on Day 1, Day 8, Day 15 etc. and the model and prediction cache being used is from Day 1. For every run we monitor the number of predictions that did not come from the cache. If that n

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@codingnirvana
codingnirvana / contracts...Streaming.sol
Last active July 14, 2021 06:19
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=builtin&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
@codingnirvana
codingnirvana / contracts...Streaming.sol
Created July 14, 2021 06:17
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=builtin&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
contract PiggyBank {
address child;
address owner;
uint maxWithdrawAmount;
constructor(address _child, uint _maxWithdrawAmount) {
owner = msg.sender;