思齊鍾

@phonchi

Joined on May 25, 2016

  • NumPy is the fundamental package for scientific computing with Python. Basics <a name="basics"></a> One of the most commonly used functions of NumPy are NumPy arrays: The essential difference between lists and NumPy arrays is functionality and speed. lists give you basic operation, but NumPy adds basic statistics, linear algebra, histograms, etc.</br> The most important difference for data science is the ability to do element-wise calculations with NumPy arrays. axis 0 always refers to row </br> axis 1 always refers to column Operator
     Like  Bookmark
  • Also refers to official cheatsheat here img21 Functional OOP plt.xlabel() ax.set_xlabel()
     Like  Bookmark
  • Object‑oriented programming organises code around classes (blueprints) and the objects built from them. Data lives in attributes, actions live in methods. Defining a Class and Making Instances class Dog: species = "Canis lupus" # one value shared by all dogs def __init__(self, name): # runs when a dog is created self.name = name # unique to each dog def speak(self):
     Like  Bookmark
  • Multiline Strings >>> print( ... """Dear Alice, ... ... Eve's cat has been arrested for catnapping, ... cat burglary, and extortion. ... ... Sincerely, ... Bob""" ... )
     Like  Bookmark
  • In Python, a dictionary is an ordered (from Python > 3.7) collection of key: value pairs. Dictionaries Set key, value using subscript operator [] >>> my_cat = { ... 'size': 'fat', ... 'color': 'gray', ... 'disposition': 'loud', ... } >>> my_cat['age_years'] = 2
     Like  Bookmark
  • Lists are one of the 4 data types in Python used to store collections of data. A short comparison of the containers is shown below: Feature List Tuple Dictionary Set Mutable (Can be modified in place) Yes
     Like  Bookmark
  • The file Reading/Writing process To read/write to a file in Python, you will want to use the with statement, which will close the file for you after you are done, managing the available resources for you. Opening and reading files The open function opens a file and return a corresponding file object. >>> with open('C:\\Users\\your_home_folder\\hi.txt') as hello_file: ... hello_content = hello_file.read() ...
     Like  Bookmark
  • Function arguments A function can take arguments and return values: In the following example, the function say_hello() receives the argument "name" and prints a greeting: >>> def say_hello(name): ... print('Hello', name) ... >>> say_hello('Carlos') # Hello Carlos
     Like  Bookmark
  • Variables You can name a variable anything as long as it obeys the following rules: It can be only one word. >>> # this wont work >>> my variable = 'Hello' >>> # good >>> var = 'Hello'
     Like  Bookmark
  • Comparison Operators Operator Meaning == Equal to != Not equal to
     Like  Bookmark
  • 1. Concept Explanation Example:Provide a brief description of an interpreted programming language. Usage:Utilize the LLM to elucidate high-level programming concepts, terminologies, and the roles of various components in a programming environment. This approach is ideal for establishing a clear conceptual foundation. 2. Syntax and Rules Explanation Example 1:Explain the rules for naming variables in Python. Example 2:Describe how comments are used in Python and provide common examples.
     Like  Bookmark
  • 1. 解釋概念 在 Unix 中 bash 是什麼? 2. 解說語法與規則 請說明Python變數的設定規則 請說明Python中escape character的用法和列出常見的例子 3. 程式除錯、解釋錯誤原因和修正
     Like  Bookmark
  • 解釋概念 在自然語言處理中"前處理"通常包含哪些步驟? 請說明在自然語言處理中"token"的意思。 解說語法與規則 請說明Python變數的設定規則 請說明Python中escape character的用法和列出常見的例子
     Like  Bookmark
  • Word 方程式建議用Word的方程式編輯器來呈現。 段落中程式碼建議採用專用字體(例如Consolas),整段程式碼建議用保留格式的方式貼上來避免直接截圖貼上(也可利用colab直接保留格式不過就沒有行號了)。 圖片的部分建議用另外存成jpg或pdf,dpi可以設高一點,再用插入的方式插入word。 承上,圖片建議編號並在內文中引用。 用字的部分盡量整份文件一致。 註或備註的部分建議採用footnote (註腳)的形式。 參考資料的部分建議可以直接以超連結文字的方式呈現來取代直接貼上網址。 其他可參考這裡。
     Like  Bookmark
  • Basic of sklearn Estimator: The core of scikit-learn's interface. Any object that can estimate some parameters based on a dataset is called an estimator. For example, an estimator might be a classifier or a regressor. The estimation itself is performed by the fit() method. Predictor: A type of estimator that, once trained, is able to make predictions on new, unseen data. Predictors implement a predict() method. Most classifiers and regressors in scikit-learn are predictors. Transformer: A type of estimator that can change or "transform" the data. A transformer might clean or preprocess the data in some way. It has a transform() method and often also a fit() method if the transformation needs to learn from the data (e.g., StandardScaler). Model: In scikit-learn, once an estimator (like a classifier or regressor) has been trained using the fit() method, it becomes a model. The score() method can then be used to evaluate how well the model performs on a given test dataset. Pipeline: A way to streamline a lot of the routine processes in machine learning. A Pipeline bundles together a sequence of data processing steps and modeling, where each step is represented by a tuple (name, transform/predict object). Each step in the pipeline must be a transformer, except for the last step which can be of any type (transformer, predictor). Term Definition Key Methods
     Like 1 Bookmark
  • ChatGPT 指令 ChatGPT 指令2 ChatGPT 萬能工具箱 ChatGPT 自動施法 ChatGPT 自動施法2 ChatGPT + 網路 Prompt perfect Aplications AutoGPT
     Like  Bookmark
  • SymPy Execute the following code to initialize the printing environment import sympy as sp sp.init_printing() 1. Using SymPy as a calculator The results can be either exact Or can be evaluate to arbitrary precsion using evalf() i = sp.Integer(24)
     Like  Bookmark
  • Q1: 如果y_train跟y_valid都已經進行Minmax的標準化了,則繪製邊界時如何修正成跟playground背景一樣有橘色和藍色有分界? A: 這部分不需要另外做調整沒關係,只要確認邊界的確有將兩類資料分開即可(也就是白色代表0藍色代表1)。 Q2: 繪圖時boundary_array xx 是只有兩個維度的,但如果NN model的input feature是設置4個會在畫decision boundary的時候出現錯誤,該如處理? A: 如果有對X_train和X_valid做feature engineering的話(例如像playground一樣產生平方項、交互項、sin函數),則可以把一樣的transform用在xx的每一筆資料(每一個座標點)上。例如以下是用 https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.PolynomialFeatures.html 和 https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.FunctionTransformer.html 把原來兩個座標feature轉換為playground的七個feature大致上的code: xx = Player.get_boundary_array() x1 = sin1.transform(xx[:,0]).reshape(-1, 1) #FunctionTransformer x2 = sin2.transform(xx[:,1]).reshape(-1, 1) #FunctionTransformer x3 = poly.transform(xx) # PolynomialFeatures
     Like  Bookmark
  • Create a GitHub account If you don't already have one, create a GitHub account. The GitHub account is free, so if you have not signed up yet, feel free to sign up, as it is a prerequisite before you can access the Student Developer Pack for Copilot. Verify your student status on GitHub Go to the GitHub Student Developer Pack and verify your student status on GitHub. Follow the instructions here. You can see why you get rejected by using the link. Be aware that some common reasons for rejection Try to use the academic email from our school when applying
     Like  Bookmark
  • Step by step Github student Verification Tutorial Tutorial 2
     Like  Bookmark