Skip to content

Instantly share code, notes, and snippets.

View johnnykfeng's full-sized avatar

John Feng johnnykfeng

View GitHub Profile
@johnnykfeng
johnnykfeng / Lesson1.md
Last active August 17, 2023 18:44
Lesson 1: Mastering OpenAI python library

Mastering the OpenAI Library in Python

Introduction

In today's fast-paced technological landscape, machine learning models are becoming increasingly sophisticated and accessible. Among the most prominent is the OpenAI library, designed to facilitate a wide array of natural language processing tasks. This blog post, inspired by John Feng's comprehensive guide, aims to provide an insight into the OpenAI library in Python.

How to Use the OpenAI Python Library

Getting Started

@johnnykfeng
johnnykfeng / docker_commands.md
Last active March 13, 2023 23:29
Making my own docker cheat sheet

For naming a container by finding it's image-name?

docker run --name <container-name> <image-name>

Any commands that need to specify container, we can use either container name or container id.

docker stop <container-name>

Print screen filter for specific container
docker ps -f "name=<container-name>"

from sklearn.preprocessing import StandardScaler
from sklearn.cluster import KMeans
scaler = StandardScaler()
kmeans = KMeans(n_clusters=3)
from sklearn.pipeline import make_pipeline
pipeline = make_pipeline(scaler, kmeans)
pipeline.fit(samples)
# organize the labels into DataFrame
df_labels = pd.DataFrame({'ML_labels': labels, 'varieties': wine['class_name']})