Disclaimer:
Educational Use Only:
The website links provided are to be used strictly for educational and knowledge-gaining purposes only.
No Misuse:
Do not misuse the links or the information contained therein for any commercial, illegal, or unethical activities.
Respect for Websites and Businesses:
Respect the intellectual property and business interests of the websites and their owners. Do not attempt to alter, copy, or redistribute content without proper authorization.
Acknowledge Value of Knowledge:
Recognize and value the knowledge and resources shared by these websites. Use the information responsibly and ethically.
No Endorsement:
The provision of these links does not imply endorsement of the linked sites, their content, or their products and services. Users are responsible for evaluating the suitability and accuracy of the information.
User Responsibility:
By accessing these links, you agree to use the information at your own risk and to comply with all applicable laws and website terms of use.
Overall MCQs for Reference
- Which of the following best defines Datename in feature engineering?
a. Extracting only the year component as a feature
b. Converting date data into string format for analysis
c. Creating new features by extracting components like month or weekday from datetime variables
d. Removing all time-related attributes from datasets
Answer: cfeature-engine.trainindata - What is the primary benefit of extracting date components as features in ML?
a. Increases model complexity unnecessarily
b. Provides features that capture seasonal or temporal patterns
c. Reduces dataset size
d. Obscures useful trends
Answer: bfeature-engine.trainindata - Which of these is NOT a common datetime feature extracted for ML models?
a. Day of week
b. Price
c. Month
d. Quarter
Answer: bfeature-engine.trainindata - Why do we encode months as numbers in ML instead of their names?
a. Model algorithms can only process numerics
b. String data increases computational time
c. Numeric encoding allows statistical relationships to be captured
d. Models ignore string fields by default
Answer: charrisonpim - Which method is widely used to encode cyclical date features like ‘month’?
a. One-hot encoding
b. Cyclical encoding (sine and cosine)
c. Label encoding
d. Text parsing
Answer: bharrisonpim - What is a typical use of datename feature extraction in time series analysis?
a. Predicting missing values
b. Adding context such as holidays or weekends
c. Removing outliers
d. Generating target variables
Answer: bfeature-engine.trainindata - What does the term “feature engineering” mean in the context of dates?
a. Storing date values as text
b. Describing time in long paragraphs
c. Creating new input variables based on date/time attributes
d. Dropping dates from the dataset
Answer: cfeature-engine.trainindata - In Python, which library provides a DatetimeFeatures transformer for extracting date features?
a. scikit-surprise
b. Keras
c. feature-engine
d. XGBoost
Answer: cfeature-engine.trainindata - A file contains the string ‘2021_12_25’. What challenge does machine learning face with such date strings?
a. Rule-based approaches can misinterpret format
b. Lack of data
c. Harder to parse numbers
d. Slow computation
Answer: adropbox - What is a limitation of treating an entire date as a single entity in ML?
a. Increased accuracy
b. Missing detailed relationship between components
c. Faster processing
d. Reduced need for preprocessing
Answer: bdropbox - Which function returns a specified part (like month or weekday) of a date as a string in SQL?
a. DATEPART
b. DATENAME
c. TO_CHAR
d. STRFTIME
Answer: bw3schools+1 - What data type does DATENAME() in SQL Server return?
a. Integer
b. Float
c. String (nvarchar)
d. Boolean
Answer: cgeeksforgeeks+1 - Which Datename interval would you use to extract the day of the year?
a. ‘mm’
b. ‘yy’
c. ‘dy’
d. ‘ss’
Answer: cw3schools+1 - What is a typical cyclical problem with representing months as numbers (1-12) in ML?
a. Models treat 1 and 12 as far apart
b. Too many categories
c. Cannot be normalized
d. Increases data size
Answer: aharrisonpim - In Feature Engineering, extracting “is_month_end” from dates provides insight into:
a. Start of year
b. Weekends only
c. The end of time periods
d. Time zones
Answer: cfeature-engine.trainindata - In ML preprocessing, why convert date fields to numerical or categorical features?
a. Models cannot process date objects directly
b. Increases text features
c. Removes all temporal data
d. All models natively handle dates
Answer: astackoverflow - Which approach is NOT commonly used for date encoding in ML?
a. Ordinal encoding
b. One-hot encoding
c. Bag-of-words
d. Cyclical encoding
Answer: charrisonpim - What is a potential risk of using the DATENAME SQL function directly for ML features?
a. Returns non-numeric values that may need further processing
b. Extremely fast
c. Always returns missing values
d. Has no effect
Answer: ageeksforgeeks+1 - The DATENAME function can return which of the following?
a. Month name
b. Numeric month
c. Only year
d. Only day
Answer: aw3schools+1 - A use case for extracting day-of-week as a feature in business analytics is:
a. Tracking product prices
b. Identifying weekend effects on sales
c. Mirroring the entire dataset
d. Encrypting data
Answer: bfeature-engine.trainindata - What do ML models lose if dates are only treated as categorical variables?
a. Temporal patterns and relationships
b. Memory efficiency
c. Computational speed
d. Data privacy
Answer: adropbox - Which is an advantage to breaking down date features into multiple variables?
a. Redundancy
b. Capturing more granular temporal patterns
c. Reduced interpretability
d. Slower training
Answer: bfeature-engine.trainindata - In SQL Server, DATENAME(‘weekday’, date) returns:
a. The hour
b. The day name (e.g., ‘Monday’)
c. The quarter
d. Year as integer
Answer: bgeeksforgeeks+1 - If a date is missing from your dataset, it may:
a. Bias time-related predictions
b. Auto-correct in ML
c. Be ignored without consequence
d. Never appear in analysis
Answer: atechtarget - How are features like ‘is_weekend’ usually engineered from date data?
a. Calculated using date’s weekday property
b. Mapped directly from price
c. Included in raw format
d. Predicted by model
Answer: afeature-engine.trainindata - Which of the following is a possible output of DATENAME for the interval ‘month’?
a. 2
b. February
c. 29
d. 2025
Answer: bw3schools+1 - What is the risk if date features are not preprocessed in ML?
a. Model may misinterpret or ignore them
b. Improved interpretability
c. Unchanged accuracy
d. Increased data security
Answer: astackoverflow - Which python method can extract ‘day of year’ from a datetime variable?
a. .dayofyear
b. .month_name
c. .weekday_str
d. .random_day
Answer: afeature-engine.trainindata - What does “granularity” refer to, with date features?
a. Feature’s ability to conceal patterns
b. The level of detail (e.g., year, month, day, hour)
c. The numerical order of encoding
d. Model accuracy
Answer: bdropbox - Why might dates be encoded as sine and cosine values?
a. Preserve cyclical relationships (e.g., months, hours)
b. Randomization
c. Resolve data imbalance
d. Standardize outliers
Answer: aharrisonpim - Which of these features improves customer segmentation in data mining?
a. Date in original format
b. Extracted season or quarter from dates
c. Random integers
d. None of the above
Answer: bvationventures - Which is a typical data type for date extracted features in ML?
a. Date
b. Float
c. String or integer
d. Boolean
Answer: cfeature-engine.trainindata - If ‘DATENAME(year, date)’ returns ‘2025’, what would ‘DATEPART(year, date)’ return?
a. ‘2025’ (as string)
b. 2025 (as integer)
c. Name of month
d. Boolean
Answer: bc-sharpcorner - Which method is NOT used for extracting named attributes from date fields?
a. DATENAME()
b. strftime()
c. parse_date()
d. COUNT()
Answer: dgeeksforgeeks+1 - When extracting features from dates, ‘is_month_start’ would return:
a. True for first calendar day of month, False otherwise
b. Only year
c. Random value
d. Always integer
Answer: afeature-engine.trainindata - In business analytics, what insight can ‘quarter’ as a feature provide?
a. Number of salesmen
b. Seasonal trends or cycles in business
c. Country of product
d. Customer age
Answer: bvationventures - Difference between DATENAME and DATEPART in SQL in terms of output:
a. Both return integers
b. DATENAME returns string, DATEPART integer
c. Both return strings
d. DATENAME is faster
Answer: bc-sharpcorner - A correct sample code to extract month name from a timestamp in SQL Server is:
a. DATENAME(month, mydate)
b. DATEPART(month_name, mydate)
c. GETMONTHNAME(mydate)
d. SELECT_MONTH(mydate)
Answer: aw3schools+1 - When is feature extraction from date/time most beneficial in ML?
a. On temporal datasets
b. On image datasets
c. On categorical only datasets
d. Never
Answer: aharrisonpim+1 - What is one limitation with DATENAME() in SQL regarding time?
a. Cannot extract time-based features
b. Returns results only in uppercase
c. Accepts invalid dates
d. Can only extract minutes
Answer: aintersystems+1 - Which ML task benefits from using “day_name” as a feature?
a. Classification of time-dependent events
b. Regression only
c. Clustering colors
d. None
Answer: adropbox+1 - In Python, “pandas” provides which method for extracting parts of a datetime column?
a. .str
b. .dt
c. .parse
d. .match
Answer: bfeature-engine.trainindata - What is the default datatype of extracted day or month name features in SQL?
a. Integer
b. Boolean
c. String (nvarchar/varchar)
d. Float
Answer: cgeeksforgeeks+1 - Which is NOT a valid interval value for DATENAME in SQL?
a. millisecond
b. quarter
c. price
d. day
Answer: cw3schools+1 - How can weekend information improve ML models in sales forecasting?
a. Highlights expected spikes or drops in demand
b. Obscures trends
c. Has no effect
d. Always lowers accuracy
Answer: avationventures+1 - What is the result of DATENAME(weekday, ‘2025-10-31’) in SQL Server?
a. ‘Friday’
b. 5
c. 10
d. ‘October’
Answer: ageeksforgeeks+1 - Which type of machine learning models use datename features?
a. Only deep learning
b. Only clustering
c. Any model that benefits from time-based patterns
d. Only image classifiers
Answer: cfeature-engine.trainindata - Encoding day-of-year as a feature is useful for:
a. Detecting annual patterns
b. Sorting alphabetically
c. Security
d. Text translation
Answer: afeature-engine.trainindata - An invalid date format passed to DATENAME results in:
a. Null string
b. Zero
c. Default date
d. Exception always
Answer: aintersystems - What is the key advantage of dropping the original datetime variable after extracting features?
a. Prevents model redundancy
b. Hides information
c. Increases processing time
d. No impact
Answer: afeature-engine.trainindata
- https://feature-engine.trainindata.com/en/1.8.x/user_guide/datetime/DatetimeFeatures.html
- https://harrisonpim.com/blog/the-best-way-to-encode-dates-times-and-other-cyclical-features
- https://dropbox.tech/machine-learning/using-ml-to-identify-date-formats-in-file-names
- https://www.w3schools.com/sql/func_sqlserver_datename.asp
- https://www.geeksforgeeks.org/sql/datename-function-in-sql-server/
- https://stackoverflow.com/questions/46428870/how-to-handle-date-variable-in-machine-learning-data-pre-processing
- https://www.techtarget.com/searchenterpriseai/feature/Machine-learning-limitations-marked-by-data-demands
- https://www.vationventures.com/glossary/data-mining-definition-explanation-and-use-cases
- https://www.c-sharpcorner.com/blogs/difference-between-datename-and-datepart-in-sql-server1
- https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=RSQL_datename
- https://learn.microsoft.com/en-us/sql/t-sql/functions/datename-transact-sql?view=sql-server-ver17
- https://www.tutorialspoint.com/sql/sql-date-functions-datename.htm
- https://netsmartz.com/blog/top-data-mining-applications/
- https://developer.nvidia.com/blog/three-approaches-to-encoding-time-information-as-features-for-ml-models/
- https://www.tlvtech.io/post/features-of-machine-learning-explained-d5c34
- https://intglobal.com/blogs/5-major-limitations-of-machine-learning/
- https://www.projectpro.io/recipes/does-datename-function-work-tableau
- https://apiumhub.com/tech-blog-barcelona/data-mining-use-cases/
- https://magnimindacademy.com/blog/7-characteristics-of-machine-learning/
- https://www.geeksforgeeks.org/sql/how-to-find-day-name-from-date-in-sql-server/