category
stringclasses
107 values
title
stringlengths
15
179
question_link
stringlengths
59
147
question_body
stringlengths
53
33.8k
answer_html
stringlengths
0
28.8k
__index_level_0__
int64
0
1.58k
spectroscopy
What are some incapabilities that the early spectroscopy have when compared to the more modern method?
https://chemistry.stackexchange.com/questions/11039/what-are-some-incapabilities-that-the-early-spectroscopy-have-when-compared-to-t
<p>What are some incapabilities that the earlier spectroscopy (Visible, Ultraviolet and Infra-red) have when compared to the more modern method?</p>
<p>Some of the things that come to mind are:</p> <ul> <li><strong>Resolution</strong> Modern equipment has much higher resolution than older equipment. Optical component surface smoothness and uniformity, optical component alignment and electrical component stability all permit the user to see more detail and fine s...
462
spectroscopy
Why does the absorbance of Ca decrease in the presence of certain metals?
https://chemistry.stackexchange.com/questions/16327/why-does-the-absorbance-of-ca-decrease-in-the-presence-of-certain-metals
<p>I'm trying to find a reason for an experimental observation, I noticed that when the absorbance of $\ce{Ca}$ is measured with FAS(flame atomic spectroscopy) that it decreases when metals such as $\ce{Al}$ and $\ce{K}$ is present(the ions). I used a $\ce{Ca}$ hallow cathode lamp. </p> <p>Any idea as to why? </p>
<p>Well whatever metal you add will interfere in the absorbance of Ca, because the metal will absorb some of the light too, that's why that of the Ca decreases and thats why the analyte is almost every time mixed only with water which does not absorb the light.( and ofcourse you can add a reagent to form the complex wh...
463
spectroscopy
Assign symmetric and antisymmetric stetches in IR spectroscopy
https://chemistry.stackexchange.com/questions/19562/assign-symmetric-and-antisymmetric-stetches-in-ir-spectroscopy
<p>Typically the antisymmetric stretch in IR spectroscopy is higher than the symmetric stretch for a given functional group. For example for $\ce{NO2}$ the antisymmetric stretch falls at $\sim 1530\ \mathrm{cm^{-1}}$ compared to $1350\ \mathrm{cm^{-1}}$ for the symmetric stretch. Likewise $\ce{NH2}$ has a similar patte...
464
spectroscopy
Wavelength of iPhone 4S camera light for visible spectroscopy calibration
https://chemistry.stackexchange.com/questions/24969/wavelength-of-iphone-4s-camera-light-for-visible-spectroscopy-calibration
<p>I ordered a DIY spectroscopy kit from public-lab, however don't have access to a halogen lamp to calibrate the wavelengths.</p> <p>I'm wondering if it would somehow be possible to calibrate the wavelength using the iPhone camera light?</p>
<p>According to the <a href="http://publiclab.org/wiki/spectral-workbench-calibration" rel="nofollow">site</a>, wavelength calibration is meant to be done with a compact fluorescent lamp (for the mercury lines), but at the bottom there's a tool for calibrating using any two known wavelengths. If the LED on the phone ha...
465
spectroscopy
difference between absorption spectroscopy and extinction spectroscopy
https://chemistry.stackexchange.com/questions/33187/difference-between-absorption-spectroscopy-and-extinction-spectroscopy
<p>can anyone tell me the difference between absorption spectroscopy and extinction spectroscopy in terms of experiment? and how to get extinction spectroscopy, how to get absorption spectroscopy? Thank you so much.</p>
<p>There should not be any difference in experiment, because the extinction is something you have to calculate by measuring the transmittance/absorbance of a given frequency.</p> <p>The transmittance $T$ of a material is the ratio between the received intensity of a certain frequency to the transmitted intensity of th...
466
spectroscopy
Observe from IR/Raman spectra whether molecule is in a local minimum on PES
https://chemistry.stackexchange.com/questions/40481/observe-from-ir-raman-spectra-whether-molecule-is-in-a-local-minimum-on-pes
<p>I have done a geometry optimization of <em>cis</em> and <em>trans</em>-difluoroethene using RHF/STO-3G in Gaussian03. Although this is a simple method and a small basis set, this should ideally put place the molecule in a minimum on its potential energy curve. Within this minimum are vibrational states. I am wonderi...
467
spectroscopy
Why absorption/transmission spectroscopic data is normalized?
https://chemistry.stackexchange.com/questions/42441/why-absorption-transmission-spectroscopic-data-is-normalized
<p>A typical data processing step for acquired absorption/transmission data is normalizing, i.e. stretching the curve such that it is bounded between 0 and 100%.</p> <p>However, the absorption/transmission curve changes with the density and thickness of the sample. Moreover, absorption is a non linear phenomena (for e...
<p>There is confusion here about absorption at one wavelength and the absorption spectrum. At <em>each</em> wavelength the Beer-Lamber law applies $$I_{trans_{\lambda}}=I_{0_{\lambda}}\exp(-\epsilon_{\lambda} c l)$$ for a compound with extinction coefficient $\epsilon$ at wavelength $\lambda$ and concentration <em>c</e...
468
spectroscopy
How to calculate spectral overlap integral using spreadsheets?
https://chemistry.stackexchange.com/questions/44376/how-to-calculate-spectral-overlap-integral-using-spreadsheets
<p>I need to calculate the spectral overlap integral for the emission spectrum of coumarin 334 and the absorption spectrum for rhodamine, using spreadsheets (MS Excel).</p> <p>Following the theory of Fluorescence Resonance Energy Transfer (Förster), I have the definition of the spectral overlap integral:</p> <p><span...
469
spectroscopy
Proportionality between number of absorbed photons and optical density
https://chemistry.stackexchange.com/questions/44666/proportionality-between-number-of-absorbed-photons-and-optical-density
<p>I am to show that the number of absorbed photons only is proportional to the optical density at <em>low optical densities.</em></p> <p>I do not know how to do this, but this reminds me of the linear range of absorbance vs concentration; at high concentrations, the relationships is no longer linear. I also feel that...
<p>Yes, your statement that "the number of absorbed photons only is proportional to the optical density at low optical densities" is correct. (I'll point out that optical density is a depreciated term for what is now referred to as absorbance.) </p> <p>First let's define some terms.</p> <blockquote> <p>T: Trans...
470
spectroscopy
Auger emission probability?
https://chemistry.stackexchange.com/questions/46529/auger-emission-probability
<p>Why is it that lighter atoms are more likely to produce Auger emission and the heavier atoms fluorescence in x-ray spectroscopy? It doesn't make any sense. Lighter atoms should try to resist double ionization, plus there are fewer electrons around which means there is a lesser chance of a photon hitting an electron....
471
spectroscopy
EPR spectrum of a singlet-triplet mixture
https://chemistry.stackexchange.com/questions/46572/epr-spectrum-of-a-singlet-triplet-mixture
<p>Through EPR measurements it is possible to gain information about the spin states of molecules. So a singlet state will give no signal/only noise and a molecule with unpaired electrons will result in an EPR spectrum.</p> <p>What happens if a measured sample would contain a mixture of singlet and triplet state molec...
472
spectroscopy
Changing the spectroscopy type to infrared in GC-MS
https://chemistry.stackexchange.com/questions/48022/changing-the-spectroscopy-type-to-infrared-in-gc-ms
<p>I know you can use GC-MS for the analysis of gaseous molecules, but would you be able to instead use an infrared spectroscopy method to analyse gaseous molecules, or does it need to be mass spectroscopy?</p>
<p>GC-MS is just one common method of what is known as '<a href="https://en.wikipedia.org/wiki/Instrumental_chemistry#Hybrid_techniques" rel="nofollow">hyphenated</a>' analysis. GC-IR instruments do exist (<a href="https://www.bruker.com/products/infrared-near-infrared-and-raman-spectroscopy/ft-ir/ft-ir-accessories/gc-...
473
spectroscopy
What is the region of this wavelength (462&#160;nm)?
https://chemistry.stackexchange.com/questions/58403/what-is-the-region-of-this-wavelength-462-nm
<p>My lecturer said 462 nm is infrared region. I think the wavelength is visible light. Which region is the correct one? I need confirmation about this one.</p>
<p><a href="https://i.sstatic.net/ibV3r.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/ibV3r.png" alt="enter image description here"></a></p> <p>Light with a wavelength of 462nm is in the visible light region (blue light visible by the human eye). </p> <p>For certain, your lecturer was wrong that the ...
474
spectroscopy
How to draw a photoelectron spectrum with ionization energies?
https://chemistry.stackexchange.com/questions/60423/how-to-draw-a-photoelectron-spectrum-with-ionization-energies
<p>I understand the basic concepts of the photoelectron spectrum. However, say I am instructed to draw the PES graph for Silicon. I know how to figure out the relative peaks based on its configuration. But when arranging them on the graph, how can I accurately place them where they should be in ionization energy? That ...
475
spectroscopy
Absorption Spectrum and Re-emission of Photon
https://chemistry.stackexchange.com/questions/187283/absorption-spectrum-and-re-emission-of-photon
<p>I am trying to get some bearing on spectroscopy basic concepts using self-study.</p> <p>In the absorption spectrum, if I shine light on a particular liquid of a single type of molecule it absorbs a specific frequency in the visible range. Now where I am struggling is once an electron absorbs a photon of a particular...
<p>There is no remission of a photon after absorption in the majority of cases, especially in solutions and solids. The idea that the absorption of light is observed because the re-emitted photon travels in a random direction and does not reach the detector is incorrect</p> <p>First, recall the fundamental property of ...
476
spectroscopy
Why do different metal ions release different colors of light?
https://chemistry.stackexchange.com/questions/62450/why-do-different-metal-ions-release-different-colors-of-light
<p>For example, potassium chloride released a purple colored flame? Does it have to do with the energy level of the valence electrons in the metal cation that is being burned?</p>
<p>You are right, it depends on the energy level of valance electrons, but more precisely it depends on the difference between the highest occupied and lowest unoccupied levels' energies. If the energy difference is $\Delta E$ then the light emitted by the excited atom has a frequency $\nu = \frac{\Delta E}{h}$ so a wa...
477
spectroscopy
Rotational-vibrational spectroscopy of a molecule
https://chemistry.stackexchange.com/questions/65016/rotational-vibrational-spectroscopy-of-a-molecule
<p>I want to ask if the rotational-vibrational spectra of a molecule is related to any one mode of frequency or if it is related to the whole molecule?</p> <p>Additionally, the vibrational levels that we say are composed of lower rotational energy levels. Are these vibrational energy levels of certain vibrational norm...
<p>I'm not quite sure what you mean by 'vibrational levels composed of lower rotational energy levels' so I try to explain the whole thing, briefly.</p> <p>In analysing the electronic, vibrational &amp; rotational spectra of molecules the Born-Oppenheimer approximation has to be used. This is applicable because the vi...
478
spectroscopy
How are hydrogen atoms formed in hydrogen discharge tube?
https://chemistry.stackexchange.com/questions/69326/how-are-hydrogen-atoms-formed-in-hydrogen-discharge-tube
<p>I (partially) understand how a breakdown voltage is applied, then the gas is ionized to cations and electrons. Then the electrons will accelerate to the cathode and knock off more electrons from other H2, creating a current ( which is the flow of electrons ). The electrons might excite the gas and the gas emit light...
479
spectroscopy
Why convert benzoate in soda to benzoic acid for spectroscopy experiment?
https://chemistry.stackexchange.com/questions/71722/why-convert-benzoate-in-soda-to-benzoic-acid-for-spectroscopy-experiment
<p>I did an experiment where I analyzed the amount of caffeine and benzoate in soda via spectroscopy. I've got the absorbances and did all the math for everything, but I'm having a hard time figuring out why we had to add an acid to protonate the benzoate to form benzoic acid before running the spec.</p> <p>I've been ...
<p>Your assumption is correct, the addition of HCl, as already in the earlier publication by McDevitt (J. Chem. Educ., 1998, 75, 625-629 <a href="http://pubs.acs.org/doi/abs/10.1021/ed075p625?journalCode=jceda8&amp;quickLinkVolume=75&amp;quickLinkPage=625&amp;selectedTab=citation&amp;volume=75" rel="noreferrer">DOI: 10...
480
spectroscopy
Gas spectra in the 400 nm - 1000 nm range
https://chemistry.stackexchange.com/questions/71904/gas-spectra-in-the-400-nm-1000-nm-range
<p>Disclaimer: My background is computer science.</p> <p>Is it possible to detect any gas using a visible light and near infrared (400 nm - 1000 nm) <a href="https://en.wikipedia.org/wiki/Hyperspectral_imaging" rel="nofollow noreferrer">hyper spectral imaging</a> camera? This can be related to gas leaks, pollution, ga...
<p>The answer is that you can detect all types of gases if you have the correct light source and use Raman spectroscopy. Raman is more adaptable than absorption or emission spectroscopy as it is a scattering process and the laser does not have to operate at the wavelengths that the molecules absorb, thus one laser can ...
481
spectroscopy
How to measure absorbance at 882 nm?
https://chemistry.stackexchange.com/questions/72541/how-to-measure-absorbance-at-882-nm
<p>I am trying to measure the absorbance of a solution at 882 nm, but this seems to be beyond the range of many UV-Vis spectrometers. Is this a job for the IR spectroscopy, or something else? I do not have much experience with IR spectroscopy.</p>
<p>No this is not a job for an IR machine. It all depends on the machine you are using, but provided the monochromators will extend that far all that may be necessary is to change the detector for one that is more red sensitive. If your machine will not do the job, and if its a one-off type of measurement try to get t...
482
spectroscopy
The best method(s) to identify/verify the presence of a small organic molecule
https://chemistry.stackexchange.com/questions/73340/the-best-methods-to-identify-verify-the-presence-of-a-small-organic-molecule
<p>What is the fastest or the most definite method (preferentially a single unexpensive method) for verifying the presence of a certain small orgnic molecule which is expected to be of >90% purity in a "powdry" sample (known solvent is also availble)? </p> <p>Thank you in advance</p>
483
spectroscopy
Spectroscopic transition frequency
https://chemistry.stackexchange.com/questions/73481/spectroscopic-transition-frequency
<p>I have difficulty understanding the first sentence of the Introduction in the paper linked below. Can someone explain to me what is spectroscopic transition frequency and thermal bath? </p> <blockquote> <p>The question addressed here is how the modulation of the spectroscopic transition frequency Ω(t) by fluctua...
<p>In an isolated molecule /atom the intrinsic width of the transition is limited by the lifetime of the upper level and this can be huge ( seconds) and so the line-width can be minuscule by time-energy 'uncertainty'. If the decay is exponential the spectral line shape is Lorentzian by Fourier Transform theory. </p> ...
484
spectroscopy
Why is the number of carbonyl stretches in the IR spectrum different for solid state samples compared to samples in solution?
https://chemistry.stackexchange.com/questions/74734/why-is-the-number-of-carbonyl-stretches-in-the-ir-spectrum-different-for-solid-s
<p>I am comparing two IR spectrums of the same molecule, one in the solid state and one in $\ce{CH2Cl2}$ solution. There is only one CO group in the molecule.</p> <p>Why does the solid state spectrum show two carbonyl stretches, while the solution spectrum has only one carbonyl stretch?</p>
485
spectroscopy
What is the difference between an electron in ground state and an electron in excited state?
https://chemistry.stackexchange.com/questions/80481/what-is-the-difference-between-an-electron-in-ground-state-and-an-electron-in-ex
<p>What is the differnce between a ground state electron and an excited state electron? Upon excitation what exactly changes about the electron?</p>
<p>You can think of electron states as book shelves and electron as a book. Is there anything different about that book if it stands on lower or upper shell? Not really. Same is with electron in different states. </p> <p>I guess what made you think otherwise is the fact that electron in lower electronic states has a l...
486
spectroscopy
Are we using an assumption in calculating the ratio of first state excited to unexcited chemical species using the Boltmann distribution?
https://chemistry.stackexchange.com/questions/104142/are-we-using-an-assumption-in-calculating-the-ratio-of-first-state-excited-to-un
<p>In calculating the ratio of first state excited to unexcited chemical species using the Boltzmann distribution, are we assuming that we only have species in the unexcited and first state excited states? It seems to me that this must be the case, because there's no part of the equation that accounts for the populatio...
<p>The expression for the Boltzmann equation is:</p> <p><span class="math-container">$\eta_{i} = \dfrac{g_{i} \exp \left( \dfrac{-\epsilon_{i}}{k_{b}T} \right)}{\sum_{i} g_{i} \exp \left( \dfrac{-\epsilon_{i}}{k_{b}T} \right)}$</span>,</p> <p>wherein <span class="math-container">$\eta_{i}$</span> the probability is t...
487
spectroscopy
Is a time domain spectrum obtainable from a frequency domain spectrum?
https://chemistry.stackexchange.com/questions/104144/is-a-time-domain-spectrum-obtainable-from-a-frequency-domain-spectrum
<p>I know for a fact that a frequency domain spectrum can be obtained from a time domain spectrum using a Fourier transform - but can you do the reverse?</p> <p>Also what are the advantages and disadvantages of the frequency and time domain spectra?</p>
<blockquote> <p>Can you do the reverse?</p> </blockquote> <p>Yes, mathematically the Fourier transform can be reversed. If we define the spectrum <span class="math-container">$S(\omega)$</span> as the Fourier transform of a time-domain signal <span class="math-container">$f(t)$</span>, </p> <p><span class="math-con...
488
spectroscopy
Are the molar extinction coefficient and cross-section of an absorption related to the probability of absorption?
https://chemistry.stackexchange.com/questions/104464/are-the-molar-extinction-coefficient-and-cross-section-of-an-absorption-related
<p>I have struggled to find a formal definition of cross-section of absorption; from what I've gathered, its best defined as 'the intensity of absorption'.</p> <p>Wikipedia's formal definition of the molar extinction coefficient is 'how strongly a species absorbs EMR at a given wavelength, per molar concentration'.</p...
489
spectroscopy
Molar extinction coefficient a measure of the probability of a photon of the associated wavelength being absorbed?
https://chemistry.stackexchange.com/questions/104500/molar-extinction-coefficient-a-measure-of-the-probability-of-a-photon-of-the-ass
<p>Obviously the molar extinction coefficient is not equal to the probability of a photon of the associated wavelength being absorbed, but is it a measure of the probability i.e. the higher the value of the molar extinction coefficient, the higher the probability of absorption of the photon per molecule?</p>
490
spectroscopy
Binding energy question
https://chemistry.stackexchange.com/questions/114386/binding-energy-question
<p>The electrons in the 1s orbital of chlorine have a binding energy of 273 MJ/mol, but the 1s electrons in sulfur have a binding energy of 239 MJ/mol. Why is this?</p>
<p>Chlorine has 17 protons and Sulfur has 16. In the 1s orbital there is no ineer electron to provide shielding effect of repulsion. So greater the positive charge, greater is the attraction and better is the binding.</p>
491
spectroscopy
Size of target substance in IR and Raman Spectroscopy
https://chemistry.stackexchange.com/questions/122469/size-of-target-substance-in-ir-and-raman-spectroscopy
<p>Usually what is the size (in nanometer) of the sample or target substance in IR and Raman Spectroscopy?</p> <p>Which one has largest size of sample it can scan, how many molecules or atoms are involved? If you can make the size bigger or scan coverage bigger, then the more intense would be the IR or Raman stroke si...
<p>This all depends on the exact geometry of your spectrometer light path, if you measure in transmission or reflection, using ATR, etc. AND of course on your sample concentration.</p> <p>If you want to ask about the <em>minimal size</em>: As small as you can get your focal point or laser spot. A few dozen microns, ma...
492
spectroscopy
Does Mie Scattering occur in Liquid or is Rayleigh scattering?
https://chemistry.stackexchange.com/questions/123077/does-mie-scattering-occur-in-liquid-or-is-rayleigh-scattering
<p>Rayleigh scattering occurs when the dimensions of the scatter is much smaller than the wavelength of the incident electromagnetic radiation. </p> <p>Mie scattering occurs when the dimensions of the scattered is much larger than the wavelength of the incident electromagnetic radiation. An example is when light is sc...
<blockquote> <p>So does Rayleigh or Mie scattering occur in liquid or bulk water? So why does Rayleigh scattering (?) occur in liquid/bulk water when the particles are much larger than the wavelength of light?</p> </blockquote> <p>What is the approximate size of water molecule? It is on the order of 2.7 Angstroms or...
493
spectroscopy
Prepare solution of salt in ethanol
https://chemistry.stackexchange.com/questions/150124/prepare-solution-of-salt-in-ethanol
<p>The test for anions can be done with a platinum wire and a Bunsen flame.</p> <p>My textbook says that it can also be done by preparing a solution of the given salt in water and ethanol and spraying it onto the Bunsen flame.</p> <p>How do I prepare this solution in terms of how much water, ethanol and salt ?</p>
494
spectroscopy
Reason for different chemical shift in chiral solvents for enantiotopic protons
https://chemistry.stackexchange.com/questions/151378/reason-for-different-chemical-shift-in-chiral-solvents-for-enantiotopic-protons
<p>The chemical shift of enantiotopic protons is defined as follows in <a href="https://www.masterorganicchemistry.com/homotopic-enantiotopic-diastereotopic/" rel="nofollow noreferrer">Spectroscopy/Homotopic, Enantiotopic, Diastereotopic</a></p> <blockquote> <p>Enantiotopic protons have the same chemical shift in the v...
495
spectroscopy
Do microwaves heat polar molecules or molecules with polar bonds?
https://chemistry.stackexchange.com/questions/105268/do-microwaves-heat-polar-molecules-or-molecules-with-polar-bonds
<p>IR is only absorbed my molecules with polar bonds regardless of the overall polarity of the molecule , what about Microwaves ?</p>
<p>It depends on the strength of the incident EMF. Pure <span class="math-container">$\ce{H2}$</span> can be <a href="http://www.scholarpedia.org/article/Microwave_ionization_of_hydrogen_atoms" rel="nofollow noreferrer"><em>ionized</em> by microwave radiation in multi-photon collisions</a>, as well as being heated. Eve...
496
spectroscopy
how to combine Raman spectrum data with different wavenumber
https://chemistry.stackexchange.com/questions/162220/how-to-combine-raman-spectrum-data-with-different-wavenumber
<p>I have two set of spectrum data, the first record (in wavenumbers) looks like this:</p> <pre><code>... 967.0511723 968.9374611 970.8224407 972.7061127 974.5884787 976.4695403 ... </code></pre> <p>And the second record (again, wavenumbers) umber looks like this:</p> <pre><code>... 955.9630179 957.8733753 959.7823965 ...
497
spectroscopy
How to guess the Chemical state in which particular element will be present from XPS data?
https://chemistry.stackexchange.com/questions/163959/how-to-guess-the-chemical-state-in-which-particular-element-will-be-present-from
<p>Since my last post yesterday, I found some leads and started to analyse my data. But then I started encountering more doubts, questions and confusion. Any help will be highly appreciated and will help me in speeding my research.</p> <p>For analysis, I am matching the peak binding energy for each orbital for each ele...
<p>Recently, there a lot of XPS questions here which are being closed or not receiving an answer. The problem is that you are not sharing enough experimental details so nobody has an answer and nobody knows if your 74.76 eV peak is at the true position or not (see the reasons below). You also need get a good XPS textbo...
498
spectroscopy
several coefficient differences in UV-vis Spectroscopy
https://chemistry.stackexchange.com/questions/33223/several-coefficient-differences-in-uv-vis-spectroscopy
<p>Does anyone know what is scattering coefficient, absorption coefficient and extinction coefficient, and how to separate them experimentally?</p>
<p>In most applications, these terms are used interchangeably.</p> <p>Most absorbance spectrophotometers work by measuring the intensity of the light beam that is <em>transmitted</em> through the sample. A strong light beam goes in, and a weaker one comes out the other side. The transmission is the fraction of the l...
499
feature engineering
When is it appropriate to split a dataset on a categorical value and generate $n$ models instead?
https://datascience.stackexchange.com/questions/76222/when-is-it-appropriate-to-split-a-dataset-on-a-categorical-value-and-generate-n
<p>When doing regression or classification when faced with a categorical attribute with <span class="math-container">$n$</span> possible values there are two options:</p> <ol> <li>Feed this attribute directly into your model.</li> <li>Partition your data into <span class="math-container">$n$</span> pieces based on the ...
<p>I've tried 2 several times but it has never proved better than 1.</p> <p>I think the reason is, the more data you feed to a model, the better. The disadvantage of 2 is that the models that are trained use less data than the model in 1.</p> <p>In addition, some features might be independent of the group. For instance...
0
feature engineering
How can I deal with circular features like hours?
https://datascience.stackexchange.com/questions/23933/how-can-i-deal-with-circular-features-like-hours
<p>Assume I want to predict if I'm fit in the morning. One feature is the last time I was online. Now this feature is tricky: If I take the hour, then a classifier might have a difficult time with it because 23 is numerically closer to 20 than to 0, but actually the time 23 o'clock is closer to 0 o'clock.</p> <p>Is th...
<p>The question was already posted, you can find the answer there :</p> <p><a href="https://datascience.stackexchange.com/questions/5990/what-is-a-good-way-to-transform-cyclic-ordinal-attributes">What is a good way to transform Cyclic Ordinal attributes?</a></p> <p>The idea is to transform your time feature into two ...
1
feature engineering
Problem of finding best combination of features when desired feature is feature some_feature_A/some_feature_B
https://datascience.stackexchange.com/questions/55507/problem-of-finding-best-combination-of-features-when-desired-feature-is-feature
<p>Problem is stated: we have giant csv file with one target column and rest are inputs, we don't know these features impact target but we would like to use algorithm that besides using linear and non-linear transformations will also take into account that right solution would be some_feature_A/some_feature_B. Is there...
<p>In theory, I think a deep neural net might be able to find features that are the product of two other columns. There exist some nice mathematical results which guarantee the ability of a neural net (with certain activation functions) to approximate <em>any</em> function, so there's no theoretical reason why a neura...
2
feature engineering
To One-Hot-Encode or not to One-Hot-Encode?
https://datascience.stackexchange.com/questions/57465/to-one-hot-encode-or-not-to-one-hot-encode
<p>I have been struggling to find proof for that but I couldnt</p> <p>Every time I prepare dataset I face the same issue</p> <p>when a column is a classification such as <code>CountryCode</code> or <code>TaskType</code> in this dataset</p> <pre><code>TaskType CountryCode Target 1 61 Red 1 ...
<p>An intuitive explanation, why we should encode categorical features, is that otherwise there will be absolutely another sense of "closeness" between features of the same type. The model will treat this features as continuous and as a result if you have two points in your feature space (p1 with CountryCode 61 and p2 ...
3
feature engineering
How to use feature group?
https://datascience.stackexchange.com/questions/64693/how-to-use-feature-group
<p>Let's say I have a data set like the following:</p> <p><code>file group_a_co_1 group_a_co_2 group_b_co_1 group_b_co_2 file_1 0.8 0.2 0.3 0.7 file_2 0.1 0.9 0.2 0.8 file_3 0.5 0.5 0.7 0.3 ... </code></p> <p>I wonder, whether there are ways/tricks to tell the model about the group information here: sin...
<p>The information in groups 'group_a_co_2' and 'group_b_co_2' are already redundant; they do not add more information to the model. Therefore they can be removed. Adding even more redundant information will not improve your model further.</p>
4
feature engineering
Are there any search algorithms for feature optimization similar to RFE, but which consider all possible combinations?
https://datascience.stackexchange.com/questions/104412/are-there-any-search-algorithms-for-feature-optimization-similar-to-rfe-but-whi
<p>Does anyone know any good search algorithms for feature optimization that search through every possible combination to find the optimal combination of features for maximum predictive power? (Permutations are not important).</p> <p>So far I have been using Recursive Feature Elimination (RFE), which trains a model man...
<p>This is implemented in <code>mlxtend</code> as <code>ExhaustiveFeatureSelector</code>: <a href="http://rasbt.github.io/mlxtend/user_guide/feature_selection/ExhaustiveFeatureSelector/" rel="nofollow noreferrer">docs</a>.</p>
5
feature engineering
An efficient way of calculating/estimating frequency spectrum for an event
https://datascience.stackexchange.com/questions/111996/an-efficient-way-of-calculating-estimating-frequency-spectrum-for-an-event
<p>This is rather a practical question. I'm looking for an efficient way of calculating the frequency of an event for a large number of samples. Here's a more concrete example.</p> <p>Let's say that I have a system with millions of users. Each user has so many different features that I can use to categorize them into d...
<p>Sounds like more of a resource issue, but it is still related to data science, because of its final objective.</p> <p>Dealing with millions of users could require a lot of memory and computing power.</p> <p>That's why client-side processing should be a priority, using client-side functions like javascript.</p> <p>On...
6
feature engineering
Encoding categorical variables using likelihood estimation
https://datascience.stackexchange.com/questions/11024/encoding-categorical-variables-using-likelihood-estimation
<p>I am trying to understand how I can encode categorical variables using likelihood estimation, but have had little success so far.</p> <p>Any suggestions would be greatly appreciated.</p>
<p>I was learning this topic too, and these are what I found:</p> <ul> <li><p>This type of encoding is called <em>likelihood encoding</em>, <em>impact coding</em> or <em>target coding</em></p></li> <li><p>The idea is encoding your categorical variable with the use of target variable (continuous or categorical dependin...
7
feature engineering
Should original features be retained in the model after using them to engineer new features?
https://datascience.stackexchange.com/questions/116904/should-original-features-be-retained-in-the-model-after-using-them-to-engineer-n
<p><strong>BACKGROUND:</strong> I have dataset that includes <code>Race</code> (e.g., White, Black) and <code>Ethnicity</code> (e.g., Hispanic, Non-Hispanic) as <strong>observed variables</strong>. The dataset also includes <code>Race_Ethnicity</code> (e.g., Hispanic White, Non-Hispanic Black) as an <strong>engineere...
8
feature engineering
2D matrix for labelbinarizer
https://datascience.stackexchange.com/questions/27130/2d-matrix-for-labelbinarizer
<p>There is one behavior of <a href="http://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.LabelBinarizer.html" rel="nofollow noreferrer">labelbinarizer</a> </p> <pre><code>import numpy as np from sklearn import preprocessing lb = preprocessing.LabelBinarizer() lb.fit(np.array([[0, 1, 1], [1, 0, 0]]))...
<p>I think the documentation is kind of self-explanatory here. Fit takes in array of size <code>n_samples</code> in which each element is the class of the datum or if the data point belongs to multiple classes, the input would be obviously of size <code>n_samples x n_classes</code>. That is what you gave in as input in...
9
feature engineering
numerical or categorical data
https://datascience.stackexchange.com/questions/17124/numerical-or-categorical-data
<p>I have a feature for machine learning (using methods like SVM, naive bayes, neural network and random forest) called member duration as follows: Should I make it as numerical or categorical data?</p> <p><a href="https://i.sstatic.net/fyMsI.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/fyMsI.png" al...
<p>You definitely have <strong>interval</strong> data, that is, data which takes on discrete values, as opposed to <strong>continuous</strong> data, which takes on values along a continuum. </p> <p>It may be of value to additionally determine if the data is <strong>ordinal</strong>, meaning that the order of the value...
10
feature engineering
Effect of Skewness and data range in machine learning
https://datascience.stackexchange.com/questions/17125/effect-of-skewness-and-data-range-in-machine-learning
<p>I have a feature for machine learning as follow that skew to the left, and only have number in certain number range (here 0-2000). Will skewness and range of number affect the learning? If yes what should I do?</p> <p><a href="https://i.sstatic.net/M00zz.png" rel="nofollow noreferrer"><img src="https://i.sstatic.ne...
<p>Typically, folks would transform the variable. When it is strictly greater than zero, a log transform is usually sufficient. If zero is included, as in your case, one popular alternative is the <a href="https://en.wikipedia.org/wiki/Power_transform" rel="nofollow noreferrer">box-cox transformation</a>.</p>
11
feature engineering
What is a good approach for a lifespan?
https://datascience.stackexchange.com/questions/35730/what-is-a-good-approach-for-a-lifespan
<p>Let's say I wan't to predict the lifespan of an ad in a listing.</p> <p>I know a bunch of thing from the ad like:</p> <ul> <li>the title</li> <li>the price</li> <li>the location</li> <li>etc</li> </ul> <p>The target value is the duration of the ad in the listing before it's being removed (item has been sold).</p>...
<p>I think you need to come up with a way to treat the data such that you're thinking in days, not hours, right? The peaks look they're just at 24, 48, 72, 96, (1 day, 2 days, 3 days, 4 days) etc, and are pretty much normally distributed around those peaks.</p> <p>I think a good test might be to try a categorical appr...
12
feature engineering
Is it safe to say if features are generated once for a dataset, it may be used for any relevant algorithm?
https://datascience.stackexchange.com/questions/32491/is-it-safe-to-say-if-features-are-generated-once-for-a-dataset-it-may-be-used-f
<p>If I have generated features using state of the art feature engineering methods of a dataset, can I use it for any kind of algorithm to build the model apart from few modifications in the features so as to plug in different algorithm?</p> <p>Is there any dependency of algorithm while building features from dataset?...
<p>No.</p> <p>An example: feature engineering for Gradient Boosting algorithms.</p> <p>XGBoost can't handle categorical variables - you need to use one-hot encoding, target encoding, or something like that if you want to use it.</p> <p>On the other hand more recent GBM libraries like CatBoost or LightGBM can handle ...
13
feature engineering
Calculating risk or amount of slipperiness based on historical weather data
https://datascience.stackexchange.com/questions/131176/calculating-risk-or-amount-of-slipperiness-based-on-historical-weather-data
<p>Given hourly updates of precipitation amount (for the preceding hour) and temperature, how would you calculate if it's slippery or not?</p>
<p>A purely physical model, i.e. no training data, I would say something along the lines of: IF temperature was (and still is) below 0 centigrade and precipitation was between now and up to an hour before the onset of freezing larger than 0 then: SLIPPERY.</p> <p>If you have historical data, connecting slippery observa...
14
feature engineering
Why should I not use Id as a field in feature engineering for ML
https://datascience.stackexchange.com/questions/130496/why-should-i-not-use-id-as-a-field-in-feature-engineering-for-ml
<p>While feature engineering and deriving features why should I not use I’d as a field for tasks like regressions</p>
<p>An Id, like a person’s name, is typically a unique identifier with no meaningful relationship to the target variable. Since it doesn’t carry any inherent pattern or information relevant to the outcome, it usually lacks statistical significance and can introduce noise into the model</p>
15
feature engineering
Cyclic dependency between feature and predictor class
https://datascience.stackexchange.com/questions/90469/cyclic-dependency-between-feature-and-predictor-class
<p>I have a feature which has specific categorical values ex(Technology, Hardware, Software, Marketing, Evnts etc). Based on this and some other features, I am trying to classify the dataset into 2 categories IsSoftwareSystem or NotSoftwareSystem. In this case is this cause a reduce in accuracy because i am feeding the...
<p>You have two problems:</p> <ol> <li>Technical problem: As 10xAI said in a comment, if the target also belongs to the features then the model should very easily predict every instance correctly. So you should obtain perfect performance on the test set. The ML model doesn't care about &quot;cyclic dependency&quot;, it...
16
feature engineering
Do I need to square a column if I want a neural network to try using that?
https://datascience.stackexchange.com/questions/80938/do-i-need-to-square-a-column-if-i-want-a-neural-network-to-try-using-that
<p>In the classical linear regression implementation, if I suspect the square of the values of the column is correlated to the target, then I actually need to create a new column with the squares for the algorithm to make use of that.</p> <p>Is this also necessary when using neural networks? I know it's a broad questio...
<p>You don’t necessarily <em>need</em> to, according to the <a href="https://medium.com/predict/artificial-neural-networks-universal-function-approximators-cf5198224b58" rel="nofollow noreferrer">universal function approximation theorem</a>.</p> <ul> <li>It is easier for a neural network to learn an identity function t...
17
feature engineering
Reduce Categorical Values
https://datascience.stackexchange.com/questions/82757/reduce-categorical-values
<p>I'm working on one use case where I have to explore source code repo files. Different files will be a categorical values for me. But with such large number of files, One Hot Encoding comes out to be very large.</p> <p>Also, all files are divided among unique modules, such that each files belongs to a specific module...
<p>Recently practitioners are representing categorical variables as embeddings for ML models. I can see a solution to your problem there.</p> <p>As your problem is having a two-level hierarchy you can consider two embeddings, one set of embeddings for modules, and another set for files. For every document, you can tak...
18
feature engineering
Generate new features from two columns
https://datascience.stackexchange.com/questions/85551/generate-new-features-from-two-columns
<p>I have database with three columns, y,x1 and x2:</p> <pre><code>&gt;&gt;&gt;y x1 x2 0 0.25 -19.3 -25.1 1 0.24 -18.2 -26.7 2 0.81 -45.2 -31.4 ... </code></pre> <p>I want to create more features based on the x columns. until now I have just created random functions and tries to check their co...
<p>You are going to have to do something - You can try combining them in different ways, multiply them together, divide them by each other, subtract one from another. Without the context around what these features actually relate to its difficult to say what would make sense. Ultimately to make a new derived feature yo...
19
feature engineering
What is best practice to feature engineer from prior event counts?
https://datascience.stackexchange.com/questions/84633/what-is-best-practice-to-feature-engineer-from-prior-event-counts
<p>Say for example I am building a model to predict a customer churn event from Spotify, with my target being whether a customer churns in the next 90 days.</p> <p>One feature I might expect could be predictive of this event is customers checking their billing statements online - so I might engineer features for each c...
<p>You may want to try both options out and see which is better. Feature engineering I think is more like a trial and error (iterative) process.</p>
20
feature engineering
Feature engineering and longitudinal data
https://datascience.stackexchange.com/questions/88029/feature-engineering-and-longitudinal-data
<p>I need some advice for my feature engineering. Suppose I have 90 days follow-up data. on 12 patients and I have the vital status of the patients at the end of these 90 days (deceased=1, alive=0)</p> <pre><code>ID&lt;-as.factor(c(1,1,1,2,2,2,2,3,3,4,4,4)) time&lt;-c(0,12,36,0,7,23,68,0,23,0,32,45) Age&lt;-rnorm(12,45...
21
feature engineering
Skewed binomial data for small p
https://datascience.stackexchange.com/questions/10463/skewed-binomial-data-for-small-p
<p>Say you have a binomial distribution with $p$ very small ($\approx 0.001$). </p> <p>You are asked to predict the conditional success rate $SR=S/T$ with $S$ successes out of $T$ trials given a set of conditions $X$.</p> <p>One would expect (correct me if I'm wrong, though I ran simulations and am quite confident) $...
<p>When fitting a GLM (at least in R), I know there is a optional weight vector that you can include. This weight is not to give more importance to an observation, but to rather weight observations based on $T$ for example.</p> <p>The R documentation says:</p> <pre><code> For a binomial GLM prior weights are used to...
22
feature engineering
Transformation of Dependent and Independent Variables
https://datascience.stackexchange.com/questions/17542/transformation-of-dependent-and-independent-variables
<p>I have a few Independent variables that's normal and a Dependent variables that's skewed , I pick <strong>log(feature+SHIFT)</strong> to correct skewness. The procedure I follow to get prediction is just take <strong>exp(predictions)-SHIFT</strong>.</p> <p>Now how do I get my predictions for the following cases.</p...
23
feature engineering
Why is there a difference in performance across the feature descriptors for the same imaging modality?
https://datascience.stackexchange.com/questions/24764/why-is-there-a-difference-in-performance-across-the-feature-descriptors-for-the
<p>I've been using GIST, HOG and SURF descriptors for extracting features from different collections of Chest-X-rays and measuring performance using accuracy and area under the curve. These collections are obtained using different machinery, from different medical institutions, and, with different pixel resolutions. I ...
<p>Feature-extraction mechanisms like GIST, HOG, etc are built and optimized to improve performance on given datasets. Because of this, they don't perform as well across datasets. It's kind of like putting specialized fuel in a vehicle that isn't built to utilize it - it might even do harm.</p> <p>Hand-engineered fe...
24
feature engineering
Feature engineering for hierarchical data
https://datascience.stackexchange.com/questions/25910/feature-engineering-for-hierarchical-data
<p>I am working on the KDD dataset given in this <a href="https://www.kaggle.com/c/kddcup2012-track1#Description" rel="nofollow noreferrer">link</a>. </p> <p>The dataset is related to a typical recommendation systems dataset. So you find an item and information about the item. One of the information given about the It...
25
feature engineering
Differences of get_dummies and labelbinarizer?
https://datascience.stackexchange.com/questions/27126/differences-of-get-dummies-and-labelbinarizer
<p>Are there any differences between <a href="https://pandas.pydata.org/pandas-docs/stable/generated/pandas.get_dummies.html" rel="nofollow noreferrer">get_dummies</a> and <a href="http://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.LabelBinarizer.html" rel="nofollow noreferrer">labelbinarizer</a> in...
<p>A couple of things comes to mind.</p> <p>get_dummies can transform a dataframe with many columns, whereas LabelBinarizer will only do one column. </p> <p>get_dummies outputs a dataframe (if the input is a dataframe) with a nicely formatted columns, whereas LabelBinarizer outputs a numpy array, so if you want to at...
26
feature engineering
specific feature engineering for specific algorithm
https://datascience.stackexchange.com/questions/28398/specific-feature-engineering-for-specific-algorithm
<p>Days ago,One AI financial service provider offered us a lesson and mentioned that you are supposed to perform specific feature engineering according to the specific algorithm you are using.For example,when using logistics regression,fitting more features(uncorrelated)like binning the continuous variable into discret...
<p>In general, features are engineered so as to retain optimum relevant information present in the dataset with succinct representation and then features are adapted so that an algorithm can accept it as input.</p> <p>Feature engineering generally involves methods like binning, PCA, etc. Adapting those features to pas...
27
feature engineering
How to represent a set of sets as a vector
https://datascience.stackexchange.com/questions/29693/how-to-represent-a-set-of-sets-as-a-vector
<p>I'm pretty new to machine learning.</p> <p>I know I can represent a set of discrete values as a vector of 0/1 values. For instance, in the set of features {a, b, c, d, e}, the subset containing <code>{a, c}</code> can be represented as <code>[1, 0, 1, 0, 0]</code> and the subset containing <code>{c, d, e}</code> ca...
<p>You are describing <a href="https://en.wikipedia.org/wiki/One-hot" rel="nofollow noreferrer">one-hot</a> encoding. There is a slot for each element. If the element is present, the slot has a one, and if the element if not present, the slot has a zero.</p> <p>Typically, people will encode orthogonal features in diff...
28
feature engineering
Storing engineered features in a database
https://datascience.stackexchange.com/questions/32414/storing-engineered-features-in-a-database
<p>I have some data in raw csv files which I would like to store in a MySQL database. The problem is there are constant feature engineering done on this dataset so coming up with one schema to fit all the needs is not possible. The approach I thought of was to have one main table where the original data is held, and ...
<p>Depending on the technical level of your users, the frequency of the update, the complexity of the transformation, the need to share these features among the users, etc. would a custom VIEW for each user be a feasible solution?</p> <p>Alternately, would you consider some ETL tools where you can create/ modify calcu...
29
feature engineering
How to aggregate data where instances occur over different time intervals
https://datascience.stackexchange.com/questions/34423/how-to-aggregate-data-where-instances-occur-over-different-time-intervals
<p>I am working on a problem in which I have several instances that have predictors that have activity over various different time periods (i.e. &lt;3 months to well over 20 months.) Originally I attempted to use knowledge I have about this problem (it is an opportunity to sale conversion model) and learned that the av...
<p>I had the same problem. you can use aggregation functions. For example use Max, Min, Avg, count, std or some calculation like the slope of the line. In cases which you have a different period, you can divide your value to days of each period.</p>
30
feature engineering
kde plot for interpreting the correlation
https://datascience.stackexchange.com/questions/36575/kde-plot-for-interpreting-the-correlation
<p>i have created some new features for my model. I found people use kde plot to find out the correlation between the created feature and the target variable, but I am not really sure how to find the correlation from kde.</p> <p>Any help on how to interpret the correlation from kde plot will very helpful </p>
<p><a href="https://www.kaggle.com/c/home-credit-default-risk/discussion/62669" rel="nofollow noreferrer">CoreyLevinson on kaggle</a> answered my question. I am simply adding the explaination.</p> <p>The kde shows the density of the feature for each value of the target. There are usually 2 colored humps representing t...
31
feature engineering
How important is it for each row of data to have the same number of features?
https://datascience.stackexchange.com/questions/42494/how-important-is-it-for-each-row-of-data-to-have-the-same-number-of-features
<p>I'm using decision tree learning to try and classify a device based its components. Different devices have a different number of components and the location of these components within the device is important.</p> <p>Device 1 might have components 9, 3, 8, 4, and 1 in that order. Then device 2 might have components ...
<p>I think you need to create a dataset with features covering all component / position options - i.e. create a dataset that is 60+ columns wide. This dataset would contain observations for both larger and smaller devices (you might want to take care in the balance between small and large devices). This is because many...
32
feature engineering
Feature engineering from date, mean and standard deviation
https://datascience.stackexchange.com/questions/43514/feature-engineering-from-date-mean-and-standard-deviation
<p>I have a multi class classification problem where I should predict the passengers for flights (0-7 classes). The training set consists of the following features:</p> <ul> <li>Date of the flight</li> <li>Mean of the weeks that the passengers bought their tickets</li> <li>Standard Deviation of the above</li> </ul> <...
<p>Date fields are quite interesting data since the limit of what you can "feature engineer" with them is your imagination. However, it is difficult to know a priori if one of them will improve your model before you try it.</p> <p>Here some ideas:</p> <ol> <li>Year</li> <li>Month (1-12)</li> <li>Day of Month (1-31)</...
33
feature engineering
Problem with important feature having a lot of missing value
https://datascience.stackexchange.com/questions/45284/problem-with-important-feature-having-a-lot-of-missing-value
<p>I am facing a dilemma with a project of mine. One of the variables (numerical) doesn't have enough data i,e almost 99% data are missing. However, upon talking to the domain experts, it appears that the particular variable is important to the problem we are trying to solve (model). Initially, I thought of converting ...
<p>What is the best way to deal with this kind of missing value problem can only be answered empirically? It will vary depending on your dataset and algorithm of choice. But here is a few things you can try.</p> <p><strong>Impute the missing value</strong></p> <ul> <li>Impute missing value of the mean</li> <li>Impute...
34
feature engineering
Feature encoding for multiple JSON objects
https://datascience.stackexchange.com/questions/45996/feature-encoding-for-multiple-json-objects
<p>I have a dataset, where a particular feature is a collection of many JSON objects for a single feature.</p> <pre><code>Timestamp Observations 1 {"name":"bob", "place":"TX"},{"name":"ann", "place":"NY"},{"name":"jack", "place":"MA"},{"name":"jill", "place":"CA"} 2 {"name":"bob", "place":"TX"...
35
feature engineering
Creating a metric based on some features
https://datascience.stackexchange.com/questions/48361/creating-a-metric-based-on-some-features
<p>I want to create a new metric based on some features but dont know how to start. I basically want to create a "job satisfaction level" metric based on some features. The features could be work hours, shift, If working on weekend and so on. I dont know how to start. In ideal world, I want to comp up with weights for ...
<p>Indeed, there are methodologies that have been tested elsewhere, some with greater and less success.</p> <p>I will propose one of them to build a prediction of job satisfaction, which you can then enter as an explanatory variable in a supervised model of employee resignation, whose methodology you can review in thi...
36
feature engineering
Transformation of non-categorical discrete feature
https://datascience.stackexchange.com/questions/53692/transformation-of-non-categorical-discrete-feature
<blockquote> <p>Goal: Predict a performance score of a place of interest in a given city based on (amongst others), the number of restaurants within 200m. <span class="math-container">$\\$</span></p> <p>Dataset: <span class="math-container">$D$</span> with a feature <span class="math-container">$x$</span> indica...
37
feature engineering
Reduction of feature values
https://datascience.stackexchange.com/questions/56112/reduction-of-feature-values
<p>I have a data set of 700+ mil records with a feature that should yield good predictive power. The problem is that it has far more unique values than it should. The 10k+ unique values should map to about 150. I have that list of 150 values I want them to map to. Thinking about using a distance algorithm (levenshtein?...
<p>I agree with the idea of using a similarity or distance measure (approximate string matching). I would try a bunch of them and test them on a sample: Levenshtein, Jaro, overlap coefficient or cosine (optionally with TF-IDF) over bi/tri-grams of characters. </p> <p>I would also try to capture the most common abbrevi...
38
feature engineering
Relative feature importance w.r.t hyperparameters
https://datascience.stackexchange.com/questions/71818/relative-feature-importance-w-r-t-hyperparameters
<p>Could changing the hyperparameters of a model change <strong><em>relative</em></strong> feature importance?</p>
<p>Yes. The most obvious example is when using a Lasso regression : for an increasing <span class="math-container">$\alpha$</span> parameter you will have more and more coefficients set to zero. This resulting in a smaller set of features and thus a bigger share of feature importance for remaining features.</p>
39
feature engineering
Is it suitable to change a feature by itself to generate an another feature?
https://datascience.stackexchange.com/questions/72584/is-it-suitable-to-change-a-feature-by-itself-to-generate-an-another-feature
<p>Hi all I would love to hear your answers on this. Lets say I have two variables, voltage and current, in my data set. I could add another feature by squaring current (so as to calculate power). </p> <p>Is this an example of feature engineering?</p> <p>Recently I tried to predict on a diameter prediction on asteroi...
<p>Sure, that's feature engineering.</p> <p>If you're fitting a linear model, then you are looking for features that have a linear relationship with the predicted value. If you're predicting, say, the cost per hour of a device consuming current I, then clearly that's directly related to power not current, so <span cla...
40
feature engineering
Tensor Flow Time Series Tutorial Question
https://datascience.stackexchange.com/questions/74018/tensor-flow-time-series-tutorial-question
<p>In the tutorial, they normalize the data and say "The mean and standard deviation should only be computed using the training data"</p> <p>What does this refer to? Why should you only use the training data?</p>
<p>When building <strong>any</strong> Machine Learning model, the only observable data you have is training data. Test data is supposed to be unobserved data, meaning that even though you might have it now, you need to act as if you didn't. When you apply normalisation, you first observe the data to get the parameters ...
41
feature engineering
XGBoost with deep trees
https://datascience.stackexchange.com/questions/89661/xgboost-with-deep-trees
<p>I've been exploring the use of XGBoost in many different applications. Up to now, I always find the best results with shallow trees (from 1 to 3 levels), with the rest of the parameters very dependent on the problem.</p> <p>On my current assignment, I found that I get a much better performance if I use &gt;300 trees...
42
feature engineering
Aggregate Categorical Data
https://datascience.stackexchange.com/questions/60589/aggregate-categorical-data
<p>I have a scenario in which I'm required to run my analysis at the Account level. One of the features that I'd like to look at is the no. of subscriptions against an account. There can be multiple subscriptions against one account. I wonder how I can "aggregate" these multiple subscriptions and roll them up at the Ac...
<p>You can use pandas groupby function to group your rows according to accounts and then perform your desired operation on them.</p>
43
feature engineering
Test for feature dependencies in time series modelling
https://datascience.stackexchange.com/questions/77921/test-for-feature-dependencies-in-time-series-modelling
<p>I have time-series data that track event occurrence in 3 locations. Here's a sample:</p> <pre><code> Count Total Location A B C Date 2018-06-22 0 1 1 2 2018-06-23 2 1 0 3 2018-06-24 0 0 1 1 2018-06-25 2 2 1 5 2018-06...
<blockquote> <p>How do I test if an event happening in one location has an impact on events happening in another location (dependency)?</p> </blockquote> <ul> <li><a href="https://en.wikipedia.org/wiki/Pearson_correlation_coefficient" rel="nofollow noreferrer">Pearson correlation</a> between the two columns would alrea...
44
feature engineering
Serving feature pipeline
https://datascience.stackexchange.com/questions/90453/serving-feature-pipeline
<p>Imagine, there is a service, providing credit history for customers in form of list of his loans. Let's call it <strong>my-loan-service</strong>. For the sake of simplicity - I can <code>GET http://my-loan-service/42</code> (where 42 is my customer id) and get back <code>json</code></p> <pre class="lang-json prettyp...
45
feature engineering
How can I transform a sequence into features
https://datascience.stackexchange.com/questions/90700/how-can-i-transform-a-sequence-into-features
<p>When Machine Learning libraries don't support categorical features those features can be one-hot encoded into a series of binary feature columns. I have a feature that represents a sequence or permutation of values and I want to transform it into something scikit-learn or similar ML libraries can use. What are the...
46
feature engineering
I do feature engineering on the full dataset, is this wrong?
https://datascience.stackexchange.com/questions/80770/i-do-feature-engineering-on-the-full-dataset-is-this-wrong
<p>I am aiming to predict the number of days it takes to sell a given property, let's call this variable &quot;DaysForSale&quot; - in short DfS</p> <p>Using the DfS I created a variable called &quot;median_dfs_grouped_street_name&quot; which returns the median days it takes to sell a property for the different streets ...
<blockquote> <p>Is it wrong to develop features using the target variable?</p> </blockquote> <p><strong>Not necessarily</strong>. It is called &quot;target encoding&quot; or &quot;Mean encoding&quot; and can be very useful. In your case you could, for example, use the <code>DfS</code> of your train data to calculate a ...
47
feature engineering
Is my idea of a Feature Store wrong?
https://datascience.stackexchange.com/questions/90980/is-my-idea-of-a-feature-store-wrong
<p><a href="https://www.reddit.com/r/MachineLearning/comments/ma59mt/d_is_my_idea_of_a_feature_store_wrong/" rel="nofollow noreferrer">Cross-posted on Reddit ML</a>.</p> <p>Should a Feature Store be part of an enterprise data catalog?</p> <p>To me, a feature store seems to be a highly niche data catalog but missing a l...
48
feature engineering
Using on-demand features in machine learning
https://datascience.stackexchange.com/questions/96774/using-on-demand-features-in-machine-learning
<p>I have 6 input features <span class="math-container">$[m1,m2,m3,m4,m5,m6]$</span>.</p> <p>I am trying to build a model that can predict the value of all 6 of these values using <span class="math-container">$[m1,m2,m3]$</span>. However, I have the option of asking for another feature from <span class="math-container"...
49
model evaluation
Changing the number of model evaluations per generation
https://datascience.stackexchange.com/questions/131259/changing-the-number-of-model-evaluations-per-generation
<p>When fitting a model with the AutoTS package, it will fit a number of models per generation (it uses the genetic algorithm). However, there does not seem to be an option to edit the number of different models that are evaluation per generation.</p> <p>As such, I am wondering how to edit the number of different model...
50
model evaluation
XGBoost Feature Importance, Permutation Importance, and Model Evaluation Criteria
https://datascience.stackexchange.com/questions/65608/xgboost-feature-importance-permutation-importance-and-model-evaluation-criteri
<p>I have built an XGBoost classification model in Python on an imbalanced dataset (~1 million positive values and ~12 million negative values), where the features are binary user interaction with web page elements (e.g. did the user scroll to reviews or not) and the target is a binary retail action. My ultimate goal w...
<p><strong>So your goal is only feature importance from xgboost?</strong></p> <p>Then <strong>don't focus on evaluation metrics</strong>, but rather splitting.</p> <p>I would suggest to read <strong><a href="https://explained.ai/rf-importance/" rel="nofollow noreferrer">this</a>.</strong> Using the default from tree ba...
51
model evaluation
Why exactly using a test set for model evaluation is a bad idea?
https://datascience.stackexchange.com/questions/23309/why-exactly-using-a-test-set-for-model-evaluation-is-a-bad-idea
<p>I don't understand why using the <em>test set</em> for model <strong>evaluation</strong> is a bad idea.</p> <p>I completely understand why you should not use your test set to <strong>train</strong> your model (because in that case, you would be memorizing and you just cannot tell whether your model will generalize ...
<p><em>Choosing</em> a variation of your model is a form of training. Just because you are not using gradient descent or whatever training process is core to a model class, does not mean your parameters are not influenced by this selection process. If you generated many thousands of models with random parameters and pi...
52
model evaluation
Topic modeling evaluation
https://datascience.stackexchange.com/questions/126302/topic-modeling-evaluation
<p>I'm working on topic modeling and I have generated clusters with two different methods.</p> <p>How can I evaluate which method performs better than the other?</p> <p><a href="https://i.sstatic.net/2JGKo.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/2JGKo.png" alt="" /></a><a href="https://i.sstatic....
<p>Evaluating unsupervised learning methods is always an interesting question. There are typically two main ways to evaluate clusters.</p> <h1>Explicit evaluation</h1> <h2>Qualitative analysis</h2> <p>First of all, you should always manually inspect the results to make sure they make sense to you. In practice, this is ...
53
model evaluation
Error-analysis and evaluation of a model using Python?
https://datascience.stackexchange.com/questions/52004/error-analysis-and-evaluation-of-a-model-using-python
<p><strong>My method of evaluating a model is the following :</strong> </p> <ol> <li>Split the training data set and do cross validation to obtain an accuracy of my model on my cross validation data set.</li> <li>Use the parameters that gave me the best accuracy and use predict() on my test data set ( hold-out data se...
54
model evaluation
Can using model evaluation metrics to choose a model cause data leakage?
https://datascience.stackexchange.com/questions/116626/can-using-model-evaluation-metrics-to-choose-a-model-cause-data-leakage
<p>I was reading <a href="https://changhsinlee.com/better-validation-test/" rel="nofollow noreferrer">a blog post</a> about improving machine-learning model train/validate/test splits. Towards the end was this remark:</p> <blockquote> <p>I say we should be more creative in the way we test machine learning models than a...
<p>This is exactly the same reason why hyper-parameter tuning, feature selection and other decisions which impacts the final model should be done on a validation set, not on the final test set.</p> <p>In theory one should really evaluate the model only once on a fresh test set, so if there is a chance that a model won'...
55
model evaluation
Bias-variance trade-off and model evaluation
https://datascience.stackexchange.com/questions/110026/bias-variance-trade-off-and-model-evaluation
<p>Suppose that we have train a model (as defined by its hyperparameters) and we evaluated it on a test set using some performance metric (say <span class="math-container">$R^2$</span>). If we now train the same model (as defined by its hyperparameters) on a different training data we will get (probably) a different va...
<p>Estimating the variance in generalization error is useful and is best assessed through <a href="https://en.wikipedia.org/wiki/Cross-validation_(statistics)" rel="nofollow noreferrer">cross-validation</a> (not on train/test split). The data should be split into folds and each fold should be trained with the same algo...
56
model evaluation
More representative data set OR higher model evaluation metrics?
https://datascience.stackexchange.com/questions/113772/more-representative-data-set-or-higher-model-evaluation-metrics
<p>A colleague and I are working on a churn model and reached an impasse:</p> <p>Our data set is for a global product. We've been asked to look at the US market only.</p> <p>When we subset the data to the US only, the classifier evaluation metrics are lower than when we use the total global data set.</p> <p>My colleagu...
<p>You could consider it a hyperparameter and tube it to the best value.</p> <p>As you point out, there are multiple possibilities. Your stance of using only the most representative data has merit; the stance of using all available data has merit, since more data results in tighter estimates, and nothing says that Amer...
57
model evaluation
Model evaluation approach allowing manual experimentation without data leakage
https://datascience.stackexchange.com/questions/128804/model-evaluation-approach-allowing-manual-experimentation-without-data-leakage
<p>In supervised machine learning, are there any evaluation approaches <em>beside</em> using a fixed holdout test dataset, which allow me as a scientist to <strong>manually</strong> compare preprocessing approaches, without leaking information from the test dataset.</p> <p>For example, if I want to compare feature sele...
<p>Instead of splitting the data in two parts, train and test, you could split the data into more parts. Basically, every time you want to evaluate something you need data that is completely unseen.</p>
58
model evaluation
Keras model evaluation accuracy vs. observation
https://datascience.stackexchange.com/questions/64844/keras-model-evaluation-accuracy-vs-observation
<p>I am a newbie here and trying to make sense out of the scores from <code>model.evaluate</code> from what I am actually seeing in <code>model.predict</code></p> <p>I have a created a CNN model for the Google Audio Set data and achieved a 99%+ accuracy on training.</p> <p>Here is how I do the prediction</p> <pre cl...
<p>Actually, I think accuracy is not a good metric for this case as <code>y_actual</code> and <code>y_expected</code> have most values <code>0</code> and the length of <code>y_actual</code> is quite big too. </p> <p>So the accuracy calculation using an equation like <code>K.mean(K.equal(K.argmax(y_true, axis=-1), K.ar...
59
model evaluation
Time series analysis model evaluation performance metrics integration in time series application
https://datascience.stackexchange.com/questions/82758/time-series-analysis-model-evaluation-performance-metrics-integration-in-time-se
<p>After study in time series analysis, I recognized RMSE and MAPE are the best evaluation metrics for used model in real time series application. But my queries are below as this is my first practice application project in time series analysis:</p> <p>If I use past 1 year data for training and forecast for next 30 da...
<p>I am assuming you have a model running in production and it retrains periodically (example: every month) and it forecasts for the next X days (example: 30 days) and you are trying to evaluate the model using RMSE and MAPE (If this assumption is wrong, please clarify it in your question)</p> <blockquote> <p>If I use ...
60
model evaluation
Evaluation of model on imperfect validation set
https://datascience.stackexchange.com/questions/131495/evaluation-of-model-on-imperfect-validation-set
<p>I would like to get help with evaluation of my classification model. It is a typical model that for each input produces vector of floats that represents probabilities of labels and I classify the input with label with highest probability.</p> <p>But I have a problem with evaluation of this model. The reason is, that...
<p>You could easily compute the TP, TN, FP and FN for your use case and then you can compute accuracy, recall, precision, f1, confusion matrix, ...</p> <p>For example, for TP, instead of computing the number of samples where prediction == 1 and target == 1, you compute the number of samples for which prediction &quot;i...
61