Skip to content

Instantly share code, notes, and snippets.

View krunal3kapadiya's full-sized avatar
🎯
Focusing

Krunal Kapadiya krunal3kapadiya

🎯
Focusing
View GitHub Profile
@krunal3kapadiya
krunal3kapadiya / hello-world.py
Created December 17, 2016 18:56
Gist contains decision tree classifiers example.
from sklearn import tree
features=[[140,1],[130,1],[150,0],[170,0]]
labels=[0,0,1,1]
clf=tree.DecisionTreeClassifier()
clf=clf.fit(features,labels)
print clf.predict([[150,0]])
from sklearn import tree
#[[140g,Smooth],[130g,Smooth],[150g,Bumpy],[170g,Bumpy]]
features=[[140,1],[130,1],[150,0],[170,0]]
#[Apple,Apple,Orange,Orange]
labels=[0,0,1,1]
clf=tree.DecisionTreeClassifier()
clf=clf.fit(features,labels)
print clf.predict([[150,0]])
@krunal3kapadiya
krunal3kapadiya / build.gradle
Created January 27, 2017 11:21
hello to gradle
task hello {
description "Hey MADMeetup! Don't say I like your presentation, love it :D"
group "Mumbai Android Developers"
doLast {
println description
println group
println "Hello World!"
}
}
@krunal3kapadiya
krunal3kapadiya / MainActivity.java
Created May 4, 2017 11:55
Ask multiple runtime permissions
public class MainActivity extends AppCompatActivity {
private final int PERMISSION_REQUEST_CODE = 1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// list of permissions
from __future__ import print_function
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!') #Creating the constant op
sess = tf.Session() # Start tf session
print(sess.run(hello)) # Run the op
from __future__ import print_function
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
# Start tf session
sess = tf.Session()
# Run the op
print(sess.run(hello))
from __future__ import print_function
import tensorflow as tf
# Basic constant operations
a = tf.constant(2)
b = tf.constant(4)
# Launch the default graph.
with tf.Session() as sess:
print("a=2, b=4")