Skip to content

Instantly share code, notes, and snippets.

Aaditya Jamuar AadityaJ

View GitHub Profile
View blog1-symbol4.js
const _prop1 = Symbol('prop1');
class Test{
constructor(prop1, prop2){
this[_prop1] = prop1;
this.prop2 = prop2;
}
}
const obj = new Test(1,2);
for(keys in obj){
console.log(keys); //doesn print _prop1 property
View blog1-symbol3.js
Symbol.for('abc') === Symbol.for('abc'); //returns true
View blog1-symbol2.js
const symbolX = new Symbol('X'); // throws TypeError
@AadityaJ
AadityaJ / blog1-symbol1.js
Last active Feb 10, 2019
Blog1 - Symbol example 1
View blog1-symbol1.js
Symbol() == Symbol(); //returns false
Symbol('test') == Symbol('test'); //returns false
View apriori.cpp
#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <fstream>
#include <sstream>
#include <iterator>
#include <algorithm>
using namespace std;
View example.py
import numpy as np
from gensim import matutils
from gensim.models.ldamodel import LdaModel
from sklearn.datasets import fetch_20newsgroups
from sklearn.feature_extraction.text import CountVectorizer
from gensim.sklearn_integration.SklearnWrapperGensimLdaModel import SklearnWrapperLdaModel
## class to execute fit_predict. Will later on add to lda wrapper.
class dummy(SklearnWrapperLdaModel):
def fit_predict(self,X):
corpus=matutils.Sparse2Corpus(X)
@AadityaJ
AadityaJ / base.py
Created Oct 9, 2016
simple non-distributive lda wrapper for sklearn
View base.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
#
"""
scikit learn interface for gensim for easy use of gensim with scikit-learn
"""
import numpy as np
@AadityaJ
AadityaJ / base.py
Last active Oct 1, 2016
Provides basics for later scikit learn interface implementation. File structure : 1)base.py and __init__.py in gensim/gensim/sklearn_integration 2)test_sklearn_integration.py added to gensim/gensim/test
View base.py
"""
scikit learn interface for gensim for easy use of gensim with scikit-learn
"""
import numpy as np
class BaseClass(object):
def __init__(self):
"""init"""
def run(self):
@AadityaJ
AadityaJ / base.py
Created Oct 1, 2016
Provides basics for later scikit learn interface implementation. File structure
View base.py
"""
scikit learn interface for gensim for easy use of gensim with scikit-learn
"""
class BaseClass(object):
def __init__(self):
"""init"""
def run(self):
return 0
@AadityaJ
AadityaJ / base.py
Created Oct 1, 2016
Provides basics for later scikit learn interface implementation. File structure
View base.py
"""
scikit learn interface for gensim for easy use of gensim with scikit-learn
"""
class BaseClass(object):
def __init__(self):
"""init"""
def run(self):
return 0
You can’t perform that action at this time.