Source: www.kaggle.com/learn/intro-to-machine-learning Learn Intro to Machine Learning Tutorials Learn the core ideas in machine learning, and build your first models. www.kaggle.com Step 0: Setup # Code you have previously used to load data import pandas as pd from sklearn.tree import DecisionTreeRegressor # Path of the file to read iowa_file_path = '../input/home-data-for-ml-course/train.csv' ..
source:scikit-learn.org/stable/modules/tree.html#tree 1.10. Decision Trees — scikit-learn 0.24.0 documentation 1.10. Decision Trees Decision Trees (DTs) are a non-parametric supervised learning method used for classification and regression. The goal is to create a model that predicts the value of a target variable by learning simple decision rules inferred from the scikit-learn.org DesicionTreeR..
source : www.kaggle.com/learn/pandas Learn Pandas Tutorials Solve short hands-on challenges to perfect your data manipulation skills. www.kaggle.com www.kaggle.com/dansbecker/your-first-machine-learning-model Your First Machine Learning Model Explore and run machine learning code with Kaggle Notebooks | Using data from multiple data sources www.kaggle.com import pandas as pd file_path = '../inpu..
모든 코스는 여기서 확인할 수 있다. 문제 출처:www.kaggle.com/learn/python Learn Python Tutorials Learn the most important language for data science. www.kaggle.com Problem 3. Suppose we wanted to create a new type to represent hands in blackjack. One thing we might want to do with this type is overload the comparison operators like > and 21) 솔루션은 A의 갯수를 세는 것과 합을 구하는 것을 동시에 진행시켰다.
출처: tutorialspoint.com Matplotlib - Setting Ticks and Tick Labels - Tutorialspoint Matplotlib - Setting Ticks and Tick Labels Ticks are the markers denoting data points on axes. Matplotlib has so far - in all our previous examples - automatically taken over the task of spacing points on the axis.Matplotlib's default tick locators and for www.tutorialspoint.com Ticks are the markers denoting data..
Numpy 라이브러리에서는 Numpy Array에 한해, 특별한 overloading을 제공한다. 사칙연산 같은 간단한 연산에 사용할 수 있다. C/C++ 에서는 자료형이 다르면 당연히 연산이 불가능하다. // We cannot operate different types under C/C++ int myArray[4] = {1, 2, 3, 4}; int num = 100; // This is an error int newArray = myArray + num Python 에서도 마찬가지이다. 다른 종류의 자료형끼리는 연산이 안된다. myList = [1,2,3,4] num = 100 newList = myList + num # TypeError: can only concatenate list (not "..
1. type() 2. dir() 3. help() unknownObj type(unknownObj) # SomeType as numpy.ndarray, string, int print(dir(unknownObj)) # ['T', '__fun__', '__fun2__', ... , 'some'] # Print out all modules or functions of that object help(unknownObj) # print out all the information that help can reach on the screen
source : www.kaggle.com/learn/python Learn Python Tutorials Learn the most important language for data science. www.kaggle.com 6. Strings and Dictionaries , Exercise #3 A researcher has gathered thousands of news articles. But she wants to focus her attention on articles including a specific word. Complete the function below to help her filter her list of articles. Your function should meet the ..
List가 5의 배수를 하나라도 가지면 True를 리턴하고, 그렇지 않으면 False를 리턴한다. def multiple_of_five(nums): """Return True only when nums has a multiple of 5. """ for num in nums: if num % 5 == 0 and len(nums) != 0: return True List Comprehension으로 아래와 같이 단순화 할 수 있다. def multiple_of_five(nums): """Return True only when nums has a multiple of 5. """ return any([num % 5 == 0 for num in nums])