Skip to content

Instantly share code, notes, and snippets.

@hernamesbarbara
Created February 16, 2013 16:21
Show Gist options
  • Save hernamesbarbara/4967525 to your computer and use it in GitHub Desktop.
Save hernamesbarbara/4967525 to your computer and use it in GitHub Desktop.
from yhat import Yhat, BaseModel
from sklearn import datasets
from sklearn.svm import SVC
class IrisModel(yhat.BaseModel):
def transform(self, data):
data = [
data['SepalLength'],
data['SepalWidth'] / 2.0,
data['PetalLength'],
data['PetalWidth']^2
]
return data
def predict(self, transformedData):
return self.clf.predict(transformedData)
clf = SVC().fit(X_transformed, y)
yhat.upload(name="irisClassifier", model=IrisModel(clf=clf))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment